Skip to content

Commit e6200f8

Browse files
authored
Merge pull request javaee-samples#354 from arjantijms/master
Updated TomEE and GlassFish versions and added "managed-embedded" Liberty
2 parents 93b0df1 + 9efdf0e commit e6200f8

4 files changed

Lines changed: 144 additions & 6 deletions

File tree

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ This workspace consists of Java EE 7 Samples and unit tests. They are categorize
44

55
Some samples/tests have documentation otherwise read the code. The [Java EE 7 Essentials](http://www.amazon.com/Java-EE-Essentials-Arun-Gupta/dp/1449370179/) book refer to most these samples and provide an explanation. Feel free to add docs and send a pull request.
66

7-
## How to run ? ##
7+
## How to run? ##
88

99
Samples are tested on Wildfly and GlassFish using the Arquillian ecosystem.
1010

1111
A brief instruction how to clone, build, import and run the samples on your local machine @radcortez provides in this sample video https://www.youtube.com/watch?v=BB4b-Yz9cF0
1212

1313
Only one container profile and one profile for browser can be active at a given time otherwise there will be dependency conflicts.
1414

15-
There are 8 available container profiles, for 5 different servers:
15+
There are 9 available container profiles, for 5 different servers:
1616

1717
* ``wildfly-managed-arquillian``
1818

@@ -99,6 +99,12 @@ There are 8 available container profiles, for 5 different servers:
9999
<group name="architect"/>
100100
</basicRegistry>
101101
```
102+
103+
* ``liberty-embedded-arquillian``
104+
105+
This profile will download and install a Liberty server and start up the server per sample.
106+
Useful for CI servers. Note, this is not a real embedded server, but a regular server. It's now
107+
called "embedded" because no separate install is needed as it's downloaded automatically.
102108

103109
* ``weblogic-remote-arquillian``
104110

@@ -125,7 +131,7 @@ Some of the containers allow you to override the version used
125131

126132
* `-Dglassfish.version=4.1`
127133

128-
This will change the version from 4.0 to 4.1 for GlassFish testing purposes.
134+
This will change the version from 4.1.1 to 4.1 for GlassFish testing purposes.
129135

130136
Similarly, there are 6 profiles to choose a browser to test on:
131137

@@ -156,14 +162,21 @@ Similarly, there are 6 profiles to choose a browser to test on:
156162
To run tests on headless browser PhantomJS. If you do not specify the path of phantomjs binary via
157163
``-Dphantomjs.binary.path`` property, it will be downloaded automatically.
158164

159-
To run them in the console do:
165+
**To run them in the console do**:
160166

161167
1. In the terminal, ``mvn -Pwildfly-managed-arquillian,browser-firefox test`` at the top-level directory to start the tests
162168

163169
When developing and runing them from IDE, remember to activate the profile before running the test.
164170

165171
To learn more about Arquillian please refer to the [Arquillian Guides](http://arquillian.org/guides/)
166172

173+
**To run only a subset of the tests do at the top-level directory**:
174+
175+
1. Install top level dependencies: ``mvn clean install -pl "test-utils,util" -am``
176+
1. cd into desired module, e.g.: ``cd jaspic``
177+
1. Run tests against desired server, e.g.: ``mvn clean test -P liberty-embedded-arquillian``
178+
179+
167180
## How to contribute ##
168181

169182
With your help we can improve this set of samples, learn from each other and grow the community full of passionate people who care about the technology, innovation and code quality. Every contribution matters!

pom.xml

Lines changed: 84 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@
3939
<plugin.enforcer.version>1.3.1</plugin.enforcer.version>
4040
<maven.test.skip>false</maven.test.skip>
4141
<hamcrest.version>1.3</hamcrest.version>
42-
<glassfish.version>4.0</glassfish.version>
42+
<glassfish.version>4.1.1</glassfish.version>
43+
<liberty.version>16.0.0.2</liberty.version>
4344

4445
<!--
4546
TomEE version that's installed and used when selecting the
4647
tomee-managed-arquillian profile. Has to be made available
4748
locally when set to version not available in Maven central.
4849
See README.md for details.
4950
-->
50-
<tomee.version>7.0.0</tomee.version>
51+
<tomee.version>7.0.1</tomee.version>
5152
</properties>
5253

5354
<modules>
@@ -901,6 +902,87 @@
901902
</build>
902903
</profile>
903904

905+
906+
<profile>
907+
<id>liberty-embedded-arquillian</id>
908+
909+
<dependencies>
910+
<dependency>
911+
<groupId>org.jboss.arquillian.container</groupId>
912+
<artifactId>arquillian-wlp-managed-8.5</artifactId>
913+
<version>1.0.0.Beta2</version>
914+
<scope>test</scope>
915+
</dependency>
916+
</dependencies>
917+
918+
<build>
919+
<plugins>
920+
<plugin>
921+
<groupId>org.apache.maven.plugins</groupId>
922+
<artifactId>maven-dependency-plugin</artifactId>
923+
<executions>
924+
<execution>
925+
<id>unpack</id>
926+
<phase>process-test-classes</phase>
927+
<goals>
928+
<goal>unpack</goal>
929+
</goals>
930+
<configuration>
931+
<artifactItems>
932+
<artifactItem>
933+
<groupId>com.ibm.websphere.appserver.runtime</groupId>
934+
<artifactId>wlp-javaee7</artifactId>
935+
<version>${liberty.version}</version>
936+
<type>zip</type>
937+
<overWrite>false</overWrite>
938+
<outputDirectory>${project.build.directory}</outputDirectory>
939+
</artifactItem>
940+
</artifactItems>
941+
</configuration>
942+
</execution>
943+
</executions>
944+
</plugin>
945+
<plugin>
946+
<groupId>org.apache.maven.plugins</groupId>
947+
<artifactId>maven-antrun-plugin</artifactId>
948+
<version>1.1</version>
949+
<executions>
950+
<execution>
951+
<phase>process-test-classes</phase>
952+
<goals>
953+
<goal>run</goal>
954+
</goals>
955+
<configuration>
956+
<tasks>
957+
<!-- TODO: There has to be a better way. Look at
958+
PR for Liberty arquillian container to modify server.xml?
959+
-->
960+
<echo>Copying server.xml</echo>
961+
<copy
962+
failonerror="false"
963+
file="../../test-utils/src/main/resources/server.xml"
964+
tofile="${project.build.directory}/wlp/templates/servers/defaultServer/server.xml"
965+
/>
966+
</tasks>
967+
</configuration>
968+
</execution>
969+
</executions>
970+
</plugin>
971+
<plugin>
972+
<groupId>org.apache.maven.plugins</groupId>
973+
<artifactId>maven-surefire-plugin</artifactId>
974+
<configuration>
975+
<systemPropertyVariables>
976+
<arquillian.launch>liberty-embedded-arquillian</arquillian.launch>
977+
<arquillian.liberty.wlpHome>${project.build.directory}/wlp</arquillian.liberty.wlpHome>
978+
</systemPropertyVariables>
979+
</configuration>
980+
</plugin>
981+
</plugins>
982+
</build>
983+
</profile>
984+
985+
904986
<profile>
905987
<id>weblogic-remote-arquillian</id>
906988

test-utils/src/main/resources/arquillian.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
<property name="wlpHome">${libertyManagedArquillian_wlpHome}</property>
2323
</configuration>
2424
</container>
25+
26+
<container qualifier="liberty-embedded-arquillian">
27+
<configuration>
28+
<property name="deployType">xml</property>
29+
<property name="wlpHome">${arquillian.liberty.wlpHome}</property>
30+
</configuration>
31+
</container>
2532

2633
<container qualifier="weblogic-remote-arquillian">
2734
<configuration>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<server description="new server">
3+
4+
<!-- Enable features -->
5+
<featureManager>
6+
<feature>javaee-7.0</feature>
7+
<feature>localConnector-1.0</feature>
8+
</featureManager>
9+
10+
<!-- This template enables security. To get the full use of all the capabilities, a keystore and user registry are required. -->
11+
12+
<!-- For the keystore, default keys are generated and stored in a keystore. To provide the keystore password, generate an
13+
encoded password using bin/securityUtility encode and add it below in the password attribute of the keyStore element.
14+
Then uncomment the keyStore element. -->
15+
<!--
16+
<keyStore password=""/>
17+
-->
18+
19+
<!--For a user registry configuration, configure your user registry. For example, configure a basic user registry using the
20+
basicRegistry element. Specify your own user name below in the name attribute of the user element. For the password,
21+
generate an encoded password using bin/securityUtility encode and add it in the password attribute of the user element.
22+
Then uncomment the user element. -->
23+
<!--
24+
<basicRegistry id="basic" realm="BasicRealm">
25+
<user name="yourUserName" password="" />
26+
</basicRegistry>
27+
-->
28+
29+
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
30+
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
31+
32+
<!-- Automatically expand WAR files and EAR files -->
33+
<applicationManager autoExpand="true"/>
34+
35+
36+
</server>

0 commit comments

Comments
 (0)