New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds example for new JUnit Rules #913

Merged
merged 2 commits into from Dec 21, 2017
Jump to file or symbol
Failed to load files and symbols.
+119 −1
Diff settings

Always

Just for now

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>arquillian-cube-docker-parent</artifactId>
<groupId>org.arquillian.cube</groupId>
<version>1.11.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>arquillian-cube-docker-junit-rules</artifactId>
<properties>
<docker.api.version>1.12</docker.api.version>
<docker.api.url>tcp://localhost:2375</docker.api.url>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-standalone</artifactId>
<scope>test</scope>
<version>${version.arquillian_core}</version>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-docker</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.arquillian.cube</groupId>
<artifactId>arquillian-cube-requirement</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,42 @@
package org.arquillian.cube;
import org.jboss.arquillian.junit.ArquillianTest;
import org.jboss.arquillian.junit.ArquillianTestClass;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.arquillian.test.api.ArquillianResource;
import org.junit.Assert;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
public class StandaloneJUnitRulesTestCase {
@ClassRule
public static ArquillianTestClass arquillianTestClass = new ArquillianTestClass();
@Rule
public ArquillianTest arquillianTest = new ArquillianTest();
private static final String CONTAINER = "database";
@ArquillianResource
private CubeController cc;
@Test
@InSequence(0)
public void shouldBeAbleToInjectController() {
Assert.assertNotNull(cc);
}
@Test @InSequence(1)
public void shouldBeAbleToCreateAndStart() {
cc.create(CONTAINER);
cc.start(CONTAINER);
}
@Test @InSequence(2)
public void shouldBeAbleToStopAndDestroy() {
cc.stop(CONTAINER);
cc.destroy(CONTAINER);
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<extension qualifier="docker">
<property name="autoStartContainers">[none]</property>
<property name="definitionFormat">CUBE</property>
<property name="dockerContainers">
database:
image: zhilvis/h2-db
exposedPorts: [81/tcp, 1521/tcp]
await:
strategy: polling
portBindings: [1521/tcp, 8181->81/tcp]
</property>
</extension>
</arquillian>
View
@@ -60,6 +60,7 @@
<module>ftest-docker-compose-v2-git-context</module>
<module>ftest-docker-junit-rule</module>
<module>ftest-system-properties</module>
<module>ftest-junit-rules</module>
</modules>
</project>
View
@@ -63,7 +63,7 @@
</issueManagement>
<properties>
<version.arquillian_core>1.1.15.Final</version.arquillian_core>
<version.arquillian_core>1.2.0.Final</version.arquillian_core>
<version.junit>4.12</version.junit>
<version.hamcrest>1.3</version.hamcrest>
<version.docker-java>3.0.14</version.docker-java>
ProTip! Use n and p to navigate between commits in a pull request.