Arquillian TestRunner Spock 1.0.0.Alpha2 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.Alpha2 release of the Arquillian TestRunner Spock component!

Some of the Highlights

This minor release of the intergalactic cooperation between Spock and Arquillian comes with the following updates:

  • Update to the latest stable version of Spock – 0.6
  • Update Arquillian Core to 1.0.1.Final

Smashing bugs has never been easier!

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 TestRunner Spock
Version 1.0.0.Alpha2 view tag
Release date 2012-07-23
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.spock

  • org.jboss.arquillian.spock » arquillian-spock-core jar javadoc pom
  • org.jboss.arquillian.spock » arquillian-spock-standalone jar javadoc pom
  • org.jboss.arquillian.spock » arquillian-spock-container jar javadoc pom

Release notes and resolved issues 4

Enhancement
  • ARQ-1041 - Update Spock to the lastest (0.6) version
Bug
  • ARQ-895 - Arquillian config-impl-base is not a part of spock-standalone
Task
  • ARQ-1039 - Update Spock Test Runner to 1.0.1.Final of Arquillian Core

Thanks to the following list of contributors: Bartosz Majsak, Aslak Knutsen, Dan Allen

Arquillian Spring Framework Extension 1.0.0.Alpha2 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.Alpha2 release of the Arquillian Spring Framework Extension component!

This release contain many improvements on the existing extension, but also some new features.

Some of the highlights in this release

Warp Spring MVC Extension
Spring Embedded Container
Separated the integration capabilities

Testing Spring MVC with Warp

Arquillian Warp is a powerful tool that let you run the functional tests against your web front end and at the same time verify the internal state of your application. With this release we are introducing the Warp extension for testing Spring MVC applications that run in a real servlet container.

Let’s dive into an example of how to test a Spring MVC application using Arquillian Warp. First we need to prepare the application descriptor.

web.xml
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">

    <servlet>
        <servlet-name>welcome</servlet-name>
        <servlet-class>org.jboss.arquillian.warp.extension.spring.servlet.WarpDispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>welcome</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>

</web-app>

You’ll notice that instead of using Spring’s DispatcherServlet we instead use the WarpDispatcherServlet.

And the testing code:

LoginControllerTestCase.java
@WarpTest
@RunWith(Arquillian.class)
public class LoginControllerTestCase {

    @Drone
    WebDriver browser;

    @ArquillianResource
    URL contextPath;

    @Test
    @RunAsClient
    public void testLoginValidationErrors() {
        browser.navigate().to(contextPath + "login.do");

        Warp.execute(new ClientAction() {

            @Override
            public void action() {

                browser.findElement(By.id("loginForm")).submit();
            }
        }).verify(new LoginControllerValidationErrorsVerification());
    }

    @Test
    @RunAsClient
    public void testLoginSuccess() {
        browser.navigate().to(contextPath + "login.do");
        browser.findElement(By.id("login")).sendKeys("warp");
        browser.findElement(By.id("password")).sendKeys("warp");

        Warp.execute(new ClientAction() {

            @Override
            public void action() {

                browser.findElement(By.id("loginForm")).submit();
            }
        }).verify(new LoginSuccessVerification());
    }

    public static class LoginControllerValidationErrorsVerification extends ServerAssertion {

            private static final long serialVersionUID = 1L;

            @SpringMvcResource
            private ModelAndView modelAndView;

            @SpringMvcResource
            private Errors errors;

            @AfterServlet
            public void testGetLogin() {

                assertEquals("login", modelAndView.getViewName());
                assertNotNull(modelAndView.getModel().get("userCredentials"));
                assertEquals("Two errors were expected.", 2, errors.getAllErrors().size());
                assertTrue("The login hasn't been validated.", errors.hasFieldErrors("login"));
                assertTrue("The password hasn't been validated.", errors.hasFieldErrors("password"));
            }
        }

    public static class LoginSuccessVerification extends ServerAssertion {

        private static final long serialVersionUID = 1L;

        @SpringMvcResource
        private ModelAndView modelAndView;

        @SpringMvcResource
        private Errors errors;

        @AfterServlet
        public void testGetLogin() {

            assertEquals("welcome", modelAndView.getViewName());
            assertFalse(errors.hasErrors());
        }
    }
}

In the above example we are using Arquillian Drone to navigate to the login page of our application and then filling in the login form with our user credentials.

The internal state of the DispatcherServlet is caught in a SpringMvcResult object which can be injected into the ServerAssertion. We can also inject other required objects like the ModelAndView.

Spring Embedded Container

Each development cycle may end in repeatedly re-running the integration tests, each time taking significant amount of time. The embedded container was thought to aid this situation. Running the tests embedded will decrease the execution time from seconds to milliseconds. It will help testing business objects, but since it’s not a full servlet container you won’t be able to use it for testing servlet requests in a web application.

Migrating from 1.0.0.Alpha1

1.0.0.Alpha2 comes with a couple significant changes from the previous version.

  • The Spring integration functionality has been separated out to its own module and is now part of the arquillian-service-integration-spring-inject module, and additional the arquillian-service-integration-spring-inject and the arquillian-service-integration-spring-javaconfig that does not target any specific Spring version, but rather provide functionality like XML or Java-based configuration.
  • The arquillian-service-deployer-spring module’s can still be used for autopackging the Spring artifacts.
  • The @SpringAnnotatedConfiguration has been renamed to @SpringAnnotationConfiguration.

Roadmap

The next release is planned to include Spring transaction support and will introduce even better Warp integration on the client side in order make REST testing even simpler.

We look forward to hearing your feedback about this release in the community forums!

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 Spring Framework Extension
Version 1.0.0.Alpha2 view tag
Release date 2012-07-21
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-common jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-2.5 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-deployer-spring-3 jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-container-spring jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-inject jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-javaconfig jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-2.5-int-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-service-integration-spring-3-int-tests jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-warp-spring jar javadoc pom

Release notes and resolved issues 5

Spring Embedded Container + Warp

Feature Request
  • ARQ-219 - Implement an embedded Spring container
  • ARQ-945 - Extract Spring Integration out of Spring Deployer
  • ARQ-978 - Provide Warp with extension for testing SpringMVC.
Task
  • ARQ-1019 - Spring Extension: Update the Arquiilian Core to 1.0.1

Thanks to the following list of contributors: Jakub Narloch, Aslak Knutsen

Arquillian Drone Extension 1.1.0.CR2 Released

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

The Arquillian team is proud to announce the 1.1.0.CR2 release of the Arquillian Drone Extension component!

Some of the Highlights in This Release

Drone 1.1.0.CR2 is a bugfix release form the previous 1.1.0 CR release. We fixed browserCapability usage, reusing browers sessions and Selenium Server user extensions support.

Big thanks to the community

I’d like to thank Arquillian Drone Community, especially Ste Gr and Simon Søndergaard for helping us test and patch the release by proactively using new features.
It’s a pleasure to work with you guys!

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 Drone Extension
Version 1.1.0.CR2 view tag
Release date 2012-07-18
Released by Lukas Fryc
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-drone-bom pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-configuration jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-server jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver jar javadoc pom

Release notes and resolved issues 6

Bug
  • ARQ-1021 - Internet Explorer could not be created from capabilities
  • ARQ-1022 - BrowserCapability overrides direct @Drone class type
  • ARQ-1023 - Selenium Server does not load user extensions
  • ARQ-1026 - Selenium session is not persisted to a file store when file does not exists
  • ARQ-1030 - Driving capabilities using arquillin.xml does not work
  • ARQ-1031 - Drone doesn't remove non-reusable sessions from the queue

Thanks to the following list of contributors: Karel Piwko, Lukas Fryc, Jan Papoušek, Simon Søndergaard

Arquillian Drone Extension 1.1.0.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.1.0.CR1 release of the Arquillian Drone Extension component!

Some of the Highlights in This Release

  • underlying Selenium upgraded to 2.24.1
  • support for Opera browser added
  • webdriver configuration improved
  • reusable session for RemoteWebDriver introduced

Configuration Improvement

Have you ever been stucked because you didn’t remember full qualified class name of the webdriver you wanted to use in your tests? Last Drone version required setting of implementationClass property and we should admit it wasn’t really comfortable. So we present a new property called browserCapabilities which can have the following values: android, chrome, firefox, htmlUnit, internetExplorer, iphone and opera. The values ​​correspond to the factory methods of DesiredCapabilities class.

We have also enabled webdriver configuration via Capabilities interface. Now you can use the configuration as you know it from documentation of each webdriver. Use capability prefix and camel case instead of dots in the property name to set the capability value.

So assume you want to use Firefox browser and specify the path to its binary file. We know webdriver.firefox.bin configuration property from FirefoxDriver documention.

arquillian.xml
<extension qualifier="webdriver">
    <property name="browserCapabilities">firefox</property>
    <property name="capabilityWebdriverFirefoxBin">/path/to/my/firefox/installation/firefox</property>
</extension>

Reusable Session for RemoteWebDriver

To increase your productivity in test development Drone presents a new feature to reuse session from previous test execution. Skip creating a new session to save your time. You can check the speed-up in the following table. The table contains time needed to run a test (including deployment on JBoss AS 7.1.1.Final).

Common Session Reusable Session
Firefox 3.98 ± 0.27 s 2.15 ± 0.15 s
Google Chrome 4.75 ± 0.03 s 2.57 ± 0.05 s

The feature requires standalone selenium server running, remoteReusable enabled and remoteAddress pointed to your selenium server.

<extension qualifier="webdriver">
    <property name="browserCapabilities">firefox</property>
    <property name="remoteReusable">true</property>
    <property name="remoteAddress">http://localhost:4444/wd/hub</property>
</extension>

Using the reusable session the browser stays open after the test completion, so all its settings are kept alive. If you need to debug your tests on the client side, you can easily prepare break points in the browser and run tests with remoteReusable flag.

After the proper configuration of reusable session RemoteWebDriver will be chosen automatically. That means you have to use compatible types in your test code (WebDriver ideally).

public void testMethod(@Drone WebDriver driver) {
    // test code
}

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 Drone Extension
Version 1.1.0.CR1 view tag
Release date 2012-06-27
Released by Lukas Fryc
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-drone-bom pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver-depchain pom
  • org.jboss.arquillian.extension » arquillian-drone-api jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-spi jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-configuration jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-impl jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium-server jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-selenium jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-webdriver jar javadoc pom

Release notes and resolved issues 6

Support for Reusable sessions

Feature Request
  • ARQ-847 - Support OperaDriver in Drone
  • ARQ-926 - Fast development turnaround using Selenium Server and RemoteWebDriver session reusal
  • ARQ-995 - Allow Arquillian Drone configuration to map java.util.Map for property values
Task
  • ARQ-868 - Update Selenium version to 2.24.1
  • ARQ-970 - Drone: Merge tests for reusable remote session
Sub-task
  • ARQ-927 - Configuration for RemoteWebDriver Drone extension

Thanks to the following list of contributors: Lukas Fryc, Jan Papoušek, Karel Piwko, Aslak Knutsen

Arquillian Extension Byteman 1.0.0.Alpha2 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.Alpha2 release of the Arquillian Extension Byteman 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 Extension Byteman
Version 1.0.0.Alpha2 view tag
Release date 2012-06-05
Released by Aslak Knutsen
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-extension-byteman jar javadoc pom

Release notes and resolved issues 2

Support for Client JVM instrumentation

Feature Request
  • ARQ-737 - Support Byteman Rules in client mode

Thanks to the following list of contributors: Aslak Knutsen