Blogs Infinispan Arquillian Container 1.1.0.Alpha1 released

Infinispan Arquillian Container 1.1.0.Alpha1 released

Dear Infinispan users, a new version of Infinispan Arquillian Container has been released into JBoss Maven Repository as maven artifacts. The previous version was announced by http://blog.infinispan.org/2012/09/infinispan-arquillian-container-100cr1.html The blog post contains information related to setup of JBoss Maven Repository, including its address as well as address of the Infinispan Arquillian Container itself.

Maybe we should now call the project Infinispan Arquillian extension rather than Infinispan Arquillian Container because, since version 5.3, Infinispan Server has been based on JBoss Application Server 7 and the submodule called infinispan-arquillian-container could be removed.

As a result, the configuration of Arquillian with respect to Infinispan Server was simplified.

Developing tests with Infinispan Server

Now there’s only one way to compose the arquillian.xml file:

The property ispnHome no longer exists. The path to the Infinispan Server is now specified via jbossHome. The serverConfig attribute then specifies the correct configuration file for the server.

In order to run tests with Infinispan Arquillian extension, one should use the following dependencies: org.jboss.as:jboss-as-arquillian-container-managed:jar:7.2.0.Final:test org.infinispan.arquillian.container:infinispan-arquillian-impl:jar:1.1.0.Alpha1:test

Now that we’ve configured the server to run in our tests, it’s time to introduce a few enhancements which will help you write tests more effectively.

RemoteInfinispanServers

You can still inject the reference to a running Infinispan Server by annotating an instance variable of type RemoteInfinispanServer with @InfinispanResource.

When there are more Infinispan servers to be injected, you can now use the following snippet instead of injecting each server independently:

  Then you can retrieve individual servers by calling .getServer(name) on the servers variable. The name must correspond to an existing container definition within arquillian.xml. The results of this call will be of type RemoteInfinispanServer.

WithRunningServer

So far users were forced to start the Infinispan Server either before the whole test suite (mode="suite") or before each class separately (mode="class"). The annotation WithRunningServer enables users to automatically start the server before a test method and stop it after the method. Example:

Note that in this case containers should be marked as mode="manual" in arquillian.xml file so that Infinispan Arquillian extension can handle lifecycle of these servers by itself.

When @WithRunningServer annotation is placed on a class, the server(s) will be started before the first method call in the test class, and stopped when JUnit @AfterClass event is triggered.

IPv6 support

Infinispan Arquillian extension can now work with Infinispan Server running on IPv6 as it can correctly connect to the server via JMX.

Testing embedded Infinispan

Running tests with plain Infinispan libraries instead of Infinispan Server has not changed since the last release. Read more about it in the previous blog post.

Thanks to Michal Linhard and Vitalii Chepeliuk who helped move the project one step further.

Cheers, Martin

Get it, Use it, Ask us!

We’re hard at work on new features, improvements and fixes, so watch this space for more announcements!

Please, download and test the latest release.

The source code is hosted on GitHub. If you need to report a bug or request a new feature, look for a similar one on our JIRA issues tracker. If you don’t find any, create a new issue.

If you have questions, are experiencing a bug or want advice on using Infinispan, you can use GitHub discussions. We will do our best to answer you as soon as we can.

The Infinispan community uses Zulip for real-time communications. Join us using either a web-browser or a dedicated application on the Infinispan chat.