public void testStartingWithNullProperties() throws Exception { try { PropertiesUtil.getPropertiesStartingWith("blahblah", null); fail("Expected: NullPointerException"); } catch (NullPointerException e) { } }
public void testStartingWithExists() throws Exception { Properties p = PropertiesUtil.getPropertiesStartingWith("testprop", props); assertEquals(2, p.size()); assertEquals("myname", p.get("testprop.name")); assertEquals("myaddress", p.get("testprop.address")); }
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")); }
public void testStartingWithNotExists() throws Exception { Properties p = PropertiesUtil.getPropertiesStartingWith("nothing", props); assertEquals(0, p.size()); }