use of org.whole.lang.xsd.mapping.samples.Maven400Instance in project whole by wholeplatform.
the class XsdMappingTest method testMaven.
@Category(SlowTests.class)
@Test
public void testMaven() throws Exception {
InputStream is = loader.getResourceAsStream("maven-v4_0_0.xsd");
StreamSource ss = new StreamSource(is);
Schema schema = factory.newSchema(ss);
is = loader.getResourceAsStream("maven-v4_0_0.xml");
Validator v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("maven-v4_0_0.xml");
IPersistenceProvider pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
IEntity model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new Maven400Instance().create(), model));
}
Aggregations