310 likes | 634 Views
Integration Testing for Java EE Applications on Oracle WebLogic Server 12c Done Right. Reza Rahman Java EE, GlassFish, WebLogic Evangelist at Oracle Aslak Knutsen Arquillian Project Lead, Senior Software Engineer at Red Hat. DEVELOPER PRODUCTIVITY. MEETING ENTERPRISE DEMANDS. Java EE 7.
E N D
Integration Testing for Java EE Applications on Oracle WebLogic Server 12c Done Right Reza Rahman Java EE, GlassFish, WebLogic Evangelist at Oracle Aslak Knutsen Arquillian Project Lead, Senior Software Engineer at Red Hat
DEVELOPER PRODUCTIVITY MEETING ENTERPRISE DEMANDS Java EE 7 Java EE 7 Java Enterprise Platform • Batch • Concurrency • Simplified JMS • More annotated POJOs • Less boilerplate code • Cohesive integrated platform • WebSockets • JSON • Servlet 3.1 NIO • REST 3
Java EE 7 APIs JAX-RS 2* JSP EL 3* JSF 2.2* +JSON-P +WebSocket Servlet 3.1* +Concurrency Interceptors 1.2* Bean Validation 1.1* CDI 1.1* +Batch JTA 1.2* EJB 3.2* JMS 2* JavaMail JPA 2.1* JCA 4
Java EE 7 APIs in WebLogic 12.1.3 JAX-RS 2* JSP EL 3* JSF 2.2* +JSON-P +WebSocket Servlet 3.1* +Concurrency Interceptors 1.2* Bean Validation 1.1* CDI 1.1* +Batch JTA 1.2* EJB 3.2* JMS 2* JavaMail JPA 2.1* JCA 5
Java EE 7 APIs in WebLogic 12.1.3 JAX-RS 2* JSP EL 3* JSF 2.2* +JSON-P +WebSocket Servlet 3.1* +Concurrency Interceptors 1.2* Bean Validation 1.1* CDI 1.1* +Batch JTA 1.2* EJB 3.2* JMS 2* JavaMail JPA 2.1* JCA Enabled by Default 6
Java EE 7 APIs in WebLogic 12.1.3 JAX-RS 2* JSP EL 3* JSF 2.2* +JSON-P +WebSocket Servlet 3.1* +Concurrency Interceptors 1.2* Bean Validation 1.1* CDI 1.1* +Batch JTA 1.2* EJB 3.2* JMS 2* JavaMail PRE_CLASSPATHAdjustment/Patch JPA 2.1* JCA Enabled by Default 7
Java EE 7 APIs in WebLogic 12.1.3 Deployed as Shared Library JAX-RS 2* JSP EL 3* JSF 2.2* +JSON-P +WebSocket Servlet 3.1* +Concurrency Interceptors 1.2* Bean Validation 1.1* CDI 1.1* +Batch JTA 1.2* EJB 3.2* JMS 2* JavaMail PRE_CLASSPATHAdjustment/Patch JPA 2.1* JCA Enabled by Default 8
WebLogic 12.1.3 Maven Support Maven plug-in Installation, domain configuration, start/stop, configure resources, deploy/un-deploy Maven artifacts Installed in a local repository Automatic synchronization Maven archetypes Development productivity
Arquillian so you can rule the code, not the bugs!
Flexible Flexible
Setup Maven, Gradle, Ant(+ivy)
<dependencyManagement> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>1.1.5.Final</version> <scope>import</scope> <type>pom</type> </dependency> </dependencyManagement>
<dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency>
<profile> <id>arq-weblogic</id> <dependencies> <dependency> <groupId>org.jboss.arquillian.container</groupId> <artifactId>arquillian-wls-remote-12.1</artifactId> <version>${version.weblogic}</version> </dependency> </dependencies> </profile>
ShrinkWrap Deployment + Resolver + Descriptors
ShrinkWrap.create(JavaArchive.class) .addClasses(x) .addPackages(x.z) ShrinkWrap.create(WebArchive.class) .addAsLibraries(x) .addAsWebInfResource(x) .setWebXML(z) ShrinkWrap.create(EnterpriseArchive.class) .addAsModules(war, jar) .setApplicationXML(x)
Maven.resolver() .loadPomFromFile("pom.xml") .resolve("x:y", "x:y:1.0") .withTransitivity() .asFile()
Descriptors.create(WebAppDescriptor.class) .metadataComplete(true) .version("2.5") .createServlet() .servletName(EchoServlet.class.getSimpleName()) .servletClass(EchoServlet.class.getName()).up() .createServletMapping() .servletName(EchoServlet.class.getSimpleName()) .urlPattern(EchoServlet.URL_PATTERN).up() .exportAsString()
WebLogic/Java EE Integration Testing Demo https://github.com/m-reza-rahman/testing-weblogic
Learning More • Java EE 7 Tutorials • http://docs.oracle.com/javaee/7/tutorial/doc/home.htm • Java EE 7 and More on WebLogic 12.1.3 (The Aquarium) • https://blogs.oracle.com/theaquarium/entry/java_ee_7_support_comes • Arquillian • http://arquillian.org