updated to log4j2
This commit is contained in:
@ -31,9 +31,6 @@
|
|||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>2.16</version>
|
<version>2.16</version>
|
||||||
<configuration>
|
|
||||||
<skipTests>true</skipTests>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
@ -51,11 +48,13 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
<scope>provided</scope>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
|
<artifactId>log4j-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.muehlencord.shared</groupId>
|
<groupId>de.muehlencord.shared</groupId>
|
||||||
<artifactId>shared-util</artifactId>
|
<artifactId>shared-util</artifactId>
|
||||||
|
|||||||
@ -22,6 +22,17 @@ public class IpInformation {
|
|||||||
return portInformation;
|
return portInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<PortInformation> getOpenPorts() {
|
||||||
|
List<PortInformation> openPorts = new ArrayList<>();
|
||||||
|
|
||||||
|
for (PortInformation currentPort : getPortInformation()) {
|
||||||
|
if (currentPort.isOpen()) {
|
||||||
|
openPorts.add (currentPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return openPorts;
|
||||||
|
}
|
||||||
|
|
||||||
public void setPortInformation(List<PortInformation> portInformation) {
|
public void setPortInformation(List<PortInformation> portInformation) {
|
||||||
this.portInformation = portInformation;
|
this.portInformation = portInformation;
|
||||||
}
|
}
|
||||||
@ -30,4 +41,9 @@ public class IpInformation {
|
|||||||
return ipAddress;
|
return ipAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return getIpAddress()+": "+getPortInformation();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,8 @@ import de.muehlencord.shared.network.whois.NetworkInformation;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.commons.net.util.SubnetUtils;
|
import org.apache.commons.net.util.SubnetUtils;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -12,7 +13,7 @@ import org.apache.log4j.Logger;
|
|||||||
*/
|
*/
|
||||||
public class NetworkScanner {
|
public class NetworkScanner {
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(NetworkScanner.class);
|
private final static Logger LOGGER = LogManager.getLogger(NetworkScanner.class);
|
||||||
|
|
||||||
private String networkString;
|
private String networkString;
|
||||||
private NetworkInformation networkInformation = null; // TODO add scan for information
|
private NetworkInformation networkInformation = null; // TODO add scan for information
|
||||||
|
|||||||
@ -5,7 +5,8 @@ import java.net.Socket;
|
|||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -13,7 +14,7 @@ import org.apache.log4j.Logger;
|
|||||||
*/
|
*/
|
||||||
public final class PortScan {
|
public final class PortScan {
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(PortScan.class);
|
private final static Logger LOGGER = LogManager.getLogger(PortScan.class);
|
||||||
|
|
||||||
private PortScan() {
|
private PortScan() {
|
||||||
// hide constructor
|
// hide constructor
|
||||||
@ -30,7 +31,7 @@ public final class PortScan {
|
|||||||
socket.close();
|
socket.close();
|
||||||
return new PortInformation(port, true);
|
return new PortInformation(port, true);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
LOGGER.debug(ex.toString(), ex);
|
LOGGER.trace(ex.toString(), ex);
|
||||||
return new PortInformation(port, false);
|
return new PortInformation(port, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,8 @@ import java.util.concurrent.ExecutionException;
|
|||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -15,7 +16,7 @@ import org.apache.log4j.Logger;
|
|||||||
*/
|
*/
|
||||||
public class PortScanner {
|
public class PortScanner {
|
||||||
|
|
||||||
private final static Logger LOGGER = Logger.getLogger(PortScanner.class);
|
private final static Logger LOGGER = LogManager.getLogger(PortScanner.class);
|
||||||
|
|
||||||
private final int startPort;
|
private final int startPort;
|
||||||
private final int endPort;
|
private final int endPort;
|
||||||
@ -46,7 +47,7 @@ public class PortScanner {
|
|||||||
resultList.add(f.get());
|
resultList.add(f.get());
|
||||||
}
|
}
|
||||||
} catch (InterruptedException | ExecutionException ex) {
|
} catch (InterruptedException | ExecutionException ex) {
|
||||||
LOGGER.error(ex.toString(), ex);
|
LOGGER.trace(ex.toString(), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultList;
|
return resultList;
|
||||||
|
|||||||
@ -10,7 +10,8 @@ import java.io.IOException;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -21,7 +22,7 @@ public class FTPConnection {
|
|||||||
/** the default timeout in ms */
|
/** the default timeout in ms */
|
||||||
public static final int DEFAULTTIMEOUT = 30000;
|
public static final int DEFAULTTIMEOUT = 30000;
|
||||||
/** the logger object */
|
/** the logger object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(FTPConnection.class);
|
private final static Logger LOGGER = LogManager.getLogger(FTPConnection.class);
|
||||||
/** the username to connect with */
|
/** the username to connect with */
|
||||||
private String userName;
|
private String userName;
|
||||||
/** the password to connect with */
|
/** the password to connect with */
|
||||||
|
|||||||
@ -16,7 +16,8 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Communication endpoint for posting a messages
|
* Communication endpoint for posting a messages
|
||||||
@ -25,7 +26,7 @@ import org.apache.log4j.Logger;
|
|||||||
*/
|
*/
|
||||||
public class HttpLayer {
|
public class HttpLayer {
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(HttpLayer.class);
|
private static final Logger LOGGER = LogManager.getLogger(HttpLayer.class);
|
||||||
/** the url to post to */
|
/** the url to post to */
|
||||||
private final String destinationUrlString;
|
private final String destinationUrlString;
|
||||||
/** the encoding to use */
|
/** the encoding to use */
|
||||||
|
|||||||
@ -15,7 +15,8 @@ import javax.mail.internet.MimeMessage;
|
|||||||
import javax.mail.search.MessageIDTerm;
|
import javax.mail.search.MessageIDTerm;
|
||||||
import javax.mail.search.SearchTerm;
|
import javax.mail.search.SearchTerm;
|
||||||
import javax.mail.util.SharedByteArrayInputStream;
|
import javax.mail.util.SharedByteArrayInputStream;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MailReader to connect and work with IMAP mailboxes. Also works with exchange servers.
|
* MailReader to connect and work with IMAP mailboxes. Also works with exchange servers.
|
||||||
@ -25,7 +26,7 @@ import org.apache.log4j.Logger;
|
|||||||
public abstract class DefaultMailReader implements MailReader {
|
public abstract class DefaultMailReader implements MailReader {
|
||||||
|
|
||||||
/** the logging object */
|
/** the logging object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(DefaultMailReader.class);
|
private final static Logger LOGGER = LogManager.getLogger(DefaultMailReader.class);
|
||||||
/** the store to connect with */
|
/** the store to connect with */
|
||||||
private Store store = null;
|
private Store store = null;
|
||||||
/** the smtp host to work with */
|
/** the smtp host to work with */
|
||||||
|
|||||||
@ -17,7 +17,8 @@ import javax.mail.MessagingException;
|
|||||||
import javax.mail.Multipart;
|
import javax.mail.Multipart;
|
||||||
import javax.mail.internet.MimeMessage;
|
import javax.mail.internet.MimeMessage;
|
||||||
import javax.mail.internet.MimeMultipart;
|
import javax.mail.internet.MimeMultipart;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Util class to convert between javax.mail.Message and MailMessage objects
|
* Util class to convert between javax.mail.Message and MailMessage objects
|
||||||
@ -27,7 +28,7 @@ import org.apache.log4j.Logger;
|
|||||||
public abstract class MailMessageUtils {
|
public abstract class MailMessageUtils {
|
||||||
|
|
||||||
/** the logging object */
|
/** the logging object */
|
||||||
private static final Logger LOGGER = Logger.getLogger(MailMessageUtils.class.getName());
|
private static final Logger LOGGER = LogManager.getLogger(MailMessageUtils.class.getName());
|
||||||
|
|
||||||
/** content type of mutipart messages - e.g. multipart_alternative or _mixed */
|
/** content type of mutipart messages - e.g. multipart_alternative or _mixed */
|
||||||
private static final String CONTENTTYPE_MULTIPART = "multipart/";
|
private static final String CONTENTTYPE_MULTIPART = "multipart/";
|
||||||
|
|||||||
@ -5,7 +5,8 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -14,7 +15,7 @@ import org.apache.log4j.Logger;
|
|||||||
public abstract class MailReaderConfigurationFactory {
|
public abstract class MailReaderConfigurationFactory {
|
||||||
|
|
||||||
/** the logging object */
|
/** the logging object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(MailReaderConfigurationFactory.class);
|
private final static Logger LOGGER = LogManager.getLogger(MailReaderConfigurationFactory.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reads the config file and creates a configured mailreader configuration
|
* reads the config file and creates a configured mailreader configuration
|
||||||
|
|||||||
@ -4,7 +4,8 @@ import de.muehlencord.shared.network.mail.DefaultMailReader;
|
|||||||
import de.muehlencord.shared.network.mail.MailReaderConfiguration;
|
import de.muehlencord.shared.network.mail.MailReaderConfiguration;
|
||||||
import de.muehlencord.shared.network.mail.MailReaderConnectionException;
|
import de.muehlencord.shared.network.mail.MailReaderConnectionException;
|
||||||
import javax.mail.Session;
|
import javax.mail.Session;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of MaiLReader to connect to an IMAP server
|
* Implementation of MaiLReader to connect to an IMAP server
|
||||||
@ -14,7 +15,7 @@ import org.apache.log4j.Logger;
|
|||||||
public class ImapMailReader extends DefaultMailReader {
|
public class ImapMailReader extends DefaultMailReader {
|
||||||
|
|
||||||
/** the logger object */
|
/** the logger object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(ImapMailReader.class);
|
private final static Logger LOGGER = LogManager.getLogger(ImapMailReader.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* creates a new instance to connect to an IMAP (or MS Exchange) server
|
* creates a new instance to connect to an IMAP (or MS Exchange) server
|
||||||
|
|||||||
@ -4,7 +4,8 @@ import static de.muehlencord.shared.network.CidrTool.rangeToCidrList;
|
|||||||
import static de.muehlencord.shared.util.StringUtil.getValueBetweenKeywords;
|
import static de.muehlencord.shared.util.StringUtil.getValueBetweenKeywords;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +15,7 @@ import org.apache.log4j.Logger;
|
|||||||
public class ArinWhoisParser extends AbstractWhoisParser implements WhoisParser {
|
public class ArinWhoisParser extends AbstractWhoisParser implements WhoisParser {
|
||||||
|
|
||||||
/** logger object */
|
/** logger object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(DefaultWhoisParser.class);
|
private final static Logger LOGGER = LogManager.getLogger(DefaultWhoisParser.class);
|
||||||
/** information to be returned */
|
/** information to be returned */
|
||||||
private WhoisInformation whoisInformation;
|
private WhoisInformation whoisInformation;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,8 @@ package de.muehlencord.shared.network.whois;
|
|||||||
|
|
||||||
import static de.muehlencord.shared.network.CidrTool.rangeToCidrList;
|
import static de.muehlencord.shared.network.CidrTool.rangeToCidrList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -11,7 +12,7 @@ import org.apache.log4j.Logger;
|
|||||||
public class DefaultWhoisParser extends AbstractWhoisParser implements WhoisParser {
|
public class DefaultWhoisParser extends AbstractWhoisParser implements WhoisParser {
|
||||||
|
|
||||||
/** logger object */
|
/** logger object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(DefaultWhoisParser.class);
|
private final static Logger LOGGER = LogManager.getLogger(DefaultWhoisParser.class);
|
||||||
/** information to be returned */
|
/** information to be returned */
|
||||||
private WhoisInformation whoisInformation;
|
private WhoisInformation whoisInformation;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,8 @@ package de.muehlencord.shared.network.whois;
|
|||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import org.apache.commons.net.whois.WhoisClient;
|
import org.apache.commons.net.whois.WhoisClient;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -11,7 +12,7 @@ import org.apache.log4j.Logger;
|
|||||||
public class Whois {
|
public class Whois {
|
||||||
|
|
||||||
/** logger object */
|
/** logger object */
|
||||||
private final static Logger LOGGER = Logger.getLogger(Whois.class);
|
private final static Logger LOGGER = LogManager.getLogger(Whois.class);
|
||||||
/** whoisClient client from commons-net package to execute commands with */
|
/** whoisClient client from commons-net package to execute commands with */
|
||||||
WhoisClient whoisClient;
|
WhoisClient whoisClient;
|
||||||
/** the complete output */
|
/** the complete output */
|
||||||
|
|||||||
2
network/src/main/resources/buildInfo.properties
Normal file
2
network/src/main/resources/buildInfo.properties
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
build.version=${project.version}
|
||||||
|
build.timestamp=${timestamp}
|
||||||
14
network/src/main/resources/log4j2.xml
Normal file
14
network/src/main/resources/log4j2.xml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Configuration>
|
||||||
|
<Appenders>
|
||||||
|
<Console name="STDOUT" target="SYSTEM_OUT">
|
||||||
|
<PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
|
||||||
|
</Console>
|
||||||
|
</Appenders>
|
||||||
|
<Loggers>
|
||||||
|
<Logger name="org.apache.log4j.xml" level="info"/>
|
||||||
|
<Root level="debug">
|
||||||
|
<AppenderRef ref="STDOUT"/>
|
||||||
|
</Root>
|
||||||
|
</Loggers>
|
||||||
|
</Configuration>
|
||||||
@ -3,10 +3,6 @@ package de.muehlencord.shared.network;
|
|||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
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 {
|
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 {
|
public String readContentFromFile(String name) throws IOException {
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.net.InetAddress;
|
|||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import org.apache.commons.net.util.SubnetUtils;
|
import org.apache.commons.net.util.SubnetUtils;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -16,6 +17,7 @@ public class NetworkScannerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // takes very long
|
||||||
public void testScan() throws UnknownHostException {
|
public void testScan() throws UnknownHostException {
|
||||||
String ipAddress = InetAddress.getLocalHost().getHostAddress();
|
String ipAddress = InetAddress.getLocalHost().getHostAddress();
|
||||||
SubnetUtils utils = new SubnetUtils(ipAddress, "255.255.255.0");
|
SubnetUtils utils = new SubnetUtils(ipAddress, "255.255.255.0");
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package de.muehlencord.shared.network;
|
package de.muehlencord.shared.network;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -13,6 +14,7 @@ public class PortScannerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // takes very long
|
||||||
public void testMain() {
|
public void testMain() {
|
||||||
PortScanner portScanner = new PortScanner();
|
PortScanner portScanner = new PortScanner();
|
||||||
List<PortInformation> resultList = portScanner.scan("127.0.0.1");
|
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.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
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.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -22,12 +24,13 @@ public class MailMessageUtilsTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // depends on environment
|
||||||
public void testGetInstance() throws Exception {
|
public void testGetInstance() throws Exception {
|
||||||
System.out.println("testGetInstance");
|
System.out.println("testGetInstance");
|
||||||
URL testConfigURL = MailMessageUtilsTest.class.getResource("/test.properties");
|
URL testConfigURL = MailMessageUtilsTest.class.getResource("/test.properties");
|
||||||
File file = new File(testConfigURL.toURI());
|
File file = new File(testConfigURL.toURI());
|
||||||
|
|
||||||
if ((file == null) || (!file.exists())) {
|
if (!file.exists()) {
|
||||||
return; // Skip test if config file is not available
|
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.MailReaderConnectionException;
|
||||||
import de.muehlencord.shared.network.mail.MailReaderException;
|
import de.muehlencord.shared.network.mail.MailReaderException;
|
||||||
import java.util.List;
|
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;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,6 +28,7 @@ public class ImapMailReaderTest extends BaseTest {
|
|||||||
* @throws Exception if the tests fails
|
* @throws Exception if the tests fails
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // depends on environment
|
||||||
public void testConnect() throws Exception {
|
public void testConnect() throws Exception {
|
||||||
System.out.println("connect");
|
System.out.println("connect");
|
||||||
String meta = "meta.muehlencord.intra";
|
String meta = "meta.muehlencord.intra";
|
||||||
@ -37,6 +40,7 @@ public class ImapMailReaderTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // depends on environment
|
||||||
public void testGetFolder() throws Exception {
|
public void testGetFolder() throws Exception {
|
||||||
System.out.println("getFolder");
|
System.out.println("getFolder");
|
||||||
String meta = "meta.muehlencord.intra";
|
String meta = "meta.muehlencord.intra";
|
||||||
@ -50,6 +54,7 @@ public class ImapMailReaderTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // depends on environment
|
||||||
public void testGetMessageCount() throws MailReaderConnectionException, MailReaderException {
|
public void testGetMessageCount() throws MailReaderConnectionException, MailReaderException {
|
||||||
System.out.println("testGetMessageCount");
|
System.out.println("testGetMessageCount");
|
||||||
String meta = "meta.muehlencord.intra";
|
String meta = "meta.muehlencord.intra";
|
||||||
@ -62,6 +67,7 @@ public class ImapMailReaderTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // depends on environment
|
||||||
public void testGetSubFolder() throws MailReaderConnectionException, MailReaderException {
|
public void testGetSubFolder() throws MailReaderConnectionException, MailReaderException {
|
||||||
System.out.println("getSubFolder");
|
System.out.println("getSubFolder");
|
||||||
String meta = "meta.muehlencord.intra";
|
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;
|
package de.muehlencord.shared.network.whois;
|
||||||
|
|
||||||
import de.muehlencord.shared.network.BaseTest;
|
import de.muehlencord.shared.network.BaseTest;
|
||||||
import de.muehlencord.shared.network.whois.Whois;
|
import static org.junit.Assert.assertEquals;
|
||||||
import de.muehlencord.shared.network.whois.WhoisInformation;
|
import static org.junit.Assert.assertNotNull;
|
||||||
import de.muehlencord.shared.network.whois.WhoisException;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -66,6 +61,7 @@ public class WhoisTest extends BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore
|
||||||
public void testUnkown() throws WhoisException {
|
public void testUnkown() throws WhoisException {
|
||||||
Whois whoIsClient = new Whois();
|
Whois whoIsClient = new Whois();
|
||||||
// whoIsClient.execute("whois.arin.net", "174.139.180.10");
|
// 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