use of com.peterphi.std.guice.common.serviceprops.composite.GuiceConfig in project stdlib by petergeneric.
the class JAXBResourceFactoryTest method testVariableReferencingLiteralDocument.
/**
* N.B. this test wouldn't work if the XML contained something that looked like a variable (because when you include variables
* their values get resolved)
*
* @throws Exception
*/
@Test
public void testVariableReferencingLiteralDocument() throws Exception {
MyType expected = new MyType("test", true);
GuiceConfig config = new GuiceConfig();
config.set("some.xml", "${some.xml.incl}");
config.set("some.xml.incl", "<MyType name=\"test\"/>");
JAXBResourceFactory factory = new JAXBResourceFactory(config, SERIALISER_FACTORY);
assertEquals(expected, factory.get(MyType.class, "some.xml"));
}
Aggregations