Arquillian OSGi 1.0.3.Final Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.3.Final release of the Arquillian OSGi component!

What is Arquillian OSGi?

ShrinkWrap is the simplest way to create archives in Java. Using the fluent and intuitive ShrinkWrap API, developers may assemble JARs, WARs, and EARs to be deployed directly by Arquillian during testing.

Release details

Component Arquillian OSGi
Modules
Version 1.0.3.Final view tag
Release date 2012-10-23
Released by Thomas Diesler
Compiled against

Published artifacts org.jboss.arquillian.testenricher

  • org.jboss.arquillian.testenricher » arquillian-testenricher-osgi jar javadoc pom
  • org.jboss.arquillian.protocol » arquillian-protocol-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi-embedded jar javadoc pom

Release notes and resolved issues 5

Containers OSGi - Final

Enhancement
  • ARQ-468 - Automatically add test super classes for OSGi
Feature Request
  • ARQ-1152 - Add support for OSGi types as ArquillianResource
  • ARQ-1153 - Add support for multiple bundle deployments per test case
  • ARQ-1159 - Add support for Felix/Equinox testing
Task
  • ARQ-954 - Remove dependency on jboss-logging in OSGi Bundle

Thanks to the following list of contributors: Thomas Diesler

Arquillian Container Weld Root POM 1.0.0.CR4 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.CR4 release of the Arquillian Container Weld Root POM component!

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Container Weld Root POM
Modules
Version 1.0.0.CR4 view tag
Release date 2012-10-17
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.container

  • org.jboss.arquillian.container » arquillian-weld-ee-embedded-1.1 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-weld-se-embedded-1 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-weld-se-embedded-1.1 jar javadoc pom

Release notes and resolved issues 6

Feature Request
Bug
  • ARQ-753 - ShrinkWrapClassLoader does not find service provider in WAR
  • ARQ-817 - arquillian-weld-container does not build on Maven Default Profile
  • ARQ-818 - WebArchiveClassLoader only honors resource requests for Service files
  • ARQ-819 - Wrong criteria used for supplying Weld with WebArchiveClassLoader
  • ARQ-890 - WeldEEMockContainer does not clean up resources if the deployment fails

Thanks to the following list of contributors: Jozef Hartinger, Aslak Knutsen, Martin Kouba, Andrew Lee Rubinger

Arquillian OSGi 1.0.3.CR1 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.3.CR1 release of the Arquillian OSGi component!

What is Arquillian OSGi?

ShrinkWrap is the simplest way to create archives in Java. Using the fluent and intuitive ShrinkWrap API, developers may assemble JARs, WARs, and EARs to be deployed directly by Arquillian during testing.

Release details

Component Arquillian OSGi
Modules
Version 1.0.3.CR1 view tag
Release date 2012-10-16
Released by Thomas Diesler
Compiled against

Published artifacts org.jboss.arquillian.testenricher

  • org.jboss.arquillian.testenricher » arquillian-testenricher-osgi jar javadoc pom
  • org.jboss.arquillian.protocol » arquillian-protocol-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi jar javadoc pom
  • org.jboss.arquillian.container » arquillian-container-osgi-embedded jar javadoc pom

Thanks to the following list of contributors: Thomas Diesler

Arquillian Tomcat Container 1.0.0.CR4 Released

Since we wrote this post we didn't laze around. Check our latest announcement.

The Arquillian team is proud to announce the 1.0.0.CR4 release of the Arquillian Tomcat Container component!

Some of the highlights in this release

Support for nice multiline/pretty formatting of JVM-argument configuration. Additionally, you can use quotes to provide values containing spaces.

<property name="javaVmArguments">
  -Xms512m -Xmx512m
  -XX:MaxPermSize=512m
  "-Djavax.net.ssl.keyStore=/path/to your/keystore"
</property>

Embedded Tomcat 7 is now capable of protected WAR deployment (this is usual in typical standalone server), thus some standard deployment features are now available even for embedded use, e.g.:

  • Deployment of an archive named “ROOT.war” to the default context “/”
  • Proper processing of “META-INF/context.xml” if present in the WAR.

What is Arquillian?

Arquillian is open source software that empowers you to test JVM-based applications more effectively. Created to defend the software galaxy from bugs, Arquillian brings your test to the runtime so you can focus on testing your application's behavior rather than managing the runtime. Using Arquillian, you can develop a comprehensive suite of tests from the convenience of your IDE and run them in any IDE, build tool or continuous integration environment.

Release details

Component Arquillian Tomcat Container
Modules
Version 1.0.0.CR4 view tag
Release date 2012-09-24
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.container

  • org.jboss.arquillian.container » arquillian-tomcat-common jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-managed-5.5 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-embedded-6 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-remote-6 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-managed-6 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-embedded-7 jar javadoc pom
  • org.jboss.arquillian.container » arquillian-tomcat-managed-7 jar javadoc pom

Release notes and resolved issues 4

Small bugfix release

Bug
  • ARQ-548 - Unable to set custom Loader for Tomcat 7 Embedded container
  • ARQ-1044 - The properties of tomcat container configuration in arquillian.xml are not parsed properly
  • ARQ-1051 - Arquillian Container Tomcat test dependency weld-servlet is not available in Maven Central

Thanks to the following list of contributors: Aslak Knutsen, Tomas Repel, Ian Brandt

The Danger of Embedded Containers

In the Arquillian project, we’re all about real tests. There’s a good reason for this philosophy. If you use mocks or a substitute container when testing code that uses a programming model (i.e., CDI), all you can be sure of is that you’ve faked out enough functionality to get the test to work. You can’t be certain that your code works—really, truly works.

Obviously, we provide adapters for embedded containers (i.e., substitute containers). The reason is, they often do a decent enough job of simultating the real environment that we are willing to make the trade-off for its variations when we are working in development. I would expect, though, that you are also running the same tests in CI using a real container…just to get that peace of mind.

How do you know when not to use an embedded container?

If you write a test that you are positive should work, but instead throws some wacky exception, immediately stop and try the same test in a real container. For example, if you are using Embedded GlassFish, I would advise running the test in managed or remote GlassFish. The latter two adapters both use an authentic GlassFish instance. If the test passes, then you have answered the question of this section.

When the embedded container begins to act inconsistently, drop it.

As with all things, there are exceptions to the rule. If the code really should work on the embedded container, then it may be worth exploring why it isn’t. That may lead you to the discovery of a bug in the library you’re using. If debugging the library is your main concern, chase it down. If you are just trying to get a test written for your application, stop using the embedded container (or save debugging it for a rainy day).

Examples

See this thread in the Seam 3 forums for an example where the Embedded GlassFish container was acting more of a hindrence than a help. The thread includes the steps I took to get a green bar using a different GlassFish container adapter.

Markus Eisele identifies another hazard. He points out in a recent blog post that testing JPA using Embedded GlassFish is problematic because JPA weaving (in EclipseLink) does not occur:

[Weaving] only works when the entity classes to be weaved only exist in the application classloader. The combination of Embedded GlassFish, Arquillian and the Maven Surefire Plugin mix this up a bit and the end of the story is, that exactly none of your entities are enhanced at all.

Again, testing on Embedded GlassFish is not serving us well in this scenario. Graduate.

Closing thoughts

Code that uses Solder works fine on GlassFish 3.1.2, but it does not play very nicely with Embedded GlassFish—it’s just a hostile environment for CDI because of the visibility issues that come with starting an embedded container inside an existing Java process. The same goes for JPA. You end up in a minefield of class visibility and access problems, and far from making any progress writing tests (your ultimate goal).

If you want the container to start automatically like with embedded, then switch to a managed container. It works almost exactly the same as the remote container, except that Arquillian will start the standalone process at the beginning of the test execution and stop it at the end. In other words:

managed >>>> embedded

It’s clean. It’s true.

For speed of development:

remote > managed

With remote, you don’t have to wait for the container to start…and you can start it in debug mode very easily and keep it there. That’s why I say that the best container adapters for development are the remote adapters and the best adapters for CI are the managed adapters. I personally don’t like the embedded container adapters much (with the exception of embedded CDI since that’s mostly a pure standalone CDI environment).

Keep that advice in mind.