forked from I2P_Developers/i2p.i2p
Added some tests of setOptions to RouterAddressTest
This commit is contained in:
@@ -33,7 +33,34 @@ public class RouterAddressTest extends StructureTest {
|
||||
return addr;
|
||||
}
|
||||
public DataStructure createStructureToRead() { return new RouterAddress(); }
|
||||
|
||||
|
||||
public void testSetNullOptions(){
|
||||
RouterAddress addr = new RouterAddress();
|
||||
boolean error = false;
|
||||
try{
|
||||
addr.setOptions(null);
|
||||
}catch(NullPointerException dfe){
|
||||
error = true;
|
||||
}
|
||||
assertTrue(error);
|
||||
}
|
||||
|
||||
public void testSetOptionsAgain(){
|
||||
RouterAddress addr = new RouterAddress();
|
||||
Properties options = new Properties();
|
||||
options.setProperty("hostname", "localhost");
|
||||
options.setProperty("portnum", "1234");
|
||||
addr.setOptions(options);
|
||||
options.setProperty("portnum", "2345");
|
||||
boolean error = false;
|
||||
try{
|
||||
addr.setOptions(options);
|
||||
}catch(IllegalStateException dfe){
|
||||
error = true;
|
||||
}
|
||||
assertTrue(error);
|
||||
}
|
||||
|
||||
public void testBadWrite() throws Exception{
|
||||
RouterAddress addr = new RouterAddress();
|
||||
boolean error = false;
|
||||
@@ -44,7 +71,7 @@ public class RouterAddressTest extends StructureTest {
|
||||
}
|
||||
assertTrue(error);
|
||||
}
|
||||
|
||||
|
||||
public void testNullEquals(){
|
||||
RouterAddress addr = new RouterAddress();
|
||||
byte data[] = new byte[32];
|
||||
@@ -60,7 +87,7 @@ public class RouterAddressTest extends StructureTest {
|
||||
assertFalse(addr.equals(null));
|
||||
assertFalse(addr.equals(""));
|
||||
}
|
||||
|
||||
|
||||
public void testToString(){
|
||||
RouterAddress addr = new RouterAddress();
|
||||
byte data[] = new byte[32];
|
||||
|
Reference in New Issue
Block a user