Help

Recently, we've been working hard on a solution to improve the testability of Java EE, and particularly JBoss AS. I'm pleased to say that a critical piece of puzzle, Arqullian, is now available. Congratulations to Aslak and the Arquillian team for releasing the first alpha of Arquillian! You can read more about Arquillian's mission, and our plans for Java EE testing below; alternatively, there are some quick links at the bottom if you want to dive right in.

The mission of the Arquillian project is to provide a simple test harness that developers can use to produce a broad range of integration tests for their Java applications (most likely enterprise applications). A test case may be executed within the container, deployed alongside the code under test, or by coordinating with the container, acting as a client to the deployed code. Arquillian defines two styles of container, remote and embedded. A remote container resides in a separate JVM from the test runner. Its lifecycle may be managed by Arquillian, or Arquillian may bind to a container that is already started. An embedded container resides in the same JVM and is mostly likely managed by Arquillian. Containers can be further classified by their capabilities. Examples include a fully compliant Java EE application server (e.g., GlassFish, JBoss AS, Embedded GlassFish), a Servlet container (e.g., Tomcat, Jetty) and a bean container (e.g., Weld SE). Arquillian ensures that the container used for testing is pluggable, so the developer is not locked into a proprietary testing environment. Arquillian seeks to minimize the burden on the developer to carry out integration testing by handling all aspects of test execution, including:
  • managing the lifecycle of the container (start/stop),
  • bundling the test class with dependent classes and resources into a deployable archive,
  • enhancing the test class (e.g., resolving @Inject, @EJB and @Resource injections),
  • deploying the archive to test (deploy/undeploy) and
  • capturing results and failures.
To avoid introducing unnecessary complexity into the developer's build environment, Arquillian integrates transparently with familiar testing frameworks (e.g., JUnit 4, TestNG 5), allowing tests to be launched using existing IDE, Ant and Maven test plugins without any add-ons.

The Arquillian Mission Statement

The first alpha release of Arquillian gives us support for JBoss AS (remote deployments), GlassFish (embedded deployments), Weld SE (embedded deployments) and OpenEJB (embedded deployments). You can also inject beans and component (using @Resource or @Inject) into test cases.

We'll be adding supported containers in future releases - if you want to see your favorite container on the list, join our community and we can show you how to add support for it. We also plan to add more convention over configuration, meaning you'll only need to specify a single deployment and reuse it in all your test cases. Aslak has written more about future ideas in a follow-up blog entry. He also provides some examples of how to use Arquillian.

We're strong believers in writing tests, and writing tests which actually test your business logic in the environment it will finally run in, rather than introducing mocked out objects (which may behave differently). While unit testing is important to ensure the correctness of your logic, it does not ensure the correctness of two objects which interact with each other.

With the help of the ShrinkWrap project, Arquillian gives you the ability to create micro deployments around your tests. Micro-deployments are contained sub-sections of your application logic. This gives you the ability to do lower level integration testing on a lower level then normal integration. It is up to you at what level you want to test!

We also know you need a convenient way to run your test quickly, and that is why we are getting JBoss Embedded AS in shape. Embedded AS offers the potential to bootstrap JBoss AS inside the same JVM when you run your test, making it super easy to debug the test. Unfortunately, Embedded AS support didn't make this release (we made a decision to release what we have now, rather than delay), but we will push this out to you as soon as it's ready.

Testing your components and services gets you a long way, but you'll nearly always want to test your presentation tier as well. And that's where frameworks like JSFUnit and Selenium come in - they allow you to exercise the work flows your user will use. Support for both these frameworks is planned, as well as for Mock JSF Objects.

If you like what you've heard so far, but are worried that Arquillian requires build script wizardry to use, let us surprise you again! Being able to run any of these tests from within the IDE is a key goal of Arquillian -- and the key to a rapid development cycle. Arquillian requires no build wizardry! So check out the documentation and give it a try today!

[ JIRA ] | [ SPI Javadoc, API Javadoc ] | [ Reference Guide ] | [ Release Notes ]

11 comments:
 
11. Mar 2010, 04:11 CET | Link
Drew Arrigoni

Best news I've heard in a while!

...Now I have no excuse not to exercise TDD.

 
11. Mar 2010, 05:53 CET | Link

Sorry. I pasted way too much text the first time. This is what I meant to say. I'd delete my earlier comment, if I could.

This sounds like a great project, and I commend you for doing it. I like anything that removes obstacles from the path of those trying to write programmer tests. Even so, I have one big and one small point to raise. First, the big one: there is no earthly reason at all ever to /need/ to test business logic in anything bigger than a JVM. Maybe you didn't mean business logic, but if you need or even want to test business logic in a real-life environment, then you have business logic and application logic mangled together. There's simply no need for that. I think Arquillian would work great for checking the integration layer that exposes that business logic in an Enterprise Java application, though. Of that I have no doubt.

Now for the small point. You wrote, While unit testing is important to ensure the correctness of your logic, it does not ensure the correctness of two objects which interact with each other. First, of course, tests cannot ensure the correctness of anything, but I know you meant ensure as a shorthand for give us high confidence in. Still, if you let details depend on abstractions, rather than more details, then you don't need integrated tests to show that layers communicate correctly. For that, you can use contract tests. They help you avoid the mistake you mentioned, of writing allowances and expectations for methods that don't match the way the production implementations of those methods behave. See http://www.jbrains.ca/permalink/281 for an introduction to contract tests.

In spite of these points, I see Arquillian as a huge step forward, and I wish you the best in continuing the project.

 
07. Apr 2010, 23:19 CET | Link
J. B. Rainsberger wrote on Mar 10, 2010 23:53:
Sorry. I pasted way too much text the first time. This is what I meant to say. I'd delete my earlier comment, if I could. This sounds like a great project, and I commend you for doing it. I like anything that removes obstacles from the path of those trying to write programmer tests. Even so, I have one big and one small point to raise. First, the big one: there is no earthly reason at all ever to /need/ to test business logic in anything bigger than a JVM. Maybe you didn't mean business logic, but if you need or even want to test business logic in a real-life environment, then you have business logic and application logic mangled together. There's simply no need for that. I think Arquillian would work great for checking the integration layer that exposes that business logic in an Enterprise Java application, though. Of that I have no doubt. Now for the small point. You wrote, While unit testing is important to ensure the correctness of your logic, it does not ensure the correctness of two objects which interact with each other. First, of course, tests cannot ensure the correctness of anything, but I know you meant ensure as a shorthand for give us high confidence in. Still, if you let details depend on abstractions, rather than more details, then you don't need integrated tests to show that layers communicate correctly. For that, you can use contract tests. They help you avoid the mistake you mentioned, of writing allowances and expectations for methods that don't match the way the production implementations of those methods behave. See http://www.jbrains.ca/permalink/281 for an introduction to contract tests. In spite of these points, I see Arquillian as a huge step forward, and I wish you the best in continuing the project.

Thanks for the terminology help!

 
16. May 2014, 00:54 CET | Link
jack

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.reishimushroom.pw

 
18. May 2014, 23:59 CET | Link
jack
midtown.patch.com

Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing.

 
23. Aug 2014, 14:46 CET | Link
your blog

That are used in the Seam stack. To use Seam in your Maven-based project, it is first recommended that you define the Seam version you wish to use by declaring the following property valu. the venus factor workout

 
01. Sep 2014, 08:35 CET | Link
jack

Oh, wow! This is amazing! I have to say that this is one home automation jupiter of the most amazing article that I've read. In my lifetime, I've read a lot of articles and by far, I've liked this one the best. Cheers!

 
06. Sep 2014, 17:00 CET | Link
ronnie

This is very nice blog because information provided here through the article and the pictures are very effective. Because sometimes words cannot explain the things that pictures can and here the words and pictures both are expressing the things in balance. venus factor reviews

 
08. Sep 2014, 06:05 CET | Link

This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post.bugatti veyron wallpaper

 
20. Oct 2014, 12:45 CET | Link
vmud

ClicThis is a great article thanks for sharing this informative information. HD mxf files conversion software mxf converter pdf conversion to Office pdf to word w.

 
25. Nov 2014, 09:14 CET | Link

I think the website should come up with more features. I believe the number of the visitors will increase. Coaching Classes for