migrated to Java 8
This commit is contained in:
@ -5,6 +5,8 @@
|
||||
*/
|
||||
package de.muehlencord.shared.util;
|
||||
|
||||
import static de.muehlencord.shared.util.OSUtil.getOperationSystem;
|
||||
import static java.lang.System.getProperties;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@ -19,8 +21,8 @@ public class OSUtilTest {
|
||||
*/
|
||||
@Test
|
||||
public void testGetOS() {
|
||||
String osName = System.getProperties().getProperty("os.name").toUpperCase();
|
||||
int os = OSUtil.getOperationSystem();
|
||||
String osName = getProperties().getProperty("os.name").toUpperCase();
|
||||
int os = getOperationSystem();
|
||||
|
||||
switch (osName) {
|
||||
case "LINUX":
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package de.muehlencord.shared.util;
|
||||
|
||||
import static de.muehlencord.shared.util.StringUtil.getValueBetweenKeywords;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import static org.junit.Assert.*;
|
||||
@ -16,7 +17,7 @@ public class StringUtilTest extends DefaultTest {
|
||||
public void testGetValueBetweenKeywords() throws ParseException, IOException {
|
||||
String content = readContentFromFile("test.txt");
|
||||
|
||||
String ipAddress = StringUtil.getValueBetweenKeywords(content, "The IP", "has just");
|
||||
String ipAddress = getValueBetweenKeywords(content, "The IP", "has just");
|
||||
assertEquals("ipAddress", "222.184.230.118", ipAddress);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
*/
|
||||
package de.muehlencord.shared.util.file;
|
||||
|
||||
import static de.muehlencord.shared.util.file.FileUtil.getFilesFromDirecotry;
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
@ -29,7 +30,7 @@ public class FileUtilTest {
|
||||
URL url = getClass().getResource("testfile.txt");
|
||||
File testFile = new File(url.getFile());
|
||||
|
||||
List<File> fileList = FileUtil.getFilesFromDirecotry(testFile.getParent(), ".*.java");
|
||||
List<File> fileList = getFilesFromDirecotry(testFile.getParent(), ".*.java");
|
||||
Iterator<File> it = fileList.iterator();
|
||||
while (it.hasNext()) {
|
||||
System.out.println(it.next());
|
||||
|
||||
Reference in New Issue
Block a user