Arquillian Algeron Extension 1.0.0.Alpha1 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.Alpha1 release of the Arquillian Algeron Extension component!

Important note: This extension was called Arquillian Pact before version 1.0.0.Alpha5, so you should use this name when pulling dependencies from Maven Central.

This is the first release of Arquillian Pact. This extension provides an integration between Arquillian and Pact.

Pact is a framework that provides support for Consumer Driven Contracts testing. You can read more about Consumer Driven Contracts in this interesting blog post or in our upcoming book Testing Java Microservices.

Full documentation of the project can be found at http://arquillian.org/arquillian-algeron/

Consumer

First thing to do is to develop the Consumer part of the test. Consumer part of Consumer-Driven Contract defines requirements from the consumer of the API which are then used to develop the client interaction with the API as well as to validate provider implementation.

Dependencies

<dependencies>
    <dependency>
        <groupId>org.arquillian.pact</groupId>
        <artifactId>arquillian-pact-consumer-core</artifactId>
        <version>${version.arquillian_pact}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>au.com.dius</groupId>
        <artifactId>pact-jvm-consumer_2.11</artifactId>
        <scope>test</scope>
        <version>3.5.0-beta.1</version>
    </dependency>
</dependencies>

Test

@RunWith(Arquillian.class)
public class ClientGatewayTest {

    @Deployment
    public static JavaArchive createDeployment() {
        return ShrinkWrap.create(JavaArchive.class).addClasses(ClientGateway.class);
    }

    @Pact(provider="test_provider", consumer="test_consumer")
    public PactFragment createFragment(PactDslWithProvider builder) {

        Map<String, String> header = new HashMap<>();
        header.put("Content-Type", "application/json");

        return builder
                .given("test state")
                .uponReceiving("ConsumerTest test interaction")
                .path("/")
                .method("GET")
                .willRespondWith()
                .status(200)
                .headers(header)
                .body("{\"responsetest\": true, \"name\": \"harry\"}")
                .toFragment(); (4)
    }

    @EJB
    ClientGateway clientGateway;
    
    @Test 
    @PactVerification("test_provider")
    public void should_return_message() throws IOException {
        assertThat(clientGateway.getMessage(), is("{\"responsetest\": true, \"name\": \"harry\"}"));
    }
}

You can see more examples in the GitHub repository.

Provider

The next thing you need to do is share the contract (aka “pact” file) with Provider project and validate that provider produces the expected responses to defined requests. This is done by replaying all requests defined in contract against real provider and validating that the response is the expected one.

We currently support following locations of the contracts:

  • an arbitrary URL
  • Pact Broker – repository of the contracts
  • local directory

Dependencies

<dependency>
    <groupId>org.arquillian.pact</groupId>
    <artifactId>arquillian-pact-provider-core</artifactId>
    <scope>test</scope>
    <version>${version.arquillian_pact}</version>
</dependency>
<dependency>
    <groupId>au.com.dius</groupId>
    <artifactId>pact-jvm-provider_2.11</artifactId>
    <scope>test</scope>
    <version>3.5.0-beta.1</version>
</dependency>

Test

@RunWith(Arquillian.class)
@Provider("test_provider")
@PactFolder("pacts")
public class MyServiceProviderTest {

    @Deployment(testable = false)
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class).addClass(MyService.class);
    }

    @CurrentConsumer
    Consumer consumer;

    @CurrentInteraction
    RequestResponseInteraction interaction;

    @ArquillianResource
    URL webapp;

    @ArquillianResource
    Target target;

    @Test
    public void should_provide_valid_answers() {
        target.testInteraction(webapp, consumer.getName(), interaction);
    }

}

You can see full example in our GitHub repository.

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 Algeron Extension
Version 1.0.0.Alpha1 view tag
Release date 2016-09-21
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.pact

  • org.arquillian.pact » arquillian-pact-consumer-api jar javadoc pom
  • org.arquillian.pact » arquillian-pact-consumer-core jar javadoc pom
  • org.arquillian.pact » arquillian-pact-consumer-spi jar javadoc pom
  • org.arquillian.pact » arquillian-pact-provider-api jar javadoc pom
  • org.arquillian.pact » arquillian-pact-provider-core jar javadoc pom
  • org.arquillian.pact » arquillian-pact-provider-spi jar javadoc pom
  • org.arquillian.pact » arquillian-pact-provider-pact-broker-loader jar javadoc pom

Thanks to the following list of contributors: Alex Soto

Arquillian Governor 1.0.4.Final Released

The Arquillian team is proud to announce the 1.0.4.Final release of the Arquillian Governor component!

Arquillian Recorder integration with Arquillian Governor

In this release we are providing Arquillian Recorder integration with JIRA, GitHub and Redmine Governor.

Arquillian Recorder project brings neat reports for your Arquillian tests. Arquillian Governor Extension gives you the possibility to programmatically choose what test methods of your Arquillian tests are going to be executed and what are going to be skipped by putting your custom annotations on the test methods.

We are providing an integration of Recorder with Governor so that generated tests reports contains all relevant information used by Governor.

Let’s see it in action for Arquillian JIRA Governor:

@RunWith(Arquillian.class)
public class TestCase {
    
    @Test
    @Jira("ARQ-5000", force = true)
    public void run_test_without_relying_on_the_issue_status() {
        // ...
    }

    @Test
    @Jira(value = "ARQ-1000", detector = @Detector(Windows.class))
    public void run_only_if_issue_is_closed_and_windows_is_used() {
        // ...
    }
}

Let’s break this test down to see what is going on under the hood.

  • First test will run disregard of the issue status. This is useful when you work on a particular task and don’t want Governor to skip its execution. Using force = true will make it happen.
  • Second test will only be executed if issue ARQ-1000 is closed and the test is executed in Windows environment. Second aspect is handled by the @Detector mechanism.
  • At the end Reporter will generate a report with all relevant information including links between tests and issues, environment specific tests etc.

To decide what tests should be executed using JIRA issues, include following dependency:

<dependency>
    <groupId>org.arquillian.extension</groupId>
    <artifactId>arquillian-governor-jira</artifactId>
    <version>${version.jira.governor}</version>
    <scope>test</scope>
</dependency>

In the same way, if you want to use GitHub issues:

<dependency>
    <groupId>org.arquillian.extension</groupId>
    <artifactId>arquillian-governor-github</artifactId>
    <version>${version.github.governor}</version>
    <scope>test</scope>
</dependency>

And last but not least, to use Redmine governor:

<dependency>
    <groupId>org.arquillian.extension</groupId>
    <artifactId>arquillian-governor-redmine</artifactId>
    <version>${version.redmine.governor}</version>
    <scope>test</scope>
</dependency>

And to have it all covered with reports, add this dependency:

<dependency>
  <groupId>org.arquillian.extension</groupId>
  <artifactId>arquillian-recorder-reporter-impl</artifactId>
  <version>${version.arquillian.recorder}</version>
  <scope>test</scope>
</dependency>

You can read more about Arquillian Recorder integration with Jira Governor in the Arquillian Recorder Integration Section with Jira, GitHub Governor in the Arquillian Recorder Integration section with GitHub, Redmine Governor in the Arquillian Recorder Integration section with Redmine.

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 Governor
Version 1.0.4.Final view tag
Release date 2016-09-27
Released by Bartosz Majsak
Compiled against

Published artifacts org.arquillian.extension

  • org.arquillian.extension » arquillian-governor-spi jar javadoc pom
  • org.arquillian.extension » arquillian-governor-api jar javadoc pom
  • org.arquillian.extension » arquillian-governor jar javadoc pom
  • org.arquillian.extension » arquillian-governor-jira jar javadoc pom
  • org.arquillian.extension » arquillian-governor-skipper jar javadoc pom
  • org.arquillian.extension » arquillian-governor-github jar javadoc pom
  • org.arquillian.extension » arquillian-governor-redmine jar javadoc pom
  • org.arquillian.extension » arquillian-governor-ignore jar javadoc pom

Release notes and resolved issues 1

Other

Thanks to the following list of contributors: Bartosz Majsak, Dipak Pawar

Arquillian Recorder 1.1.4.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.1.4.Final release of the Arquillian Recorder 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 Recorder
Version 1.1.4.Final view tag
Release date 2016-09-20
Released by Alex Soto
Compiled against

Published artifacts org.arquillian.extension

  • org.arquillian.extension » arquillian-recorder-api jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-spi jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-reporter-api jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-reporter-spi jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-reporter-impl jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-screenshooter-api jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-screenshooter-spi jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-screenshooter-impl-base jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-video-api jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-video-spi jar javadoc pom
  • org.arquillian.extension » arquillian-recorder-video-impl-base jar javadoc pom
  • org.arquillian.extension » arquillian-desktop-video-recorder jar javadoc pom

Thanks to the following list of contributors: Alex Soto, Dipak Pawar, Stefan Miklosovic, Tim Peeters

Arquillian Drone Extension 2.0.1.Final Released

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

The Arquillian team is proud to announce the 2.0.1.Final release of the Arquillian Drone Extension component!

Chrome options

This release brings you a possibility to set chrome options for a chromeDriver through your arquillian.xml file. You can find all possible options that can be set on this web page.
The process of setting options uses a ChromeOptions class which means that the parameter names (used in arquillian.xml) are tightly coupled with the names of the set/add methods defined in the class. It is expected that the name of each parameter consists of:

“chrome” + (name of the set/add method of ChromeOption class without first three chars)
the whole string should be in camel case. For example, in case of an option args which is coupled with the method addArguments, the parameter should look like this:
<property name=chromeArguments>--first-argument --second-argument</property>

Please notice that there are two methods named addArguments in the ChromeOptions class, one with a parameter which is a list of strings and second one with an array of strings – Drone treats them as a one single method (for other methods it is applied analogically).

Value formats

  • In the cases, when the value can be an array or list of strings/files, you should specify all of them in one string separated by space (this is also applied for extensions as well as for encoded extensions).
  • It is a little bit different in the case of experimental options. These options should be provided as set of key-value pairs, so we decided to use JSON format for it (can be in multiline format) – for example:
    <property name=chromeExperimentalOption>
    {
      "perfLoggingPrefs": {
        "traceCategories": ",blink.console,disabled-by-default-devtools.timeline,benchmark"
      },
      "prefs": {
        "download.default_directory": "/usr/local/path/to/download/directory"
      }
    }
    </property>

Debug

If you struggle with passing required chrome options through the arquillian.xml file, you can use a parameter chromePrintOptions with a value true:

<property name=chromePrintOptions>true</property>
This ensures that Drone prints out the whole content of ChromeOptions in a JSON format to the standard output.

Firefox 48

Since Mozilla has changed the internals of Firefox we strongly recommend to use new geckodriver, as the community one is not compatible anymore. This applies for to all Firefox versions starting from 48. The gecko drivers can be downloaded here.

This Drone release partially supports these changes. By partially we mean you haved to download the geckodriver manually and specify a path to the driver using a parameter firefoxDriverBinary there in your arquillian.xml file:

<property name=firefoxDriverBinary>/path/to/your/driver/binary</property>
Apart from this configuration, you also need to have Selenium 3 on your classpath – see below for detailed instructions.

Selenium version

As this release of Drone is a minor release and the latest Selenium release is in beta version, we decided stick to supported release in this version. In other words, Selenium 3 dependency is not automatically fetched by Drone 2.0.1.Final (the default one is still 2.53.1).

If you need to use the latest version of Selenium (for example together with geckodriver – see above), then the easiest way is specifying selenium-bom dependency in a dependencyManagement part of your pom.xml file:

pom.xml
 <!-- clip -->
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian.selenium</groupId>
            <artifactId>selenium-bom</artifactId>
            <version>3.0.0-beta3</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>
<!-- clip -->

IMPORTANT: If you also use the arquillian-drone-bom (or other BOMs), make sure that the selenium-bom is placed before other BOMs – to make the change effective.

The full support of Selenium 3 and geckodriver will be provided in the next release of Drone (2.1.0.Alpha1), so stay tuned.

We hope that you’ll enjoy our new stuff and look forward to hear your feedback.

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 2.0.1.Final view tag
Release date 2016-09-14
Released by Matous Jobanek
Compiled against

Published artifacts org.jboss.arquillian.extension

  • org.jboss.arquillian.extension » arquillian-drone-bom 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-webdriver jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-saucelabs-extension jar javadoc pom
  • org.jboss.arquillian.extension » arquillian-drone-browserstack-extension jar javadoc pom

Release notes and resolved issues 4

Component Upgrade
Feature Request
  • ARQ-2037 - Support additional browser capabilities for Chrome
  • ARQ-2044 - Expose logic that creates browser capabilities
  • ARQ-2045 - Add possibility to define firefox driver binary to support FF48

Thanks to the following list of contributors: Matous Jobanek

Arquillian Extension Byteman 1.0.0.Alpha4 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.Alpha4 release of the Arquillian Extension Byteman component!

We’re happy to announce fourth release of the Arquillian Byteman.

Byteman is a tool which simplifies tracing and testing of Java programs. Byteman allows you to insert extra Java code into your application, either as it is loaded during JVM startup or even after it has already started running. The injected code is allowed to access any of your data and call any application methods, including where they are private. You can inject code almost anywhere you want and there is no need to prepare the original source code in advance nor do you have to recompile, repackage or redeploy your application. In fact you can remove injected code and reinstall different code while the application continues to execute.

When testing your application you can use Byteman to inject faults or synchronization code, causing your application to perform unusual or unexpected operations required to exercise a test scenario.

In this release we brought several improvements:

  • Updated extension to use latest version of Byteman as well as Arquillian Core.
  • Fixed an issue with Submit command when agent is already running.
  • Improved test suite using Arquillian Chameleon to test it against several different containers (such as different WildFly versions).

See the Byteman Website for more on how to write rules.

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.Alpha4 view tag
Release date 2016-09-01
Released by Bartosz Majsak
Compiled against

Published artifacts org.jboss.arquillian.extension

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

Thanks to the following list of contributors: Bartosz Majsak, Dipak Pawar, Tolis Emmanouilidis, Aslak Knutsen, Ales Justin