コード例 #1
0
 public void testStripStartNullProperties() throws Exception {
   try {
     PropertiesUtil.stripStart("blahblah", null);
     fail("Expected: NullPointerException");
   } catch (NullPointerException e) {
   }
 }
コード例 #2
0
  public void testStripStartExists() throws Exception {

    Properties p1 = PropertiesUtil.getPropertiesStartingWith("testprop", props);
    Properties p2 = PropertiesUtil.stripStart("testprop", p1);

    assertEquals(2, p2.size());
    assertEquals("myname", p2.get("name"));
    assertEquals("myaddress", p2.get("address"));
  }
コード例 #3
0
  public void testStripStartNotExists() throws Exception {

    Properties p = PropertiesUtil.stripStart("nothing", props);

    assertEquals(0, p.size());
  }