use of org.apache.openejb.config.sys.Openejb in project tomee by apache.
the class JSonConfigTest method simpleRead.
@Test
public void simpleRead() throws IOException, OpenEJBException {
final Openejb openejb = JSonConfigReader.read(Openejb.class, Thread.currentThread().getContextClassLoader().getResource(config()).openStream());
assertEquals(1, openejb.getResource().size());
final Resource resource = openejb.getResource().iterator().next();
assertEquals("json-datasource", resource.getId());
assertTrue("123".equals(resource.getProperties().getProperty("MaxTotal")));
assertTrue("jdbc:hsqldb:mem:json".equals(resource.getProperties().getProperty("JdbcUrl")));
assertEquals(1, openejb.getDeployments().size());
assertEquals("apps", openejb.getDeployments().iterator().next().getDir());
assertEquals(1, openejb.getContainer().size());
final Container container = openejb.getContainer().iterator().next();
assertEquals("STATELESS", container.getType());
assertEquals("10 seconds", container.getProperties().getProperty("AccessTimeout"));
}
use of org.apache.openejb.config.sys.Openejb in project tomee by apache.
the class AliasesFromXmlTest method ensureAliasesAreParsed.
@Test
public void ensureAliasesAreParsed() throws IOException, SAXException, ParserConfigurationException {
final String xml = "<?xml version=\"1.0\"?>" + "<openejb>" + " <Resource id=\"foo\" aliases=\"bar\" type=\"DataSource\" />" + "</openejb>";
final Openejb openejb = JaxbOpenejb.readConfig(new InputSource(new ByteArrayInputStream(xml.getBytes())));
assertEquals(1, openejb.getResource().size());
final Resource resource = openejb.getResource().iterator().next();
assertEquals(1, resource.getAliases().size());
assertEquals("foo", resource.getId());
assertEquals("bar", resource.getAliases().iterator().next());
}
Aggregations