4

I would like to set up an infrastructure for integration testing. Currently we bootstrap tomcat using maven and then execute httpunit tests. But the current solution has few drawbacks.

  1. Any changes committed to the database need to be rollback manually in the end if the test
  2. Running code coverage on integration test is not straight forward (we are using sonar).

My goals are:

  1. Allow automatic rollback between tests (hopefully using String @transaction and @rollback)
  2. Simple straight forward code coverage
  3. Using @RunWith that will bootstrap the system from JUnit and not externally
  4. Interacting with live servlets and javascript (I consider switching from httpuinit to selenium…)
  5. Reasonable execution time (at least not longer than the existing execution time)

The goals above look reasonable to me and common to many Java/J2ee projects. I was thinking to achieve those goals by using Arquillian and Arquillian Spring Framework Extension component. See also https://github.com/arquillian/arquillian-showcase/

  1. Does anyone have and experience with Arquillian and with Arquillian Spring Framework Extension?
  2. Can you share issues best practices and lesson learned?
  3. Can anyone suggest an alternative approach to the above?
Haim Raman
  • 11,508
  • 6
  • 44
  • 70

1 Answers1

0

I can't fully answer your question. only some tips

  1. Regarding the automatic rollback. In my case. Using liquibase to init the test data on "hsqldb" or "h2" which could be set as in-memory pattern. Then no need to roll back.

  2. For Arquillian. It's a good real testing approach. What i learned is that "Arauillian Spring Framework Extension" is just a extension. You have to bind to a specific container like "jboss, glasshfish,tomcat" to make the test run. But i don't know how to apply for a spring-based javaSE program which do not need application server support.

My lesson learned is the jboss port conflict. since jboss-dist is set 8080 as default http port. But our company proxy is same as 8080. So i can't use maven to get the jboss-dist artifact.

Hope others can give more info.

jiming
  • 101
  • 8
  • You should be able to reserve an open port through build-helper-maven-plugin:reserve-network-port. Take a look at http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/maven-plugin/examples/it-random-port.html – dardo Jan 13 '16 at 22:42