updated to log4j2
This commit is contained in:
@ -3,10 +3,6 @@ package de.muehlencord.shared.network;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import org.apache.log4j.PropertyConfigurator;
|
||||
import static org.apache.log4j.PropertyConfigurator.configure;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -14,15 +10,6 @@ import org.junit.BeforeClass;
|
||||
*/
|
||||
public class BaseTest {
|
||||
|
||||
/**
|
||||
* inits logging according to default setup in package
|
||||
*/
|
||||
@BeforeClass
|
||||
public static void initLogging() {
|
||||
URL defaultConfigUrl = BaseTest.class.getResource("/logging.properties");
|
||||
configure(defaultConfigUrl);
|
||||
}
|
||||
|
||||
public String readContentFromFile(String name) throws IOException {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@ -4,6 +4,7 @@ import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import org.apache.commons.net.util.SubnetUtils;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@ -16,6 +17,7 @@ public class NetworkScannerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // takes very long
|
||||
public void testScan() throws UnknownHostException {
|
||||
String ipAddress = InetAddress.getLocalHost().getHostAddress();
|
||||
SubnetUtils utils = new SubnetUtils(ipAddress, "255.255.255.0");
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package de.muehlencord.shared.network;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@ -13,6 +14,7 @@ public class PortScannerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // takes very long
|
||||
public void testMain() {
|
||||
PortScanner portScanner = new PortScanner();
|
||||
List<PortInformation> resultList = portScanner.scan("127.0.0.1");
|
||||
|
||||
@ -6,8 +6,10 @@ import de.muehlencord.shared.network.mail.imap.ImapMailReader;
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Before;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@ -22,12 +24,13 @@ public class MailMessageUtilsTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // depends on environment
|
||||
public void testGetInstance() throws Exception {
|
||||
System.out.println("testGetInstance");
|
||||
URL testConfigURL = MailMessageUtilsTest.class.getResource("/test.properties");
|
||||
File file = new File(testConfigURL.toURI());
|
||||
|
||||
if ((file == null) || (!file.exists())) {
|
||||
if (!file.exists()) {
|
||||
return; // Skip test if config file is not available
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,9 @@ import de.muehlencord.shared.network.mail.MailReaderConfiguration;
|
||||
import de.muehlencord.shared.network.mail.MailReaderConnectionException;
|
||||
import de.muehlencord.shared.network.mail.MailReaderException;
|
||||
import java.util.List;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
@ -26,6 +28,7 @@ public class ImapMailReaderTest extends BaseTest {
|
||||
* @throws Exception if the tests fails
|
||||
*/
|
||||
@Test
|
||||
@Ignore // depends on environment
|
||||
public void testConnect() throws Exception {
|
||||
System.out.println("connect");
|
||||
String meta = "meta.muehlencord.intra";
|
||||
@ -37,6 +40,7 @@ public class ImapMailReaderTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // depends on environment
|
||||
public void testGetFolder() throws Exception {
|
||||
System.out.println("getFolder");
|
||||
String meta = "meta.muehlencord.intra";
|
||||
@ -50,6 +54,7 @@ public class ImapMailReaderTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // depends on environment
|
||||
public void testGetMessageCount() throws MailReaderConnectionException, MailReaderException {
|
||||
System.out.println("testGetMessageCount");
|
||||
String meta = "meta.muehlencord.intra";
|
||||
@ -62,6 +67,7 @@ public class ImapMailReaderTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // depends on environment
|
||||
public void testGetSubFolder() throws MailReaderConnectionException, MailReaderException {
|
||||
System.out.println("getSubFolder");
|
||||
String meta = "meta.muehlencord.intra";
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package de.muehlencord.shared.network.whois;
|
||||
|
||||
import de.muehlencord.shared.network.BaseTest;
|
||||
import de.muehlencord.shared.network.whois.Whois;
|
||||
import de.muehlencord.shared.network.whois.WhoisInformation;
|
||||
import de.muehlencord.shared.network.whois.WhoisException;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -66,6 +61,7 @@ public class WhoisTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testUnkown() throws WhoisException {
|
||||
Whois whoIsClient = new Whois();
|
||||
// whoIsClient.execute("whois.arin.net", "174.139.180.10");
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
log4j.rootLogger=ALL, ConsoleLogger
|
||||
log4j.debug=false
|
||||
|
||||
# ConsoleAppender
|
||||
log4j.appender.ConsoleLogger=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.ConsoleLogger.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.ConsoleLogger.layout.ConversionPattern= %d - %m (%c)%n
|
||||
log4j.appender.ConsoleLogger.threshold=DEBUG
|
||||
Reference in New Issue
Block a user