Disagree
Agree
WebSocket Polling

connect now http://onslyde.com/go/

Greetings, Earthlings!

Testing the Enterprise layers

The A, B, C’s of integration testing

@aslakknutsen

Do you test?

What type of test?

  • Unit?
  • Integration?
  • Functional?

The basics

Test middleware

Modular, Extensible, Flexible

1 Select a container
<profile>
  <id>arq-jbossas-remote-7</id>
  <dependencies>
    <dependency>
      <groupId>org.jboss.as</groupId>
      <artifactId>jboss-as-arquillian-container-remote</artifactId>
      <version>${version.jbossas}</version>
    </dependency>
  </dependencies>
</profile>
2 Start or connect to a container
3 Package test archive and deploy to container

ShrinkWrap

Deployment + Resolver + Descriptors

For more information about ShrinkWrap and its subprojects have a look at these GitHub repository: 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()
3 Package test archive and deploy to container
4 Run test in-container
5 Capture and report test results
6 Undeploy test archive and stop or disconnect from the container

Split layers

Domain / REST / UI

Test doubles

Repository<T>

Reusable test api

Integration and functonal in one?

Modular tests suite

@ContinuousDev

http://continuousdev.org