added more unit tests
This commit is contained in:
@ -4,8 +4,8 @@
|
||||
*/
|
||||
package de.muehlencord.shared.network;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -17,7 +17,22 @@ public class CidrToolTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testCidrConversion() {
|
||||
System.out.println (CidrTool.rangeToCidrList("213.55.64.0", "213.55.127.255"));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddressSplit() {
|
||||
// split 213.0.0.0/8 --> belongs to Ripe
|
||||
// but 213.55.64.0 - 213.55.127.255 was transferred to Afrinic
|
||||
System.out.println ("First part of Ripe");
|
||||
System.out.println (CidrTool.rangeToCidrList("213.0.0.1", "213.55.63.255"));
|
||||
|
||||
System.out.println ("Transferred part of Afrinic");
|
||||
System.out.println (CidrTool.rangeToCidrList("213.55.64.0", "213.55.127.255"));
|
||||
|
||||
System.out.println ("Second part of Ripe");
|
||||
System.out.println (CidrTool.rangeToCidrList("213.55.128.0", "213.255.255.255"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,10 +35,12 @@ public class WhoisTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
@Ignore // FIXME special parser for Arin needed
|
||||
// TODO 184.173.67.10 whois with referal
|
||||
public void testArin() throws UnknownHostException, SocketException, IOException, ParseException {
|
||||
Whois whoIsClient = new Whois();
|
||||
whoIsClient.execute ("whois.arin.net", "204.232.209.184");
|
||||
assertNotNull (whoIsClient.getNetworkInformation());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -49,6 +51,7 @@ public class WhoisTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testUnkown() throws UnknownHostException, SocketException, IOException, ParseException {
|
||||
Whois whoIsClient = new Whois();
|
||||
// whoIsClient.execute("whois.arin.net", "174.139.180.10");
|
||||
@ -58,21 +61,9 @@ public class WhoisTest extends BaseTest {
|
||||
// whoIsClient.execute("whois.apnic.net", "182.72.111.26");
|
||||
// whoIsClient.execute("whois.ripe.net", "213.55.95.62"); // Transferred to Afrinic
|
||||
whoIsClient.execute("whois.afrinic.net", "213.55.95.62");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testStepWise() throws UnknownHostException, SocketException, IOException, ParseException {
|
||||
|
||||
Reference in New Issue
Block a user