use of org.whole.lang.xsd.mapping.samples.QueueInstance in project whole by wholeplatform.
the class XsdMappingTest method testAppEngine.
@Category(SlowTests.class)
@Test
public void testAppEngine() throws Exception {
InputStream is = loader.getResourceAsStream("appengine-web.xsd");
StreamSource ss = new StreamSource(is);
Schema schema = factory.newSchema(ss);
is = loader.getResourceAsStream("appengine-web.xml");
Validator v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("appengine-web.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 AppEngineWebInstance().create(), model));
is = loader.getResourceAsStream("cron.xsd");
ss = new StreamSource(is);
schema = factory.newSchema(ss);
is = loader.getResourceAsStream("cron.xml");
v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("cron.xml");
pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new CronInstance(model.wGetLanguageKit()).create(), model));
is = loader.getResourceAsStream("queue.xsd");
ss = new StreamSource(is);
schema = factory.newSchema(ss);
is = loader.getResourceAsStream("queue.xml");
v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("queue.xml");
pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new QueueInstance(model.wGetLanguageKit()).create(), model));
is = loader.getResourceAsStream("datastore-indexes.xsd");
ss = new StreamSource(is);
schema = factory.newSchema(ss);
is = loader.getResourceAsStream("datastore-indexes.xml");
v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("datastore-indexes.xml");
pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new DatastoreIndexesInstance(model.wGetLanguageKit()).create(), model));
is = loader.getResourceAsStream("dos.xsd");
ss = new StreamSource(is);
schema = factory.newSchema(ss);
is = loader.getResourceAsStream("dos.xml");
v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("dos.xml");
pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new DosInstance(model.wGetLanguageKit()).create(), model));
is = loader.getResourceAsStream("jdoconfig_2_3.xsd");
ss = new StreamSource(is);
schema = factory.newSchema(ss);
is = loader.getResourceAsStream("jdoconfig.xml");
v = schema.newValidator();
v.validate(new StreamSource(is));
is = loader.getResourceAsStream("jdoconfig.xml");
pp = new StreamPersistenceProvider(is);
pp.getBindings().wDefValue("packageName", "org.whole.lang.xsd.mapping.samples");
model = XsiPersistenceKit.instance().readModel(pp);
Assert.assertTrue(Matcher.match(new JDOConfigInstance().create(), model));
}
Aggregations