Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6393b52
commit b8d2ae3
Showing
36 changed files
with
1,792 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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-container-chameleon-runner-parent</artifactId> | ||
<groupId>org.arquillian.container</groupId> | ||
<version>1.0.0.Final-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>arquillian-container-chameleon-runner-api</artifactId> | ||
|
||
<name>Arquillian Container Chameleon Runner API</name> | ||
</project> |
82 changes: 82 additions & 0 deletions
82
...leon-runner/api/src/main/java/org/arquillian/container/chameleon/api/ChameleonTarget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package org.arquillian.container.chameleon.api; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import java.util.Map; | ||
|
||
/** | ||
* {@code ChameleonTarget} is used to configure Chameleon container, but using an annotation instead of arquillian.xml. | ||
* | ||
* The annotation can be used as meta-annotation of other annotations recursively. For example: | ||
* | ||
* <pre> | ||
* {@code | ||
* @Target({ ElementType.TYPE}) | ||
* @Retention(RetentionPolicy.RUNTIME) | ||
* @Documented | ||
* @Inherited | ||
* @Tomcat | ||
* @ChameleonTarget(version = "8.0.0") | ||
* public @interface Tomcat8 { | ||
* } | ||
* </pre> | ||
* | ||
* might inherit properties set from {@code Tomcat} annotation and override the version field with the one specified. | ||
* | ||
* And {@code Tomcat} annotation looks like: | ||
* | ||
* <pre> | ||
* {@code | ||
* @Target({ ElementType.TYPE}) | ||
* @Retention(RetentionPolicy.RUNTIME) | ||
* @Documented | ||
* @Inherited | ||
* @ChameleonTarget("tomcat:7.0.0:managed") | ||
* public @interface Tomcat { | ||
* } | ||
* </pre> | ||
* | ||
* All fields accept expressions like ${property:defaultValue} where {@code property} is first resolved as environment variable, | ||
* if not set as system property and if not the default value is used. | ||
* | ||
*/ | ||
@Target({ ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@Inherited | ||
public @interface ChameleonTarget { | ||
|
||
/** | ||
* Sets Chameleon Target with form container:version:mode. For example: wildfly:9.0.0:manged. | ||
* @return Chameleon Target | ||
*/ | ||
String value() default ""; | ||
|
||
/** | ||
* If {@code value} is not use, this property sets the container field. | ||
* @return Container. | ||
*/ | ||
String container() default ""; | ||
|
||
/** | ||
* If {@code value} is not use, this property sets the version field. | ||
* @return Version. | ||
*/ | ||
String version() default ""; | ||
|
||
/** | ||
* If {@code value} is not use, this property sets the mode field. | ||
* @return Mode. | ||
*/ | ||
String mode() default "managed"; | ||
|
||
/** | ||
* Sets custom properties for container definition. | ||
* @return Custom Properties. | ||
*/ | ||
Property[] customProperties() default {}; | ||
} |
19 changes: 19 additions & 0 deletions
19
...llian-chameleon-runner/api/src/main/java/org/arquillian/container/chameleon/api/Mode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.arquillian.container.chameleon.api; | ||
|
||
public enum Mode { | ||
|
||
EMBEDDED("embedded"), | ||
MANAGED("managed"), | ||
REMOTE("remote"); | ||
|
||
private String mode; | ||
|
||
Mode(String mode) { | ||
this.mode = mode; | ||
} | ||
|
||
public String mode() { | ||
return this.mode; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...n-chameleon-runner/api/src/main/java/org/arquillian/container/chameleon/api/Property.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.arquillian.container.chameleon.api; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({}) | ||
public @interface Property { | ||
|
||
String name(); | ||
String value(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?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-container-chameleon-runner-parent</artifactId> | ||
<groupId>org.arquillian.container</groupId> | ||
<version>1.0.0.Final-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>arquillian-container-chameleon-runner-ftest</artifactId> | ||
|
||
<name>Arquillian Container Chameleon Runner Functional Test</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.arquillian.container</groupId> | ||
<artifactId>arquillian-container-chameleon</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.arquillian.container</groupId> | ||
<artifactId>arquillian-container-chameleon-runner</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.arquillian.junit</groupId> | ||
<artifactId>arquillian-junit-container</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-api</artifactId> | ||
<version>7.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> | ||
|
10 changes: 10 additions & 0 deletions
10
...meleon-runner/ftest/src/main/java/org/arquillian/container/chameleon/GreetingService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.arquillian.container.chameleon; | ||
|
||
import javax.enterprise.context.RequestScoped; | ||
|
||
@RequestScoped | ||
public class GreetingService { | ||
public String greet(String who) { | ||
return "Hello, " + who + "!"; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...on-runner/ftest/src/test/java/org/arquillian/container/chameleon/GreetingServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.arquillian.container.chameleon; | ||
|
||
import javax.inject.Inject; | ||
import org.arquillian.container.chameleon.runner.ArquillianChameleon; | ||
import org.jboss.arquillian.container.test.api.Deployment; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.WebArchive; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.hamcrest.CoreMatchers.notNullValue; | ||
import static org.junit.Assert.assertThat; | ||
|
||
@Wildfly | ||
@RunWith(ArquillianChameleon.class) | ||
public class GreetingServiceTest { | ||
|
||
@Deployment | ||
public static WebArchive deployService() { | ||
return ShrinkWrap.create(WebArchive.class) | ||
.addClass(GreetingService.class); | ||
} | ||
|
||
@Inject | ||
private GreetingService service; | ||
|
||
@Test | ||
public void should_get_greetings() { | ||
assertThat(service, is(notNullValue())); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...lian-chameleon-runner/ftest/src/test/java/org/arquillian/container/chameleon/Wildfly.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.arquillian.container.chameleon; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
import org.arquillian.container.chameleon.api.ChameleonTarget; | ||
|
||
@Target({ ElementType.TYPE}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
@Inherited | ||
@ChameleonTarget("wildfly:9.0.0.Final:managed") | ||
public @interface Wildfly { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?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-container-chameleon-parent</artifactId> | ||
<groupId>org.arquillian.container</groupId> | ||
<version>1.0.0.Final-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>arquillian-container-chameleon-runner-parent</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
|
||
<name>Arquillian Container Chameleon Runner Parent</name> | ||
|
||
<modules> | ||
<module>runner</module> | ||
<module>api</module> | ||
<module>ftest</module> | ||
</modules> | ||
|
||
</project> |
Oops, something went wrong.