Monday, March 19, 2012

Graphene CR3 Released & How To Migrate from Ajocado?


The project Ajocado has been renamed to Graphene.

The first release under the new name waits for you in Maven repositories.

Migration Path

Fortunately, the migration to new name in your project is very smooth, you can even continue to use original APIs.

Java Classes

The packages of the Java classes have not been renamed, the only change is addition of three new interfaces/utilities and deprecation of the old ones:

Ajocado -> Graphene
AjaxSelenium -> GrapheneSelenium
AjocadoConfiguration -> GrapheneConfiguration
AjocadoContext -> GrapheneSeleniumContextM
AjocadoConfigurationContext -> GrapheneConfigurationContext

The original names has been deprecated, but it doesn't prevent to use current tests as they are - the deprecated classes will continue to be part of the project.

Configuration

The simple change in the arquillian.xml descriptor is needed, you just need to change ajocado to graphene:

<extension qualifier="graphene">
    ...
</extension>

Maven Artifacts

The most significant change underwent dependency system, so let me talk a more little bit about that:

In Ajocado CR2, there was only one dependency necessary to import all the JUnit/TestNG and all Arquillian dependencies.

In Graphene CR3, you need to manage several dependencies - however it makes your usage of dependencies little more cleaner, since you know exactly what dependencies are imported.

At first, you need to import JUnit/TestNG dependency:

Test Framework

<!-- JUnit -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.8.2</version>
    <scope>test</scope>
</dependency>

<!-- TestNG -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>5.14.6</version>
    <scope>test</scope>
</dependency>


Additionally, you need to choose between using Graphene as standalone or use Arquillian integration with containers:

Standalone Usage

In this mode, you don't use integration with containers, you need to manage the container and deployment at own:

<!-- Arquillian JUnit Standalone -->
<dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-standalone</artifactId>
    <version>1.0.0.CR7</version>
    <scope>test</scope>
</dependency>

or

<!-- Arquillian TestNG Standalone -->
<dependency>
    <groupId>org.jboss.arquillian.testng</groupId>
    <artifactId>arquillian-testng-standalone</artifactId>
    <version>1.0.0.CR7</version>
    <scope>test</scope>
</dependency>


Container usage

In the container mode, you need to provide deployable archive  (@Deployment) and the whole lifecycle of the container and deployment will be managed by Arquillian:

<!-- Arquillian JUnit Container -->
<dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-container</artifactId>
    <version>1.0.0.CR7</version>
    <scope>test</scope>
</dependency>

or

<!-- Arquillian TestNG Container -->
<dependency>
    <groupId>org.jboss.arquillian.testng</groupId>
    <artifactId>arquillian-testng-container</artifactId>
    <version>1.0.0.CR7</version>
    <scope>test</scope>
</dependency>

Graphene Dependency Chain

And finally it's necessary to import Arquillian Graphene dependency chain, which includes all other necessary dependencies (Graphene, Drone, Selenium):

<!-- Graphene dependency chain -->
<dependency>
    <groupId>org.jboss.arquillian.graphene</groupId>
    <artifactId>arquillian-graphene</artifactId>
    <version>1.0.0.CR3</version>
    <type>pom</type>
    <scope>test</scope>
</dependency>

What's next?

We are preparing to release Final later soon, the same as other dependencies in Arquillian ecosystem.

Thanks all the people who helped to test migration (Jan Papousek, Karel Piwko), so it is now pretty smooth.


More project information

Home page
Documentation
Issue tracker

No comments:

Post a Comment