Changeset e7922c4


Ignore:
Timestamp:
Feb 26, 2012 4:57:31 AM (8 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
22900a0
Parents:
f19ef3e4
Message:

Added some tests of setOptions to RouterAddressTest?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/test/net/i2p/data/RouterAddressTest.java

    rf19ef3e4 re7922c4  
    3434    }
    3535    public DataStructure createStructureToRead() { return new RouterAddress(); }
    36    
     36
     37    public void testSetNullOptions(){
     38        RouterAddress addr = new RouterAddress();
     39        boolean error = false;
     40        try{
     41            addr.setOptions(null);
     42        }catch(NullPointerException dfe){
     43            error = true;
     44        }
     45        assertTrue(error);
     46    }
     47
     48    public void testSetOptionsAgain(){
     49        RouterAddress addr = new RouterAddress();
     50        Properties options = new Properties();
     51        options.setProperty("hostname", "localhost");
     52        options.setProperty("portnum", "1234");
     53        addr.setOptions(options);
     54        options.setProperty("portnum", "2345");
     55        boolean error = false;
     56        try{
     57            addr.setOptions(options);
     58        }catch(IllegalStateException dfe){
     59            error = true;
     60        }
     61        assertTrue(error);
     62    }
     63
    3764    public void testBadWrite() throws Exception{
    3865        RouterAddress addr = new RouterAddress();
     
    4572        assertTrue(error);
    4673    }
    47    
     74
    4875    public void testNullEquals(){
    4976        RouterAddress addr = new RouterAddress();
     
    6188        assertFalse(addr.equals(""));
    6289    }
    63    
     90
    6491    public void testToString(){
    6592        RouterAddress addr = new RouterAddress();
Note: See TracChangeset for help on using the changeset viewer.