Some time ago I came to the point where I need to do integration tests for my JEE applications at work. In JEE6 I tried several testing frameworks two years ago, but none of them works very well, so we decided to skip this point and continue with end users tests and JUnit testing. But I never gave up the search for an testing framework for JEE6.
I was looking for a simple solution to test @WebFilter servlet filters. The tests that I had used a lot of mocks, but really just left me unsatisfied. It was not a real world production solution. How would they "really" behave in the actual server environment. I had been using Arquillian to do some testing of our CDI layer, and decided to try it on filters.
Arquillian and ShrinkWrap are undoubtedly great tools for tests automation. However one of the most difficult parts is usually deployment description.
Kevin Cruickshanks (@kevincruick) er en kompis fra studietiden ved Universitetet i Bergen. Det er ikke så ofte vi ser hverandre lengre, men fra tid til annen stiller han opp på NNUG-møter, og da er det alltid hyggelig.
Arquillian er en spennende plattform for automatiserte integrasjonstester for Java-utviklere. I denne tutorialen git Kevin deg en grundig innføring.
For years we have learned that we all should do this. Unit tests are good, unit tests need mocks. Therefor we unit test, and therefor we mock. Life was simple.
Lately however a growing group of people seem out to disturb our perfect little world. Their creed: “Mocks are wrong. We should use real objects”. They don’t seem to have a name yet, but following the NoSQL movement, let’s call them the NoMock movement.
Arquillian is a testing framework which lets you write real integration tests, run inside the container of your choice. With Arquillian you will be writing micro-deployments for your tests, small Java artifacts that is, which contains the bare minimum of classes and resoruces needed for your test to be executed within your container. To build these artifacts you will be using the ShrinkWrap API.
In Java EE 6 Testing Part I I briefly introduced the EJB 3.1 Embeddable API using Glassfish embedded container to demonstrate how to start the container, lookup a bean in the project classpath and run a very simple integration test.
This post focus on Arquillian and ShrinkWrap and why they are awesome tools for integration testing of enterprise Java applications.
This post assumes that you're familiar with using Arquillian for testing Java applications. If you're not familiar with Arquillian, then I suggest you check out the guides at http://www.arquillian.org where you'll learn how to write Java tests that can run on the server and are much easier to write and maintain.
Documents first impressions and experiences with Arquillian, a story about how Arquillian found a critical bug in an app server and some suggestions for how to improve Arquillian.
In part 1 of this post, I described the possible approaches/frameworks for unit testing of web applications. In this post, I concentrate on one framework, which is JBoss Arquillian. The contents of this post will be:
What about JBoss Arquillian?
Use Arquillian to Unit Test inside EClipse and JBoss 6
Secrets behind Scene: How Arquillian handles the Test?
The animated slides used in the Arquillian presentation given by Aslak Knutsen and Dan Allen at JUDCon 2011. These slides include two screencasts that demonstrate how to run the tests in an IDE.
Video from the Arquillian talk presented by Dan Allen and Aslak Knutsen at JUDCon 2011.
An in-depth article about Arquillian, a container-oriented testing framework that enables you to write portable integration tests for enterprise Java applications and beyond. You'll discover how Arquillian's test enrichment, packaging and deployment, in conjunction with container lifecycle management, let you skip the build and test in-container, all without having to leave the comfort of your IDE (or the commandline, if it suits you). With Arquillian in hand, integration testing becomes fun and productive again.
This is the last blog post in the three-part series on unit testing services managed by the most popular types of containers in the Java world.
The Arquillian library from JBoss solves this problem by providing the opportunity to programmatically create and deploy archives on any kind of embedded server (JBoss, Glassfish, Jetty). In the same time you can declare the dependency of your test to the server-managed objects and you don’t have to look them up any more in the JNDI context.
An intriguing proposal by Andy Gibson about introducing a profile-oriented abstraction layer over ShrinkWrap. The purpose of the abstract layer is to simplify archive creation and customize the archive for different target containers. Includes prototype code.
Click in to find related links.