Author: j16sdiz
Date: 2009-02-20 09:29:05 +0000 (Fri, 20 Feb 2009)
New Revision: 25744
Modified:
trunk/freenet/test/freenet/io/Inet4AddressMatcherTest.java
Log:
unnecessary cast as reported by eclipse
Modified: trunk/freenet/test/freenet/io/Inet4AddressMatcherTest.java
===================================================================
--- trunk/freenet/test/freenet/io/Inet4AddressMatcherTest.java 2009-02-20
09:28:32 UTC (rev 25743)
+++ trunk/freenet/test/freenet/io/Inet4AddressMatcherTest.java 2009-02-20
09:29:05 UTC (rev 25744)
@@ -16,11 +16,8 @@
package freenet.io;
-import java.net.Inet4Address;
import java.net.InetAddress;
-import freenet.io.Inet4AddressMatcher;
-
import junit.framework.TestCase;
/**
@@ -31,44 +28,44 @@
public void test() throws Exception {
Inet4AddressMatcher matcher = new
Inet4AddressMatcher("192.168.1.2");
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.2")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("0.0.0.0")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("192.168.1.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.1.2")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("127.0.0.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("0.0.0.0")));
matcher = new Inet4AddressMatcher("192.168.1.2/8");
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.2")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.2.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.16.81.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.255.255.255")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("172.16.1.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("0.0.0.0")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.0.0.0")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.1.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.1.2")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.2.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.16.81.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.255.255.255")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("172.16.1.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("127.0.0.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("0.0.0.0")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.0.0.0")));
/* some fancy matching */
matcher = new Inet4AddressMatcher("192.168.1.1/255.0.255.0");
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.16.1.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.2.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("192.16.2.1")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.1.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.16.1.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("192.168.2.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("192.16.2.1")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("127.0.0.1")));
matcher = new Inet4AddressMatcher("127.0.0.1/8");
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("127.23.42.64")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.0")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("127.255.255.255")));
- assertEquals(false, matcher.matches((Inet4Address)
InetAddress.getByName("28.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("127.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("127.23.42.64")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("127.0.0.0")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("127.255.255.255")));
+ assertEquals(false,
matcher.matches(InetAddress.getByName("28.0.0.1")));
matcher = new Inet4AddressMatcher("0.0.0.0/0");
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("127.0.0.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.1.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("192.168.2.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("172.16.42.23")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("10.0.0.1")));
- assertEquals(true, matcher.matches((Inet4Address)
InetAddress.getByName("224.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("127.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.1.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("192.168.2.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("172.16.42.23")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("10.0.0.1")));
+ assertEquals(true,
matcher.matches(InetAddress.getByName("224.0.0.1")));
}
}
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs