use of org.whole.lang.xsd.mapping.samples.SimpleContentInstance in project whole by wholeplatform.
the class XsdMappingTest method testSimpleContent.
// Requires an Internet connection
// FIXME remove KnownFailingTests
@Category({ SlowTests.class, KnownFailingTests.class })
@Test
public void testSimpleContent() throws Exception {
InputStream is = loader.getResourceAsStream("simpleContent.xsd");
StreamSource ss = new StreamSource(is);
Schema schema = factory.newSchema(ss);
is = loader.getResourceAsStream("simpleContent.xml");
Validator v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("simpleContent.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 SimpleContentInstance().create(), model));
}
Aggregations