diff --git a/build.xml b/build.xml index 9407129a..b28e9fb3 100755 --- a/build.xml +++ b/build.xml @@ -4,12 +4,13 @@ + - + @@ -54,7 +55,7 @@ - + @@ -62,6 +63,11 @@ + + + + + @@ -84,12 +90,14 @@ + + - + @@ -98,7 +106,7 @@ - + @@ -107,14 +115,6 @@ - - @@ -130,10 +130,13 @@ - + + + + @@ -144,11 +147,23 @@ - - + + + + + + + + + + + + - + + diff --git a/ext/picocontainer/picocontainer-1.0.jar b/ext/picocontainer/picocontainer-1.0.jar index 701f44eb..4b452806 100755 Binary files a/ext/picocontainer/picocontainer-1.0.jar and b/ext/picocontainer/picocontainer-1.0.jar differ diff --git a/resources/Labels.txt b/resources/Labels.txt index 592d2cee..ee9c6a5d 100755 --- a/resources/Labels.txt +++ b/resources/Labels.txt @@ -105,6 +105,7 @@ opener.ftp=FTP opener.telnet=Telnet opener.ssh=SSH opener.netbios=Windows Shares +opener.email=E-mail sample feeder.range=IP Range feeder.range.startIP=IP Range: feeder.range.endIP=to diff --git a/test/net/azib/ipscan/config/NamedListConfigTest.java b/test/net/azib/ipscan/config/NamedListConfigTest.java index 6c4db5cd..ab7405ab 100755 --- a/test/net/azib/ipscan/config/NamedListConfigTest.java +++ b/test/net/azib/ipscan/config/NamedListConfigTest.java @@ -21,6 +21,7 @@ public class NamedListConfigTest extends TestCase { protected void setUp() throws Exception { preferences = Preferences.userRoot().node("ipscan-test"); + preferences.clear(); config = new NamedListConfig(preferences, PREFERENCE_NAME); } diff --git a/test/net/azib/ipscan/config/OpenersConfigTest.java b/test/net/azib/ipscan/config/OpenersConfigTest.java index 0ea282d5..cbe8948d 100755 --- a/test/net/azib/ipscan/config/OpenersConfigTest.java +++ b/test/net/azib/ipscan/config/OpenersConfigTest.java @@ -22,6 +22,7 @@ public class OpenersConfigTest extends TestCase { protected void setUp() throws Exception { preferences = Preferences.userRoot().node("ipscan-test"); + preferences.clear(); config = new OpenersConfig(preferences); } diff --git a/test/net/azib/ipscan/core/InetAddressUtilsTest.java b/test/net/azib/ipscan/core/InetAddressUtilsTest.java index 47cffcf3..6043b413 100755 --- a/test/net/azib/ipscan/core/InetAddressUtilsTest.java +++ b/test/net/azib/ipscan/core/InetAddressUtilsTest.java @@ -1,7 +1,9 @@ package net.azib.ipscan.core; import java.net.InetAddress; +import java.net.NetworkInterface; import java.net.UnknownHostException; +import java.util.Enumeration; import junit.framework.TestCase; @@ -75,11 +77,15 @@ public class InetAddressUtilsTest extends TestCase { assertFalse(InetAddressUtils.isLikelyBroadcast(InetAddress.getByName("127.4.5.6"))); } - public void testGetAddressByName() throws UnknownHostException { - // this test depends on the network configuraton of the system - // it may fail if operating system is Linux and there are no network interfaces configured, except "lo" (loopback) - assertFalse(InetAddress.getByName(InetAddressUtils.getAddressByName(InetAddress.getLocalHost().getHostName())).isLoopbackAddress()); - assertFalse(InetAddress.getByName(InetAddressUtils.getAddressByName("localhost")).isLoopbackAddress()); + public void testGetAddressByName() throws Exception { + Enumeration ifaces = NetworkInterface.getNetworkInterfaces(); + ifaces.nextElement(); + if (ifaces.hasMoreElements()) { + // this test depends on the network configuraton of the system + // so we run it only if there are more than 1 network interface in the system (which is a loopback interface) + assertFalse(InetAddress.getByName(InetAddressUtils.getAddressByName(InetAddress.getLocalHost().getHostName())).isLoopbackAddress()); + assertFalse(InetAddress.getByName(InetAddressUtils.getAddressByName("localhost")).isLoopbackAddress()); + } } } diff --git a/test/net/azib/ipscan/exporters/AbstractExporterTestCase.java b/test/net/azib/ipscan/exporters/AbstractExporterTestCase.java index e5f6f57a..fe3b6f9b 100755 --- a/test/net/azib/ipscan/exporters/AbstractExporterTestCase.java +++ b/test/net/azib/ipscan/exporters/AbstractExporterTestCase.java @@ -46,6 +46,10 @@ public abstract class AbstractExporterTestCase extends TestCase { } }; exporter2.start(mockOutputStream, "feederstuff"); + // output something to ensure that the flush will be called + exporter2.setFetchers(new String[] {Labels.getLabel("fetcher.ip"), Labels.getLabel("fetcher.ports")}); + exporter2.nextAdressResults(new Object[] {"1", "2"}); + // this should invoke flush among other things exporter2.end(); // close: no assertFalse(wasClosed[0]);