Software testing with arquillian
Arquillian is an open source testing platform for the JVM that enables to easily create automated integration, functional and acceptance tests for Java middleware. In this article, Alex Soto presents three options to use Arquillian Cube to manager Docker containers from Arquillian.
This presentation pulls a variety of examples in testable development from the speaker book “Continuous Enterprise Development in Java” published by O’Reilly. It includes a review of the sections on RESTful services, UI verification, transactions and security.
Learn how to perform functional testing on JSF applications with Arquillian and Selenium. In modern development environments, it’s a must to include testing of Web applications as a standard part of the development lifecycle. Such tests can also be used as acceptance criteria in enterprise projects. Although full automation is possible, it is considered to be very expensive. As a result, in projects where testing is included as part of the project plan, it is also often the first requirement cut when the project schedule begins to slip.
Unit tests are programmer’s best friend, but relying on them exclusively gives an illusion of overall system integrity. At some level, we need to verify how our components integrate and ensure unexpected behavior does not creep in when we shift the application into the target runtime. It all amounts to whether your application is providing the end user what he or she is really needs (tire swing) instead of what anyone thinks they need. How can we save our users from frustration, keep the fail whale at bay and communicate with stakeholders that the requirements are being met?
Arquillian is a open source platform sponsored by JBoss that simplifies the testing of Java middleware. It brings your test to the runtime, freeing you from the concern of managing the runtime from your test and letting you focused on writing your integration test logic. This blog post by Nikolas Frankel explains how to to test Java EE components on JBoss 5.1 EAP with Arquilian and TestNG. His conclusion is that Arquillian seems to be a nice in-container testing framework but seems to have to be polished around some corners. The usage of TestNG may be the culprit here.
The testing strategy to adopt when you you run your code inside a Java EE container is the topic discussed in this blog post by Antonio Goncalves. To solve this issue, he presents a detailed step by step process to unit test an EJB with Mockito and how to do integration test with and without Arquillian with code samples. His conclusion is that since Java EE 6 it is now easy to use container and services in an embedded mode. Unit testing is good to test business code or code in isolation (mocking external components) but you have to remember that you should also use integration testing to test code interacting with external components or services.
This presentation addresses the missing link in Enterprise Java development: simple, easy integration testing. You will learn how the simplified component model of Java EE can be applied to testable development.