How to setup Arquillian testing with Wildfly
Tech-Today

How to setup Arquillian testing with Wildfly


This tutorial requires:

Requirements:
  • Wildfly
  • eclipse
What to do:
  1. In eclipse create a new maven project: File->New->Other, enter maven in the filter. Select Maven Project.
  2. Click next, then next. In the filter enter "javaee". Select wildfly-javaee7-webapp-archetype.
  3. Click next, enter group and artifact id.
  4. Click finish. Your project should be created.
  5. Open arquillian.xml in src/test/resources. Uncomment configuration section and set the jbossHome property:
    <?xml version="1.0" encoding="UTF-8"?>
    <arquillian xmlns="http://jboss.org/schema/arquillian"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jboss.org/schema/arquillian
    http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <!-- Force the use of the Servlet 3.0 protocol with all containers, as it
    is the most mature -->
    <defaultProtocol type="Servlet 3.0" />

    <!-- Example configuration for a remote WildFly instance -->
    <container qualifier="wildfly" default="true">
    <!-- By default, arquillian will use the JBOSS_HOME environment variable.
    Alternatively, the configuration below can be uncommented. -->
    <configuration>
    <property name="jbossHome">C:\java\jboss\wildfly-10.1.0.Final</property>
    <!-- <property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=128m -->
    <!-- -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y -->
    <!-- </property> -->
    </configuration>
    </container>

    <engine>
    <property name="deploymentExportPath">target/deployments</property>
    </engine>

    </arquillian>
  6. Then in your terminal, go to your project directory and run:
    >mvn clean test -Parq-wildfly-managed
    >This run arquillian test using wildfly managed container.
It's actually a straightforward process. The tricky part is creating your test war. Open MemberRegistrationTest, to see what I mean. Sometimes it's useful to include an archive with all its dependencies than including one class at a time.




- Wildfly Server Provisioning Elastic Search Integration
I'm interested and would like to evaluate the integration of Elasticsearch to hibernate-search. I'm using the Wildfly container, however, Wildfly's hibernate-search library is a bit outdated: 5.5.8. so I need to find a way to outdate the jars...

- How To Integrate Querydsl In Your Javaee7 Project
This guide requires knowledge on: mavengiteclipsequerydslwild flyWe will show you how to modify the javaee7-archetype project to integrate querydsl. For those who do not know, it is a library to unify queries in java. What I like more about it is that...

- How To Run A Wildfly Server Inside Docker
Before we begin you must configure docker, I am using Ubuntu so I followed the guide here: https://docs.docker.com/engine/installation/linux/ubuntulinux/. Choose the appropriate OS that applies to you. Let's do this in sequence: Checkout and...

- Rest Testing With Arquillian In Jboss
This article will explain how we can automate REST web service testing using Arquillian and JBoss web server. First, you must create a javaee6 war (non-blank) project from jboss-javaee6 archetype. This should create a project with Member model, service,...

- Javaee Development
JavaEE6How to create a javaee6 web app using jboss maven war archetypeCreate a simple javaee6 web app with maven, glassfish and postgresqlHow to validate a JavaEE6 Bean in a jobHow to add JavaEE 6 archetypes in eclipse keplerHow to create a custom bean...



Tech-Today








.