added more unit tests

This commit is contained in:
jomu
2013-03-25 23:08:34 +00:00
parent 4a894d95d8
commit bd2d7380e4
2 changed files with 21 additions and 15 deletions

View File

@ -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"));
}
}

View File

@ -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 {