Skip to content

Commit

Permalink
added embedded arq testing
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-posta committed Oct 5, 2017
1 parent 0496357 commit 0f13d4c
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 2 deletions.
60 changes: 60 additions & 0 deletions backend-v2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<fabric8.maven.plugin.version>3.5.25</fabric8.maven.plugin.version>
<docker.image.name>ceposta/%a:%l</docker.image.name>
<ffj4.version>1.6.5</ffj4.version>
<version.org.wildfly.arquillian.container>2.0.0.Final</version.org.wildfly.arquillian.container>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -330,6 +331,65 @@
</build>
</profile>

<profile>
<!-- Embedded wildfly arquillian tests-->
<id>arq-wildfly</id>
<dependencies>
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-embedded</artifactId>
<version>${version.org.wildfly.arquillian.container}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>unpack</id>
<phase>process-test-classes</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-dist</artifactId>
<version>10.1.0.Final</version>
<type>zip</type>
<overWrite>false</overWrite>
<!-- putting under this subdir because this is where wildfly:run puts its dist-->
<outputDirectory>target/wildfly-run</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<!-- Fork every test because it will launch a separate AS instance -->
<forkMode>always</forkMode>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<!-- the maven dependency plugin will have already downloaded the server on /target -->
<jboss.home>${project.basedir}/target/wildfly-run/wildfly-10.1.0.Final</jboss.home>
<module.path>${project.basedir}/target/wildfly-run/wildfly-10.1.0.Final/modules</module.path>
</systemPropertyVariables>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
</configuration>
</plugin>
</plugins>
</build>
</profile>

<profile>
<!-- An optional Arquillian testing profile that executes tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.examples.ticketmonster.util;
package org.jboss.examples.ticketmonster.servlet;

import org.ff4j.web.embedded.ConsoleServlet;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;

import java.io.File;

public class TicketMonsterDeployment {

public static WebArchive deployment() {

File[] ff4jDeps = Maven.resolver().resolve("org.ff4j:ff4j-core:1.6.5")
.withTransitivity().asFile();
return ShrinkWrap
.create(WebArchive.class, "test.war")
.addPackage(Resources.class.getPackage())
.addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml")
.addAsResource("import.sql")
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
// Deploy our test datasource
.addAsWebInfResource("test-ds.xml");
.addAsWebInfResource("test-ds.xml")
.addAsLibraries(ff4jDeps)
.addAsResource("ff4j.xml")
;
}
}

0 comments on commit 0f13d4c

Please sign in to comment.