Configuration { public static Configuration fromString(String xmlContent) throws JAXBException { return ConfigTemplateHelper.unmarshallFromXMLString(xmlContent); }  List<Property> getProperties(); Property getProperty(String name); boolean hasProperty(String name); static Configuration fromStream(InputStream inputStream); static Configuration fromResource(String resourceName); static Configuration fromString(String xmlContent); int size();  }
@Test public void testFromString() throws JAXBException { String xmlContext = "<configuration>\n" + " <property>\n" + " <name>testkey1</name>\n" + " <value>testvalue1</value>\n" + " <description>testdesc1</description>\n" + " </property>\n" + " <property>\n" + " <name>testkey2</name>\n" + " <value>testvalue2</value>\n" + " <description>testdesc2</description>\n" + " </property>\n" + " <property>\n" + " <name>testkey3</name>\n" + " <value>testvalue3</value>\n" + " <description>testdesc3</description>\n" + " </property>\n" + "</configuration>"; Configuration configuration = Configuration.fromString(xmlContext); Assert.assertEquals("testvalue1", configuration.getProperty("testkey1").getValue()); Assert.assertEquals(3, configuration.size()); }