forked from I2P_Developers/i2p.i2p
Added some tests of setOptions to RouterAddressTest
This commit is contained in:
@@ -34,6 +34,33 @@ public class RouterAddressTest extends StructureTest {
|
|||||||
}
|
}
|
||||||
public DataStructure createStructureToRead() { return new RouterAddress(); }
|
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{
|
public void testBadWrite() throws Exception{
|
||||||
RouterAddress addr = new RouterAddress();
|
RouterAddress addr = new RouterAddress();
|
||||||
boolean error = false;
|
boolean error = false;
|
||||||
|
Reference in New Issue
Block a user