Tuesday, September 27, 2011

How to use Shrinkwrap MavenDependencyResolver

If you use Maven to build your application and you want to test it with Arquillian, Be sure that you will be looking for a way to include some of your libraries (artifact) from Maven into your archive file (war, ear...).

In this article we show you how to use the Shrinkwrap MavenDependencyResolver to read artifact from pom file using the maven setting file.

For this purpose you just need to add your maven setting file in a folder mvn_settings under src/test/ressources and add this entry in your @Deployment method !

.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
.configureFrom("src/test/resources/mvn_settings/settings.xml")
.artifact("GROUPID:ARTIFACTID:TYPE:VERSION")
.resolveAs(GenericArchive.class))


For further details about Resolver extension in ShrinkWrap, refer to: https://github.com/shrinkwrap/resolver

Saturday, September 24, 2011

JSFUnit 2.0.0.Beta 2 is Out


The Beta 2 version for JSFUnit2 is available from the middle of this month (September) with a fully support for junit 4, JSF2 and Arquillian , for more details check this blog entry and the release note

Have a look at this related getting started example and enjoy it!!

Friday, September 23, 2011

How to configure Arquillian with a remote Jboss AS7


If you want to use Arquillian to connect and run against a remote(different JVM, different machine) running previous version of Jboss server, you need to use JNDI properties for that !

In Jboss AS 7, the jndi.properties file is not used... So If you have set the managementAddress configuration option to where the management api is bound, Arquillian should read out from the server (remote or local jvm/machine) where the ip_adress/port_number are bound.

All this configuration is done in the arquillian.xml file as bellow:
 

IP_ADR
PORT_NUM


For JBoss AS 7.0.0.Final, you need to configure the jmx protocol used by adding:

REMOTE

under the container tag ...