Testing with Aliens; How to test a JPA type converter with Arquillian

JPA type converters provide an easy way to define how an entity attribute gets persisted to the database. You can use them to implement lots of different features, e.g. to encrypt your data as I showed in a previous post: How to use a JPA Type Converter to encrypt your data
But writing the type converter is not enough. We also need to make sure, that it is working correctly.

In general, there are two ways to test a type converter. We could write a unit test to check, if the conversion works correctly. But a unit test performs a test of the isolated class without putting it into the real execution environment. That means that we will still not know, if the converter works in one of our applications. If everything is set up correctly, the persistence provider will call the converter before writing to and after reading from the database. So we also need to check if the type converter gets called by the persistence provider and if everything works fine under that condition. We need to test the converter inside of the container we want to use for our application.

We will have a look at how this can be done with Arquillian and its persistence extension.

Something about Arqillian

If you are already familiar with Arquillian, you can skip this part. For all of you who have never worked with Arquillian so far, I just want to give some basic information. You can find a more detailed description at the Arquillian Getting Started guide.

Arquillian is a test framework for in container testing. The idea is to do not mock the container you want to use but to test your code inside of it. This provides the advantage, that you can test if your code will also work in your execution environment and not only in your mocked up test scenario. Arquillian provides lots of functionality to manage the container, inject required resources like EJBs or an EntityManager and make your live much easier.

The Arquillian tests are executed by junit. This is great, because you can use them everywhere, where you can execute junit tests. And that means in your IDE, as part of your build process, on your CI server, simply everywhere.

Object under test

The following code snippet shows the object under test for this example. It is a type converter that encrypts and decrypts a String attribute. The converter gets called by the persistence provider before writing to and after reading from the database. If you want to read more about how this type converter works, check my posting about it.

@Converter
public class CryptoConverter implements AttributeConverter<String, String> {

    private static final String ALGORITHM = "AES/ECB/PKCS5Padding";
    private static final byte[] KEY = "MySuperSecretKey".getBytes();

    @Override
    public String convertToDatabaseColumn(String ccNumber) {
      // do some encryption
      Key key = new SecretKeySpec(KEY, "AES");
      try {
         Cipher c = Cipher.getInstance(ALGORITHM);
         c.init(Cipher.ENCRYPT_MODE, key);
         return Base64.encodeBytes(c.doFinal(ccNumber.getBytes()));
      } catch (Exception e) {
         throw new RuntimeException(e);
      }
    }

    @Override
    public String convertToEntityAttribute(String dbData) {
      // do some decryption
      Key key = new SecretKeySpec(KEY, "AES");
      try {
        Cipher c = Cipher.getInstance(ALGORITHM);
        c.init(Cipher.DECRYPT_MODE, key);
        return new String(c.doFinal(Base64.decode(dbData)));
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
}

Setting it up

Before we can start to write our tests, we need to define a few dependencies. I will only show how to configure the dependencies we need for this example. If you have not already set up arquillian tests for your project, you will have to do a little bit more. Please check the Getting Started guide to learn how to setup arquillian for your project. Don’t be afraid, there is not too much to do.

As you can see in the following snippet, we will use JUnit 4.11, Arquillian 1.1.3.Final, the Arquillian Persistence Extension 1.0.0.Alpha7 and the WildFly Application Server 8.1.0.Final.

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
    ...

    <properties>
        <version.junit>4.11</version.junit>
        <version.arquillian>1.1.3.Final</version.arquillian>
        <version.arquillian_persistence>1.0.0.Alpha7</version.arquillian_persistence>
        <version.wildfly>8.1.0.Final</version.wildfly>
    </properties>

    <dependencyManagement>
        <dependencies>
            ...
            <dependency>
                <groupId>org.jboss.arquillian</groupId>
                <artifactId>arquillian-bom</artifactId>
                <version>${version.arquillian}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        ...
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.extension</groupId>
            <artifactId>arquillian-persistence-dbunit</artifactId>
            <version>${version.arquillian_persistence}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

Writing the tests

There are two things we need to do to setup our test environment. At first, we need to tell junit that this test shall be executed as a junit test. This is done by @RunWith(Arquillian.class).

Additionally, we need to create the test deployment, that will be deployed to the container. Therefore we need to implement at least one method and annotate it with @Deployment. As you can see in the following code snippet, we use ShrinkWrap to create a jar archive deployment. The archive contains the CreditCard entity, the CryptoConverter type converter and the test class. There is no need to include any EJBs or other classes which implement business logic. We can inject the EntityManager into our test case and use it directly to persist and read entities. We will have a more detailed look at it later on.

Additionally, we need to add some manifest resources to create a persistence unit, register the type converter and add an empty beans.xml to activate CDI. Please check the getting started guide to get more information on ShrinkWrap and creating deployments.

@RunWith(Arquillian.class)
public class TestCryptoConverter {

    @Deployment
    public static JavaArchive createDeployment() {
        return ShrinkWrap
                .create(JavaArchive.class)
                .addClasses(CreditCard.class, CryptoConverter.class,
                        TestCryptoConverter.class)
                .addAsManifestResource("META-INF/persistence.xml",
                        "persistence.xml")
                .addAsManifestResource("META-INF/orm.xml", "orm.xml")
                .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
    }

After this is done, we can start to write the test cases. At first, we will persist a CreditCard entity and check, if the credit card number gets encrypted by the CryptoConverter. Therefore we inject the EntityManager, create a CreditCard entity and pass it to the persist method of the EntityManager. The validation of the persisted data, is done by the Arquillian persistence extension. We just need to define the data we expect to be written to the database. The expected data is defined in the cc.yml file, which is referenced in the @ShouldMatchDataSet annotation. Because the id attribute is generated by the database, we want to exclude it from the validation. This can be done by referencing it in the excludeColumns attribute of the annotation.

    @PersistenceContext
    private EntityManager em;

    @Test
    @ShouldMatchDataSet(value = "data/cc.yml", excludeColumns = "id")
    public void testEncryption() {
        CreditCard cc = new CreditCard();
        cc.setName("My Name");
        cc.setCcNumber("123456789");

        this.em.persist(cc);
    }

The cc.yml contains the following information.

CreditCard:
  - id: 1
    name: My Name
    ccNumber: egFfkhd8cRh82tvsh3VVUg==

In the second test, we will check if we can search the database for a CreditCard entity with a given credit card number. Therefore we use the @UsingDataSet annotation to seed the database with data defined in the cc.yml file. Now we can use the injected EntityManager to call a named query to search for CreditCard entity with the given number.

    @Test
    @UsingDataSet("data/cc.yml")
    public void testRead() {
        CreditCard cc = this.em
                .createNamedQuery(CreditCard.BY_NUMBER, CreditCard.class)
                .setParameter("number", "123456789").getSingleResult();
        Assert.assertEquals("My Name", cc.getName());
    }

Conclusion

We used Arquillian and the Arquillian Persistence extension to test a JPA type converter. Therefore we injected the EntityManager and used the annotations @ShouldMatchData and @UsingDataSet to validate and seed the database with a yml file.
If you want to try it yourself, you can find the sources on github.
You can run it by calling: git clone https://github.com/thjanssen/JPA2.1.git && cd JPA2.1/CryptoConverter && mvn test

What are your experiences with testing your Java EE application with Arquillian? Please write a comment about it.

Want to learn more about Arquillian, see the Arquillian Guides: http://arquillian.org/guides/

About the author

Thorben Janssen is a senior developer with more than 10 years of experience in Java EE development and architecture. During these years he acted as developer, architect, project and technical lead to create high available, clustered mobile billing solutions and laboratory information management systems.
Visit his blog: http://www.thoughts-on-java.org or follow him on twitter and google+ to read more about Java EE7 and Arquillian.

Jakub Narloch brings Arquillian to Netflix, recognized at AWS re:Invent

We’d like to congratulate Jakub Narloch, a key Arquillian contributor and community member, on receiving a Netflix Open Source Software (OSS) cloud prize. Jakub won the award for Best Contribution to Code Quality for his work integrating Arquillian into the Karyon and Genie projects.

Jakub Narloch - Best Contribution to Code Quality

Adrian Cockcroft, the Chief Cloud Architect at Netflix, announced the NetflixOSS cloud prize winners during a keynote session at the AWS re:Invent conference.

When you are working on these projects, you have to worry about doing QA. We wanted to have an enterprise entry for quality contributions.

Rather than just worrying about fixing bugs in one project, what Jakub [Narloch] did was integrate the JBoss Arquillian test framework that we develop everything from.

Now, all the projects we build going forward are going to have Arquillian built in.

— Adrian Cockcroft
Netflix keynote at AWS re:Invent

Adrian Cockcroft announcing the NetflixOSS award recipients at AWS re:Invent

Jakub and the other winners were present at AWS re:Invent to receive their award, a custom-made Cloud Monkey trophy, $10,000 in prize money from Netflix, $5,000 in AWS credits from Amazon and the cost of the trip to Las Vegas and admission to the conference.

jakub cloud prize winner ftw
Jackub Narloch (third from left, arm raised) receiving his trophy at AWS re:Invent

Jakub started out by helping to configure Arquillian to do tests for the Denominator DNS integration with UltraDNS. This work extended to include Karyon, the base server that underpins NetflixOSS services and the starting point for developing new services. Netflix was able to leverage the same integration to test Genie, which is based on Karyon.

As Adrian mentioned in the keynote, all of the projects his team at Netflix builds will be tested with Arquillian on day one.

jakub cloud prize winner slides
jakub cloud prize winner slide

We appreciate all that Jakub has done for the Arquillian project and code quality. Jakub entered into the Arquillian community as a Google Summer of Code student in 2012. He successfully, and rapidly, completed his project to create a Spring Framework integration for Arquillian. He now leads the Spring integration module, as well as the Guice integration and REST extension modules. We are privileged to have Jakub as member of the Arquillian community. Seriously.

We’d also like to thank Adrian Cockford, the NetflixOSS group and the contest mentors for running the cloud prize contest and giving the Arquillian project and community an opportunity to prove its value. We recognize Netflix as a valuable citizen and supporter of Arquillian and the broader open source community. We certainly hope Arquillian helps to ensure the quality of your software and drives development forward for many years to come.

Finally, we’d like to thank Adrian Cole, formerly at Netflix, for planting the Arquillian seed in the NetflixOSS group and for reaching out to the Arquillian community members to participate in the cloud prize contest. Jakub rose to that challenge. One of the primary projects Adrian worked on while at Netflix, Denominator—​a multi-vender interface for DNS—​was also represented in this cloud prize contest. Adrian is a true hero of OSS, cloud platforms and Arquillian.

Thanks to Jakub, Adrian and Netflix, Ike invaded the big stage at AWS re:Invent!

For more details about Jakub’s contribution to the Netflix projects, refer to his cloud prize submission, the announcement on the NetflixOSS blog and his contributions. To learn more about Arquillian, head over to arquillian.org.

cloud prize winners
Jakub Narloch (fourth from right) with the other winners of the NetflixOSS cloud prize

Green bar

Hackfest: DevConf 2013, Czech Republic, Brno

In about a weeks time DevConf 2013 in Brno, Czech Republic will kick of for the 5. year in a row.
This year, as last, we will take part in the HackFest spanning from Saturday 23. to Sunday 24. of February. And for the eager hackers even Monday 25. February.

Introducing the candidates

Without any more fuzz, let’s jump straight into some of the ideas we have for this hackfest. Of course, you’re free to bring your own as well!

Gradle Container Controller

One of the hacks that was started during the Devoxx 2012 Hackergarten: was the Arquillian Gradle integration. The basic idea is to leverage Arquillian’s Container support to control Containers and Deployments within the Gradle build system, much like we do for Maven via the Arquillian Maven Plugin. This in particular is a very interesting integration since it opens up Arquillian to a new type of usage, as a pure Container Controller.

Why would Gradle use Arquillian for this? It’s a simple matter of focus. Gradle care about build systems and don’t have the resources to implement support for all the Containers. Arquillian on the other hand care very much of the Containers and already support much more than Gradle currently do in this area. Perfect combination of two tools with different capabilities.

You can read up on some of the discussions and see look at the early prototype.

The end goal would be to match as much as possible of the Gradle Design docs and have Arquillian be the internal runner.

Arquillian Forge Plugin – Extensions

JBoss Forge is best described by them selves.

A core framework and next-generation shell for tooling and automation at a command line level; with APIs for integration in IDEs, extending built in functionality with plugins, and scripting for automating repetitive tasks, Forge is a tool every open-source developer should be looking at.

A core framework for rapid-application development in a standards-based environment. Plugins / incremental project enhancement for Java EE, and more.

There exists already an Arquillian Plugin for Forge which handles setup of Arquillian Core and Container dependencies, Container configuration and simple TestClass generation.

But the missing bit is set up and support for the Arquillian Extensions. This hack should be able to answer, by using Forge, questions like:

  • How do I setup Drone, Persistence, Transactions?
  • How do I configure Drone?
  • Which configuration options does Persistence support?

Arquillian Warp

Arquillian Warp fills the void between client-side and server-side testing. Using Warp, you can initiate an HTTP request using a client-side testing tool such as WebDriver and, in the same request cycle, execute in-container server-side tests. This powerful combination lets you cover integration across client and server.

SeamTest

Warp leverages any HTTP client (such as httpclient or WebDriver), to produce testable requests and provides server-side hooks which allows you to execute arbitrary logic in any part of the request lifecycle. However the fact that developer needs to provide HTTP request in order to test is limiting – sometimes you need to test using any request type: such as conversations. The goal is designing an API and implementation for testing sequence of requests without providing an HTTP client logic. (This extension should provide a migration layer for SeamTest )

CDI events

Warp plays nicely with IoC principles – your test does not need to tightly couple with container, it will bring all the necessary dependencies to the test. In Java EE, Warp leverages CDI to inject user-defined beans into the test. Warp has the potential to use much more from the concepts brought by CDI: observe CDI events, produce beans or intercept calls to existing beans. The idea is to provide hooks which would make testing of client request interaction with CDI beans as easy as defining Warp’s lifecycle hooks.

Arquillian Google Web Toolkit

The Google Web Toolkit is a development tool for building complex browser-based applications written in pure Java. The new Arquillian GWT extension brings true integration testing to GWT. This means that GWT integration tests can break free and execute in the actual runtime container instead of being tied to GWT’s embedded Jetty server. Further it is now possible to combine GWT client-side and standard in-container tests in the same test class. This allows to test features without having to worry about the client-server bridge and should pave the way for future support of Arquillian Warp and Drone in GWT integration tests.

Remove the need for GwtArchive

Currently the Arquillian GWT extension uses a custom utility (GwtArchive) to enrich WebArchives for GWT deployments. This causes the API for Arquillian GWT tests to deviate from standard Arquillian tests. It should be possible to automatically enhance the deployment archive to include all dependencies and configurations that are relevant to the GWT deployment, possibly by leveraging an Arquillian packaging SPI’s. As a result of this, GWT integration tests will use the same API as all other Arquillian tests.

Leverage Arquillian Warp in GWT integration tests

Warp enables tests to assert on both client-side and server-side logic and is an extremely useful tool for writing compact integration tests. The focus will be on brainstorming to come up with a battle plan for how Warp could be integrated with Arquillian GWT.

Arquillian Distribution Extension

This is probably the hardest and largest of them all. But even more interesting, right?. As Arquillian work today it will allow you to interact with local and remote Containers. But the big assumption with Remote Containers is that the Container is already up and running and we only need to connect to it. As we’re growing out to support more and more advanced use cases we’re starting to see the need for the ability to control and distribute infrastructure. Infrastructure being servers, containers or clouds.

A very brief description of what this extension should do:

  • Install Container A on Server B (copy source and configure)
  • Install Container X on Server Y (copy source and configure)
  • Configure Arquillian to use Container A on Server B
  • Configure Arquillian to use Container X on Server Y

From here on Arquillian Test takes over and run tests as described by the Test Suite. Next steps would be:

  • Uninstall Container X on Server Y
  • Uninstall Container A on Server B

This is particularly useful for the upcoming Performance Extension to allow it to install a full environment, including clients and targets, for performance testing.

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.

When and where are we hacking?

We are going to use the free Hackfest at DevConf 2013 as an opportunity to put our heads together to make progress on these ideas. Here are the details:

Of course, anyone is welcome to hack on these ideas at anytime from anywhere. This is open source!

Who will be there hacking?

Happy hacking!

Devoxx 2012 Hackergarten Overdrive!

Kick-off

Each project represented at Hackergarten briefly introduced itself and presented ideas to hack on. The presence of Red Hat community projects was very strong (~75%). We’re happy to report that there was lots of interest in Arquillian. It received the most votes for hacking, with JBoss Forge drawing in the second most.

General impressions

The Hackergarten was held in open areas at the back of the pavilion. The areas gave plenty of privacy, but also gave people freedom to move around. We didn’t have to experience that awkwardness of peeking through a door or the distraction of doors opening and closing. We were able to do demos in one section without affecting hacks or discussions going on in other sections because there was enough ambient noise, mostly music from the trade floor. The wired connections provided by switches at each table removed the distraction of getting on wifi, although it took a bit of time and some shuffling around in the morning to figure all that out.

Once we knew to get everyone plugged into the switches, we were off to the hacking races!

Pictures!

See more pictures in Album 1 and Album 2.

Hacking Overview (related to testing)

Code Contributions

Design Discussions

  • Arquillian Drone + Thucydides
  • Arquillian Ape + NoSQLUnit
  • Drools rules, Drools decision tables and Drools planner for filtering, prioritizing and coordinating distribution of tests in a suite
  • IntelliJ support for Arquillian, JBoss Forge
  • Using the web browser as a “container” to incorporate JavaScript tests into a Drone test
  • Juzu demo and shout out to use of Arquillian for testing
  • Jersey looking into adoption of Arquillian in test suite
  • Using Thucydides for CDI test suite and supporting spec documentation

Activity Stream (related to testing)

  • At the start of the event, I suggested the hack idea to integrate Arquilliun Drone and FluentLenium to Jan Papoušek
    • Jan and I introduced ourselves to Mathilde Lemee and they got to work on the integration straight away, starting off by sharing with each other how their respective projects worked.
    • By days end, they completed a working integration
    • Mathilde also integrated FluentLenium with Thucydides (“2 CDs”); stay tuned because that integration and the integration with Drone may become one and the same
    • In both cases, the integration with FluentLenium was so straightforward (and thus hackable) because of the nice abstraction layer Mathilde created that handled bootstrapping FluentLenium
  • Aslak hacked with Hans Dockter, creator of Gradle, on a gradle deployment plugin that uses Arquillian Containers to handle life cycle of dozens of containers (application servers, servlet containers and beyond)
  • Bartosz Majsak hacked on a demo for Arquillian Ape and enhanced Arquillian Transaction to work both in-container and embedded
  • I spoke with two of the IntelliJ developers (Peter and Yann) about:
    • a plugin for Arquillian (similar to the Eclipse Arquillian plugin)
    • adding an embedded Forge shell with UI interplay (similar to the JBoss Forge view in JBoss Tools)
  • I chatted with Julien Viet about:
  • Later in the day, Julien gave a presentation and demo of Juzu, excited to say it’s tested w/ Arquillian Core and Arquillian Drone
  • I brainstormed with Geoffrey De Smet, lead of Drools Planner, about:
    • using rules to handle the filtering decision for tests
    • the role decision tables can play in declaring conditions for which tests to run
    • optimizing test suite execution using Drools Planner and distributing tests over a grid
  • I spoke with John Smart about Arquillian Core and Arquillian Drone integration with Thucydides
    • We discussed how much the two projects align and what it would take to integrate
    • We concluded the first step is adding a bootstrap API in Thucydides, which he began to flesh out, that could be hooked to the Arquillian event model and all the integrations with individual test runners can be done once in Arquillian
    • We talked about how Drone could likely provide management of WebDriver
    • John Smart has been busy all week working on a bootstrap API for Thucydides (hacking on it with an ATDD approach, of course)
  • Koen Aers gave a demonstration of the JBoss Forge integration in JBoss Tools, talked about each of elements it brings to the Forge experience in the IDE
    • Koen wrote his first “Hello, World” IntelliJ plugin to get spun up and prepare to help with the integration
    • IntelliJ said they would put it on their roadmap and support the effort where possible
  • Alex Soto and Bartosz discussed integrating NoSQLUnit into Arquillian Ape (peristence extension)
    • These projects closely align and it pushes Arquillian’s definition of container management forward
    • I told Marek Jelen about Alex’s NoSQLUnit demo of testing MongoDB on OpenShift through the port forwarding setup by JBoss Tools; a blog entry may be in the works;
    • Arquillian + NoSQLUnit has lots of application, one of which may be testing NoSQL backends in the Infinispan project
  • Alexis Hassler was busy improving the Arquillian adapter for CloudBees by adding EJB injection support.
  • Aslak discussed with JAX-RS lead about using Arquillian for JAX-RS TCK; not likely soon, but Jersey is entertaining idea of using Arquillian to test Jersey (JAX-RS reference implementation)
  • I spoke with Paul Bakker briefly about combining the Forge Arquillian plugin and the Forge Arquillian Extension plugin into one code base
  • I brainstormed with David Blevins, lead of TomEE, about the role a test suite can play in the early and in-progress development of a specification
    • proposed idea of using a ATDD approach where tests could be not only marked as pending (before a ref impl is in place), but also proposed, open question and alternative
    • agreed that using tests can focus the discussion about the spec, clarify ambiguities & resolve different interpretations
    • John Smart gave a demo of Thucydides and we contemplated using it for the CDI test suite

Wrap-up

As the event wound down, I discussed with Andres Almiray, who organized the Hackergarten, about what went on during the day, whether Hackergarten accomplished his goals. He talked about the importance of giving people a chance to make a concrete contribution, give them a win to take home with them, lower perception of a barrier to contributing. I talked to him about the fact that Hackergarten is a catalyst for ideas, some of which come into play before the event, already successful and is also ongoing throughout the week, so we’ll only know total impact once conference is over. Some ideas take time to soak. I can attest, we’re still hacking ;)

Finally, Arquillian was invited to join the Nighthacking Tour hosted by Steven Chin on on Wednesday night, so look for that coverage when it comes online.

What people were tweeting…

  • Bartosz Majsak (@majson) posted: #devoxx #arquillian @aslakknutsen you have some pull requests
  • Markus Eisele (@myfear) posted: What could be the next cool #Arquillian feature? creative @aslakknutsen at the #hackergarden http://twitpic.com/bcv2lv
  • Alexis Hassler (@AlexisHassler) posted: GREEN BAR on my #arquillian test. Cloudbees Container Adapter is getting further, thanks to @majson & @aslakknutsen
  • Aslak Knutsen (@aslakknutsen) posted: Hacking #Arquillian Container control plugin for #SBT & #Leiningen. #Gradle next…
  • Jan Papousek (@jan_papousek) posted: @MathildeLemee the first attempt of integration FluentLenium and Arquillian is here https://github.com/papousek/arquillian-extension-fluentlenium
  • Mathilde Lemee (@MathildeLemee) posted: integrating FluentLenium to Arquillian Drone with @jan_papousek
  • John Smart (@wakaleo) posted: Awesome concentrated hacking session with @MathildeLemee: integrating #thucydides and FluentLenium in less than 10 lines of code.
  • Alex Soto (@alexsotob) posted: @majson Back home ty Arquillian guys for treat me as one of your team

Get Test-Infected at Devoxx 2012

It’s no suprise we’re obsessed with testing here in the Arquillian Galaxy. We’re eternally interested in sharpening our testing weapons, learning about tools that advance the frontline against the bugs, and discovering all the deep, dark code caves where bugs try to hide from testers.

This year, Devoxx, one of the premier Java developer conferences, is bringing together a large group of testing experts. Listed below are just some of the labs, workshops, and BOFs being presented at Devoxx that will enhance your bug hunting skills.

Monday, November 12, 2012

NoSQLUnit. Testing Your NoSQL Databases.

Alex Soto, Tools in Action

Unit tests should follow the FIRST rules (Fast, Isolated, Repeatable, Self-Validated and Timely). When persistence layer is under test, fast and isolated rules are the most violated. For relational database management systems, embedded databases and DbUnit framework exist to help us to not break them, but there is no like DBUnit framework for heterogeneous NoSQL systems. More »

Blast Your WebApp with Galting

Stephane Landelle and Romain Sertelon, Tools in Action

Your application is going live tomorrow, the new marketing campaign is about to start, you enjoy a margarita, life is good. Yet something keeps bugging you, are you sure your webapp won’t crash down? “Damn, forgot about the stress tests!” Traffic grows, data grows, our applications have to withstand increasing loads, so stress tests are more and more of a critical issue. More »

The Bugs Are Building Another Death Star

Multi-framework, battle hardened testers including members of Ike’s Crew, BOF

The bugs are building another Death Star. What’s our invasion plan?

Bugs don’t rest when you go to sleep. In fact, you should worry most when they are left alone. They are tireless creatures, hard at work to destroy your home. In software, it’s no different. We are at constant war with bugs. News flash, the bugs are building another Death Star and we’re just standing by! Let’s plot an invasion plan during this moderated discussion on the topic of enterprise testing. More »

Tuesday, November 13, 2012

To ATDD and Beyond! Better Automated Acceptance Testing on the JVM

John Smart, University

Test Driven Development is a game changer for developers, but Automated Acceptance Testing (ATDD) is a game changer for the whole team! More than just a testing technique, Automated Acceptance Testing is both a collaboration tool and a vital step on the road to Continuous Delivery. In this talk, you will see a real-world demo applying practical ATDD techniques to real-world projects using JBehave, Selenium 2 and Thucydides. More »

Testacular – Spectacular Test Runner for JavaScript

Vojta Jina, Tools in Action

Introduction to Testacular – test runner that makes makes testing JavaScript applications in real browsers frictionless and enjoyable. More »

JUnit Rules

Jens Schauder, Tools in Action

We all know JUnit rulez. But do you know JUnit Rules? Rules are a not so well known feature of JUnit. They allow us to encapsulate setup and teardown in a reusable package. You can manipulate the way tests get executed as well. More »

Wednesday, November 14, 2012

Testing Java Persistence Layer Done Right with Arquillian

Bartosz Majsak, Quickie

The Persistence Layer is one of the most crucial parts of enterprise applications, and we use many different frameworks and patterns to keep it clean. We write sophisticated queries and use optimization techniques to give our end users the greatest possible experience. So why is Persistence very often skipped in testing efforts? Is it really that complex and painful to setup? The Arquillian Persistence Extension removes that burden and boilerplate to make you a happy and productive programmer again. More »

Behaviour Driven Development on the JVM – A State of the Union

John Smart, Conference

Behavior Driven Development (BDD) is an increasingly popular variation on Test Driven Development, which helps developers think more about what they are testing, in terms of “executable specifications” rather than conventional tests. But there are dozens of BDD tools for the JVM out there: how do you know what to use, and when? More »

Thursday, November 15, 2012

Unitils: Full Stack Testing Solution for Enterprise Applications

Thomas De Rycke and Jeroen Horemans, Conference

Automated testing is the key to developing high quality software and maintainable codebases. How can we automate testing when data and database schemes are constantly evolving? How can we test infrastructure related components like automated e-mails without actually sending them? More »

Do You REST Assured?

Johan Haleby, Quickie

Today it’s easy to expose services as REST/HTTP with frameworks like Jersey and Spring but validating that the server actually behaves as expected can be cumbersome in Java. REST Assured is an open source Java DSL that allows you to avoid boiler-plate code to make requests and validate even complex responses in a simple manner. More »

JavaScript Unit Testing and Build Integration

Wouter Groeneveld, Conference

Unit testing has become very popular with the rise of test-first software development. Most enterprise applications contain only a small portion of javascript code, almost always completely untested. We have seen a steady increase of javascript code and frameworks lately, but for most people it’s still unclear how to (unit) test javascript, and most of all how to properly integrate these within your build environment next to other JUnit test cases. More »

Apache TomEE, Java EE 6 Web Profile on Tomcat

David Blevins, Conference

Apache TomEE is the Java EE 6 Web Profile certified version of Apache Tomcat and combines the simplicity of Tomcat with the power of Java EE. The first half of this session introduces TomEE and shows how Tomcat applications leveraging Java EE technologies can become simpler and lighter with a Java EE 6 certified solution built right on Tomcat. More »

Spock: Boldly Go Where No Test Has Gone Before

Andres Almiray, Quickie

Testing, testing, testing. We all know it has to be done but no one likes to do it. Enter Spock, a revolutionary way to writing (and thinking about) test code, that promises to wash away the pain and bring back the fun. More »

We look forword to hearing what testing tools, techniques and strategies you discover at Devoxx 2012.