Arquillian Universe 1.1.15.1 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.15.1 release of the Arquillian Universe component!

What is Arquillian Universe?

The Arquillian Universe BOM is a 'Bill of Material' Maven POM file collection that make up a module stack that stretch across the whole Arquillian Universe.

Release details

Component Arquillian Universe
Version 1.1.15.1 view tag
Release date 2017-12-18
Released by Bartosz Majsak
Compiled against

Published artifacts org.arquillian.universe

  • org.arquillian.universe » arquillian-core pom
  • org.arquillian.universe » arquillian-junit pom
  • org.arquillian.universe » arquillian-junit-standalone pom
  • org.arquillian.universe » arquillian-testng pom
  • org.arquillian.universe » arquillian-testng-standalone pom
  • org.arquillian » arquillian-universe pom
  • org.arquillian.universe » arquillian-drone pom
  • org.arquillian.universe » arquillian-graphene pom
  • org.arquillian.universe » arquillian-graphene-recorder pom
  • org.arquillian.universe » arquillian-warp pom
  • org.arquillian.universe » arquillian-warp-jsf pom
  • org.arquillian.universe » arquillian-transaction-core pom
  • org.arquillian.universe » arquillian-transaction-jta pom
  • org.arquillian.universe » arquillian-persistence-core pom
  • org.arquillian.universe » arquillian-persistence pom
  • org.arquillian.universe » arquillian-spring pom
  • org.arquillian.universe » arquillian-spring-transaction pom
  • org.arquillian.universe » arquillian-spring-persistence pom
  • org.arquillian.universe » arquillian-spring-warp pom
  • org.arquillian.universe » arquillian-governor-core pom
  • org.arquillian.universe » arquillian-governor-jira pom
  • org.arquillian.universe » arquillian-governor-github pom
  • org.arquillian.universe » arquillian-governor-redmine pom
  • org.arquillian.universe » arquillian-governor-skipper pom
  • org.arquillian.universe » arquillian-governor-ignore pom
  • org.arquillian.universe » arquillian-byteman pom
  • org.arquillian.universe » arquillian-jacoco pom
  • org.arquillian.universe » arquillian-recorder-api pom
  • org.arquillian.universe » arquillian-recorder pom
  • org.arquillian.universe » arquillian-rest-core pom
  • org.arquillian.universe » arquillian-rest-resteasy2 pom
  • org.arquillian.universe » arquillian-rest-resteasy3 pom
  • org.arquillian.universe » arquillian-rest-jaxrs2 pom
  • org.arquillian.universe » arquillian-rest-jersey pom
  • org.arquillian.universe » arquillian-rest-warp-core pom
  • org.arquillian.universe » arquillian-rest-warp-resteasy pom
  • org.arquillian.universe » arquillian-rest-warp-jaxrs2 pom
  • org.arquillian.universe » arquillian-rest-warp-jersey pom
  • org.arquillian.universe » arquillian-rest-warp-cxf pom
  • org.arquillian.universe » arquillian-spacelift pom
  • org.arquillian.universe » arquillian-chameleon pom
  • org.arquillian.universe » arquillian-cube-core pom
  • org.arquillian.universe » arquillian-cube-docker pom
  • org.arquillian.universe » arquillian-cube-openshift pom
  • org.arquillian.universe » arquillian-cube-containerless pom
  • org.arquillian.universe » arquillian-cube-kubernetes pom
  • org.arquillian.universe » arquillian-cube-docker-restassured pom
  • org.arquillian.universe » arquillian-cukes pom
  • org.arquillian.universe » arquillian-cube-q-pumba pom
  • org.arquillian.universe » arquillian-cube-q-simianarmy pom
  • org.arquillian.universe » arquillian-cube-q-toxic pom
  • org.arquillian.universe » arquillian-algeron-pact-consumer pom
  • org.arquillian.universe » arquillian-algeron-pact-provider pom
  • org.arquillian.universe » arquillian-algeron-git-publisher pom
  • org.arquillian.universe » arquillian-algeron-git-retriever pom
  • org.arquillian.universe » arquillian-algeron-maven-retriever pom
  • org.arquillian.universe » arquillian-algeron-pact-broker-retriever pom
  • org.arquillian.universe » arquillian-ape-nosql-mongodb pom
  • org.arquillian.universe » arquillian-ape-nosql-redis pom
  • org.arquillian.universe » arquillian-ape-nosql-couchbase pom
  • org.arquillian.universe » arquillian-ape-rest-postman pom
  • org.arquillian.universe » arquillian-ape-nosql-vault pom
  • org.arquillian.universe » arquillian-ape-sql-container-dbunit pom
  • org.arquillian.universe » arquillian-ape-sql-standalone-dbunit pom
  • org.arquillian.universe » arquillian-ape-sql-standalone-flyway pom
  • org.arquillian.universe » arquillian-ape-junit-rule pom
  • org.arquillian.universe » arquillian-rusheye pom
  • org.arquillian.universe » arquillian-test jar javadoc pom

Release notes and resolved issues 0

Thanks to the following list of contributors: Bartosz Majsak

Smart Testing 0.0.6 Released

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

The Arquillian team is proud to announce the 0.0.6 release of the Smart Testing component!

What is Smart Testing?

Smart Testing is a tool that speeds up the test running phase by reordering test execution plan to increase a probability of fail-fast execution and thus give you faster feedback about your project’s health.

Release details

Component Smart Testing
Version 0.0.6 view tag
Release date 2017-12-14
Released by Bartosz Majsak
Compiled against

Published artifacts org.arquillian.smart.testing

  • org.arquillian.smart.testing » core jar javadoc pom
  • org.arquillian.smart.testing » api jar javadoc pom
  • org.arquillian.smart.testing » surefire-provider jar javadoc pom
  • org.arquillian.smart.testing » junit-test-result-parser jar javadoc pom
  • org.arquillian.smart.testing » strategy-affected jar javadoc pom
  • org.arquillian.smart.testing » strategy-changed jar javadoc pom
  • org.arquillian.smart.testing » strategy-failed jar javadoc pom
  • org.arquillian.smart.testing » strategy-categorized jar javadoc pom
  • org.arquillian.smart.testing » maven-lifecycle-extension jar javadoc pom
  • org.arquillian.smart.testing » git-rules jar javadoc pom
  • org.arquillian.smart.testing » smart-testing-test-bed jar javadoc pom
  • org.arquillian.smart.testing » known-surefire-providers jar javadoc pom

Release notes and resolved issues 7

Component: Core
Priority: High
Component: Maven
Component: Selection

Thanks to the following list of contributors: Bartosz Majsak, Matous Jobanek, Dipak Pawar, Alex Soto

Arquillian Drone Extension 2.5.0 Released

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

The Arquillian team is proud to announce the 2.5.0 release of the Arquillian Drone Extension 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 Drone Extension
Version 2.5.0 view tag
Release date 2017-12-12
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-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
  • org.jboss.arquillian.extension » arquillian-drone-appium-extension jar javadoc pom

Release notes and resolved issues 6

Component Upgrade
  • ARQ-2159 - Update Arquillian core to 1.1.15.Final
  • ARQ-2160 - Upgrade to Selenium 3.8.0
  • ARQ-2161 - Update HtmlUnit driver to 2.28
  • ARQ-2167 - Upgrade to Selenium 3.8.1
Bug
  • ARQ-2154 - phantomjs download and extraction remains without effect if Maven is started in a parent or aggregator project
  • ARQ-2163 - SessionNotCreatedException when running PhantomJS as remotewebdriver with Selenium 3.8.0

Thanks to the following list of contributors: Matous Jobanek

End-To-End Integration Testing For Kubernetes and OpenShift

Does the title leave you wondering, why you need integration tests for your deployments ?

If so, let me give you a few examples. Consider you decide to upgrade Kubernetes, deploy a new Zapier
integration or add some authentication capability. In order to ensure your platform works every single
time, all of the above scenarios need to be tested with robust integration tests.

With the advent of microservices and cloud native applications, adding integration or
end-to-end tests to your Kubernetes or OpenShift projects might be challenging and cumbersome especially
when you want to set up the test infrastructure to be as close as possible to production.

Arquillian Community understands this pain, and continuously strive to provide users a seamless
experience for writing integration tests with ease by bringing their tests to the real environment and
deploy with confidence like never before.

With this blog post, we aim at showcasing integration tests for your Kubernetes or OpenShift clusters using just Arquillian Cube. Moving a step further, we also demonstrate building and deploying from scratch, applications with no deployment configuration, leveraging the power of Fabric8 Maven Plugin along with the Arquillian Cube Extension.

The key point here is that if OpenShift or Kubernetes is used as deployable platform in production, your tests are executed in a the same environment as it will be in production, so your tests are even more real than before.

Further, the test cases are meant to consume and test the provided services and assert that the environment is in the expected state.

Deployment Testing Recipes

If, you wish to read no more and see it all in action, head straight to our specially curated
examples to help you get started with ease.

Example 1

Deploying a sample PHP Guestbook application with Redis on Kubernetes from the resource descriptor
manifest file and testing it using Arquillian Cube Extension for Kubernetes and Kubernetes custom assertions.

Source: arquillian-testing-microservices/kubernetes-deployment-testing

Example 2

Deploying a Wordpress and My SQL application to OpenShift from a Template file and testing it using Arquillian
Cube Extension for OpenShift and Fabric8 OpenShift Client.

Source: arquillian-testing-microservices/openshift-deployment-testing

Example 3

Building and deploying a sample SpringBoot GuestBook application with zero deployment configuration using
Fabric8 Maven Plugin and Arquillian Cube Extension .

Fabric8 Maven Plugin aids in building Docker images and creating Kubernetes and OpenShift resource
descriptors for the application that allows for a quick ramp-up with some opinionated defaults and Arquillian
Cube Extension deploys the application from the generated resource descriptors and then executes deployment tests.

Source: arquillian-testing-microservices/zero-config-deployment-test

Step By Step Guide To Writing Deployment Tests

For a more in-depth step by step coverage of deployment testing, continue reading below.

Step 1: Setting Up Kubernetes/OpenShift Cluster

One of the pre-requisites for Arquillian Kube Extension, is to have Kubernetes or OpenShift cluster running on
your host machine.

An easy way to setup Kubernetes or OpenShift cluster locally is using Minikube and Minishift respectively.

Step 2: Adding Arquillian Kube Dependencies to your project

Arquillian Kube Extension provides a black box approach to testing your deployment that neither
mutates the containers (by deploying, reconfiguring etc) nor the Kubernetes/OpenShift resources.

It is used for immutable infrastructure and integration testing, wherein the test cases are meant to,
consume and test the provided services and assert that the environment is in the expected state,
providing you with the confidence that your application will work correctly when deployed on
Kubernetes/OpenShift cluster.

Before we can start writing our tests, we need to define a few dependencies as shown below:

Arquillian Cube BOM – Unified Dependencies

<properties>
    <version.arquillian_cube>${latest_released_version}</version.arquillian_cube>
</properties>

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

Arquillian Cube Requirement

Arquillian optionally provides an `ArquillianConditionalRunner` to control situations under which your tests should be executed by letting you specify the requirements using annotations.
For example, you can use annotations like `@RequiresOpenshift` to skip test when the environment is not prepared to run the tests.

To configure these requirements for your tests, enable the dependency to the following module for your project.

<dependency>
    <groupId>org.arquillian.cube</groupId>
    <artifactId>arquillian-cube-requirement</artifactId>
    <scope>test</scope>
</dependency>

Arquillian Cube Kubernetes (For Kubernetes Deployment)

<dependency>
    <groupId>org.arquillian.cube</groupId>
    <artifactId>arquillian-cube-kubernetes</artifactId>
    <scope>test</scope>
</dependency>

Arquillian Cube OpenShift (For OpenShift Deployment)

<dependency>
    <groupId>org.arquillian.cube</groupId>
    <artifactId>arquillian-cube-openshift</artifactId>
    <scope>test</scope>
</dependency>

Arquillian JUnit

<dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-standalone</artifactId>
    <version>${latest_released_version}</version>
    <scope>test</scope>
</dependency>

Fabric8 OpenShift Client

<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>openshift-client</artifactId>
    <version>${latest_released_version}</version>
</dependency>

For Fabric8 OpenShift Client, include the above dependency in the pom.xml

Step 3: Writing Deployment Tests

Arquillian Cube extension provides out of the box functionality to create and manage a temporary namespace
per test suite for your tests and then applies all the required kubernetes/openshift resources as defined
in the resource descriptors generated by fabric8 maven plugin for your environment.

Kubernetes/OpenShift resources can then be made accessible within the Test Cases by injecting them using
Arquillian’s @ArquillianResources annotation (see example test below).

@RunWith(Arquillian.class)    (1)
public class ExampleTest {

    @Named("dummy")           (2)
    @PortForward
    @ArquillianResource
    Service dummyService;

    @ArquillianResource       (3)
    OpenShiftClient client;

    @RouteURL("application")  (4)
    @AwaitRoute
    private URL route;

    @Test
    public void service_instance_should_not_be_null() throws Exception {
        assertThat(service).isNotNull();
    }

    @Test
    public void test_at_least_one_pod() throws Exception {
       assertThat(client).pods().runningStatus().filterNamespace(session.getNamespace()).hasSize(1); (5)
    }

    @Test
    public void verify_route_is_configured_and_service_is_accessible() throws IOException {
        assertThat(route).isNotNull();
        OkHttpClient okHttpClient = new OkHttpClient();
        Request request = new Request.Builder().get().url(route).build();
        Response response = okHttpClient.newCall(request).execute();

        assertThat(response).isNotNull();
        assertThat(response.code()).isEqualTo(200);
    }
}

Explained below are the steps for the above snippet of a sample deployment test.

  1. Configuring Arquillian Test Runner
    To setup our test environment, we need to tell junit that this test shall be executed as a arquillian junit
    test. This is done by @RunWith(Arquillian.class).
  2. Injecting Deployment Resources within Test Cases
    Kubernetes/OpenShift resources can then be made accessible within the Test Cases by injecting them
    using Arquillian’s @ArquillianResources annotation.
    The resource providers available, can be used to inject to your test cases the following resources:
    • A kubernetes client as an instance of KubernetesClient.
    • Session object that contains information (e.g. the namespace) or the uuid of the test session.
    • Services (by id or as a list of all services created during the session, optionally filtered by label)
    • Deployments (by id or as a list of all deployments created during the session, optionally filtered by label)
    • Pods (by id or as a list of all pods created during the session, optionally filtered by label)
    • Replication Controllers (by id or as a list of all replication controllers created during the session,
      optionally filtered by label)
    • Replica Sets (by id or as a list of all replica sets created during the session, optionally filtered by label)
  3. The OpenShift extension also provides:
    • An openshift client as an instance of OpenShiftClient.
    • Deployment Configs (by id or as a list of all deployment configs created during the session)
    • Resources can be injected into test cases by id or as a list of all deployments created during the
      session, optionally filtered by label.
  4. Injecting Container Resources to access the deployed service
    Test Enrichers like @RouteURL further aid in injection of container resources like route to the deployed service.
    For farbric8 maven plugin to identify the route, @RouteURL should be set to artifactId of the project by
    default, or explicity configured otherwise.
  5. Adding Test Cases that assert environment is in the expected state.

Step 4: Using Assertion Libraries

Optionally, using Fabric8 Kubernetes Assertions , a nice library based on assert4j, aids in performing
meaningful and expressive assertions on top of the Kubernetes/OpenShift model.

To enable Fabric8 Kubernetes Assertions in your test, include the following dependency in the pom.xml

<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>kubernetes-assertions</artifactId>
    <version>${latest_released_version}</version>
    <scope>test</scope>
</dependency>

Once everything is ready, Arquillian Kube runs your tests, enriched with resources required to access service
and finally cleaning up everything after the testing is over.

For more details and available configuration options check arquillian kube documentation.

Building Docker Images and creating Resource Descriptors.

Optionally, if you just have a Java application that you wish you to bring to Kubernetes or OpenShift,
use Fabric8 Maven Plugin to create docker images and resource descriptors for you.

Fabric8 Maven Plugin makes Kubernetes/OpenShift look and feel like an application server to a Java
developer by letting you build and deploy your application from maven just like you would with other
maven plugins.

To enable fabric8 on your existing maven project just type fabric8:setup command which adds the
fabric8-maven-plugin to your pom.xml.

Alternatively, you can manually add the following plugin definition to your pom.xml file:

<plugin>
    <groupId>io.fabric8</groupId>
    <artifactId>fabric8-maven-plugin</artifactId>
    <version>3.5.32</version>

    <!-- Connect fabric8:resource and fabric8:build to lifecycle phases -->
    <executions>
        <execution>
            <id>fmp</id>
            <phase>package</phase>
               <goals>
                    <goal>resource</goal>
                    <goal>build</goal>
                </goals>
        </execution>
    </executions>
</plugin>

For more and complete configuration details check out fabric8 maven plugin documentation.

Summary

With some basic features, simple steps and specially crafted examples as highlighted above, you can easily get started with Arquillian Cube extension to test your applications in real production environments, be it Kubernetes or OpenShift clusters, without worrying about setting up the infrastructure and only focusing on the core test logic.

Arquillian Cube Extension 1.10.0 Released

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

The Arquillian team is proud to announce the 1.10.0 release of the Arquillian Cube Extension component!

We are deligthed to announce a new version of Arquillian Cube 1.10.0 with new features and bug fixes.

In this new version of Arquillian Cube there has been major improvements in OpenShift:“https://www.openshift.com/” integration.

What’s new

[OpenShift] Add support for role binding and add roles to service accounts

If you are using OpenShift:“https://www.openshift.com/” you can use @AddRoleToServiceAccount and @RoleBinding annotations to bind roles for a test.

[OpenShift] Add support for setting templates with annotation

If you are using OpenShift:“https://www.openshift.com/”, you can set OpenShift templates location using an annotation (@Template) instead of a configuration parameter.

@Template(url = "https://gist.githubusercontent.com/lordofthejars/8781cacd4000a516695ad6c55b5815b3/raw/5151aeef0f5dd8823e2c581c3b7452f04a76af59/hello-template.yaml",
          parameters = @TemplateParameter(name = "RESPONSE", value = "Hello from Arquillian Template"))
public class HelloWorldTemplateTest {}

@Template accepts only any location in URL form. It is important to note that URL can contain references to system properties or environment variables by using ${systemproperty} in case of a system property or ${env.environmentvariable} in case of an environment variable.
You can add : after attribute name to provide a default value.

You can see full example at template project

[OpenShift] Add support for creating OpenShift Resources with annotation

If you are using OpenShift:“https://www.openshift.com/”, you can set any OpenShift resource to be executed either before test class or before test method. Notice that after test class/test method execution these resources are going to be deleted.

To set OpenShift resources you need to use @OpenShiftResource at class or method level.

@OpenShiftResource("classpath:hello-route.yaml")
public class HelloWorldOpenShiftResourcesTest {}

@OpenShiftResource value attribute can either be:

  • a link (https://www.github.com/alesj/template-testing/some.json)
  • a test classpath resource (classpath:some.json)
  • or plain content ({"kind" : "Secret", ...})

You can see full example at openshift resources project

[Docker/Kubernetes/OpenShift] Provides abstraction for executing CLI operations

You can instantiate CommandExecutor class to execute CLI operations directly from your test.
Usually, you use this class to execute commands directly from kubectl or oc tool.

private static CommandExecutor commandExecutor = new CommandExecutor();
final List<String> namespaces = commandExecutor.execCommand("kubectl get ns -o=name");

You can see full example at command executor project

[OpenShift] Provides a way to skip readiness await

Able to turn off readiness await to workaround Fabric8 Kubernetes Client issues such as https://github.com/fabric8io/kubernetes-client/issues/921

By default readiness await is always performed, but you can skip it by setting configuration parameter wait.enabled to false in arquillian.xml.

[Kubernetes/OpenShift] Namespace in annotation name

Now you can enrich a test with an element of another namespace different fromfa
the current one.

@ArquillianResource
@Named(value = "my-service", namespace = "my-predefined-namespace")
Service service;

[OpenShift] Provides an OpenShift assistant to deploy resources programmatically

Sometimes you need to decide when and what to deploy in OpenShift:“https://www.openshift.com/” cluster. Maybe you want to deploy something in one specific part of the test method and delete it in another part. For this reason a test can be enriched with OpenShiftAssistant to execute operations in current OpenShift cluster namespace in any part of the test.

@ArquillianResource
OpenShiftAssistant openShiftAssistant;

openShiftAssistant.deployApplication("hello-world", "hello-route.json");

final Optional<URL> route = openShiftAssistant.getRoute();
openShiftAssistant.awaitUrl(route.get());

You can see full example at OpenShift assistant project

What is Arquillian Cube Extension?

With Arquillian Cube you can control the lifecycle of Docker images as part of the test lifecyle, either automatically or manually. This gives you the chance to scale up from a integration/functional test level all the way up to the system test level.

Release details

Component Arquillian Cube Extension
Version 1.10.0 view tag
Release date 2017-12-08
Released by Alien Ike
Compiled against

Published artifacts org.arquillian.cube

  • org.arquillian.cube » arquillian-cube-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-spi jar javadoc pom
  • org.arquillian.cube » arquillian-cube-core jar javadoc pom
  • org.arquillian.cube » arquillian-cube-containerless jar javadoc pom
  • org.arquillian.cube » assertj-docker-java jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-drone jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-reporter jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-restassured jar javadoc pom
  • org.arquillian.cube » arquillian-cube-docker-junit-rule jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift-api jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift-shrinkwrap jar javadoc pom
  • org.arquillian.cube » arquillian-cube-openshift jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-fabric8 jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes jar javadoc pom
  • org.arquillian.cube » arquillian-cube-kubernetes-reporter jar javadoc pom
  • org.arquillian.cube » arquillian-cube-requirement jar javadoc pom
  • org.arquillian.cube » arquillian-cube-bom pom

Release notes and resolved issues 27

Other
Enhancement
Openshift
Train/ginger
Documentation

Thanks to the following list of contributors: Alex Soto, Dipak Pawar, Jonh Wendell, Bartosz Majsak, Strowk, Ladislav Thon, Hemani, Georg Wolf, Arquillian