use of org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptor in project tomee by apache.
the class ServletEnvEntryInjectionTest method createDeployment.
@Deployment(testable = false)
public static WebArchive createDeployment() {
final WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0).createServlet().servletName("servlet").servletClass(PojoServlet.class.getName()).up().createServletMapping().servletName("servlet").urlPattern("/" + TEST_NAME).up();
addEnvEntry(descriptor, "returnEmail", "java.lang.String", "tomee@apache.org");
addEnvEntry(descriptor, "connectionPool", "java.lang.Integer", "20");
addEnvEntry(descriptor, "startCount", "java.lang.Long", "200000");
addEnvEntry(descriptor, "initSize", "java.lang.Short", "5");
addEnvEntry(descriptor, "enableEmail", "java.lang.Boolean", "true");
addEnvEntry(descriptor, "totalQuantity", "java.lang.Byte", "5");
addEnvEntry(descriptor, "optionDefault", "java.lang.Character", "X");
addEnvEntry(descriptor, "auditWriter", "java.lang.Class", "java.lang.String");
addEnvEntry(descriptor, "defaultCode", Code.class.getName(), "OK");
final Node appNode = ((NodeDescriptor) descriptor).getRootNode();
appNode.createChild("/env-entry").createChild("env-entry-name").text("name").getParent().createChild("lookup-name").text("java:module/ModuleName");
WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(PojoServlet.class).addClass(Code.class).setWebXML(new StringAsset(descriptor.exportAsString()));
return archive;
}
use of org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptor in project tomee by apache.
the class ServletListenerEjbLocalInjectionTest method addEnvEntry.
private static void addEnvEntry(WebAppDescriptor descriptor, String name, String type, String value) {
Node appNode = ((NodeDescriptor) descriptor).getRootNode();
appNode.createChild("/env-entry").createChild("env-entry-name").text(name).getParent().createChild("env-entry-type").text(type).getParent().createChild("env-entry-value").text(value);
}
Aggregations