Skip to content

Commit 1718e66

Browse files
committed
merge
2 parents 7f60297 + a99b793 commit 1718e66

695 files changed

Lines changed: 26543 additions & 1237 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,10 @@ local.properties
9494

9595
# Testing environment specific
9696
derby.log
97+
98+
99+
######################
100+
# Liberty tools
101+
######################
102+
103+
.factorypath

‎LICENSE‎

Lines changed: 0 additions & 651 deletions
Large diffs are not rendered by default.

‎README.md‎

Lines changed: 59 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,32 @@ 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 5 available container profiles:
15+
There are 10 available container profiles, for 5 different servers:
1616

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

19-
The default profile and it will install a Wildfly server and start up the server per sample.
19+
This profile will install a Wildfly server and start up the server per sample.
20+
Useful for CI servers.
21+
22+
* ``wildfly-embedded-arquillian``
23+
24+
This profile is almost identical to wildfly-managed-arquillian. It will install the same Wildfly server and start up
25+
that server per sample again, but instead uses the Arquillian embedded connector to run it in the same JVM.
2026
Useful for CI servers.
2127

2228
* ``wildfly-remote-arquillian``
2329

2430
This profile requires you to start up a Wildfly server outside of the build. Each sample will then
2531
reuse this instance to run the tests.
26-
Useful for development to avoid the server start up cost per sample.
32+
Useful for development to avoid the server start up cost per sample. This is the default profile.
2733

2834
* ``glassfish-embedded-arquillian``
2935

@@ -36,9 +42,39 @@ There are 5 available container profiles:
3642
reuse this instance to run the tests.
3743
Useful for development to avoid the server start up cost per sample.
3844

45+
* ``tomee-managed-arquillian``
46+
47+
This profile will install a TomEE server and start up that server per sample.
48+
Useful for CI servers. This profile cannot connect to a running server.
49+
50+
Note that the version of TomEE to be used has to be present in an
51+
available maven repository. The defaults in this profile assume that the arquillian adapter and
52+
the TomEE server have the same version. E.g both 7.0.0.
53+
54+
To use a TomEE server that's not available in maven central, one way to use it for the samples is to
55+
install it in a local .m2 as follows:
56+
57+
Clone TomEE repo:
58+
59+
``git clone https://github.com/apache/tomee``
60+
``cd tomee``
61+
62+
Switch to the desired version if needed, then build and install in .m2:
63+
64+
``mvn clean install -pl tomee/apache-tomee -am -Dmaven.test.skip=true``
65+
66+
``mvn clean install -pl arquillian -amd -Dmaven.test.skip=true``
67+
68+
Make sure the version that's installed (see pom.xml in TomEE project) matches the ``tomee.version`` in the
69+
properties section in the root pom.xml of the samples project.
70+
71+
* ``tomee-embedded-arquillian``
72+
73+
This profile uses the TomEE embedded server and runs in the same JVM as the TestClass.
74+
3975
* ``liberty-managed-arquillian``
4076

41-
This profile will start up the server per sample, and optionally connects to a running server that you
77+
This profile will start up the Liberty server per sample, and optionally connects to a running server that you
4278
can start up outside of the build (with the restriction that this server has to run on the host as where
4379
the tests are run using the same user).
4480

@@ -52,25 +88,29 @@ There are 5 available container profiles:
5288

5389
``-DlibertyManagedArquillian_wlpHome=/opt/wlp``
5490

55-
This profile also requires the localConnector feature to be configured in server.xml, and if all tests are to be run at least the
56-
javaee-7.0 feature and jaspic-1.1 (even though this is part of Java EE 7 already). E.g.
91+
This profile also requires the localConnector feature to be configured in server.xml, and if all tests are to be run the
92+
javaee-7.0 feature E.g.
5793

5894
```xml
5995
<featureManager>
6096
<feature>javaee-7.0</feature>
61-
<feature>jaspic-1.1</feature>
6297
<feature>localConnector-1.0</feature>
6398
</featureManager>
6499
```
65100

66-
For the JASPIC tests to even be attempted to be executed a cheat is needed that creates a user in Liberty's internal user registry:
101+
For the JASPIC tests to even be attempted to be executed a cheat is needed that creates a group in Liberty's internal user registry:
67102

68103
```xml
69104
<basicRegistry id="basic">
70-
<user name="test" password="not needed"/>
71105
<group name="architect"/>
72106
</basicRegistry>
73107
```
108+
109+
* ``liberty-embedded-arquillian``
110+
111+
This profile will download and install a Liberty server and start up the server per sample.
112+
Useful for CI servers. Note, this is not a real embedded server, but a regular server. It's now
113+
called "embedded" because no separate install is needed as it's downloaded automatically.
74114

75115
* ``weblogic-remote-arquillian``
76116

@@ -97,7 +137,7 @@ Some of the containers allow you to override the version used
97137

98138
* `-Dglassfish.version=4.1`
99139

100-
This will change the version from 4.0 to 4.1 for GlassFish testing purposes.
140+
This will change the version from 4.1.1 to 4.1 for GlassFish testing purposes.
101141

102142
Similarly, there are 6 profiles to choose a browser to test on:
103143

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

131-
To run them in the console do:
171+
**To run them in the console do**:
132172

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

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

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

179+
**To run only a subset of the tests do at the top-level directory**:
180+
181+
1. Install top level dependencies: ``mvn clean install -pl "test-utils,util" -am``
182+
1. cd into desired module, e.g.: ``cd jaspic``
183+
1. Run tests against desired server, e.g.: ``mvn clean test -P liberty-embedded-arquillian``
184+
185+
139186
## How to contribute ##
140187

141188
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!

‎batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/MyChunkListener.java‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
141
package org.javaee7.batch.batch.listeners;
242

343
import javax.batch.api.chunk.listener.AbstractChunkListener;

‎batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/MyInputRecord.java‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package org.javaee7.batch.batch.listeners;
241

342
/**

‎batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/MyItemProcessor.java‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
140
package org.javaee7.batch.batch.listeners;
241

342
import javax.batch.api.chunk.ItemProcessor;

‎batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/MyItemProcessorListener.java‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
141
package org.javaee7.batch.batch.listeners;
242

343
import javax.batch.api.chunk.listener.AbstractItemProcessListener;

‎batch/batch-listeners/src/main/java/org/javaee7/batch/batch/listeners/MyItemReadListener.java‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* The contents of this file are subject to the terms of either the GNU
7+
* General Public License Version 2 only ("GPL") or the Common Development
8+
* and Distribution License("CDDL") (collectively, the "License"). You
9+
* may not use this file except in compliance with the License. You can
10+
* obtain a copy of the License at
11+
* https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
12+
* or packager/legal/LICENSE.txt. See the License for the specific
13+
* language governing permissions and limitations under the License.
14+
*
15+
* When distributing the software, include this License Header Notice in each
16+
* file and include the License file at packager/legal/LICENSE.txt.
17+
*
18+
* GPL Classpath Exception:
19+
* Oracle designates this particular file as subject to the "Classpath"
20+
* exception as provided by Oracle in the GPL Version 2 section of the License
21+
* file that accompanied this code.
22+
*
23+
* Modifications:
24+
* If applicable, add the following below the License Header, with the fields
25+
* enclosed by brackets [] replaced by your own identifying information:
26+
* "Portions Copyright [year] [name of copyright owner]"
27+
*
28+
* Contributor(s):
29+
* If you wish your version of this file to be governed by only the CDDL or
30+
* only the GPL Version 2, indicate your decision by adding "[Contributor]
31+
* elects to include this software in this distribution under the [CDDL or GPL
32+
* Version 2] license." If you don't indicate a single choice of license, a
33+
* recipient has the option to distribute your version of this file under
34+
* either the CDDL, the GPL Version 2 or to extend the choice of license to
35+
* its licensees as provided above. However, if you add GPL Version 2 code
36+
* and therefore, elected the GPL Version 2 license, then the option applies
37+
* only if the new code is made subject to such option by the copyright
38+
* holder.
39+
*/
40+
141
package org.javaee7.batch.batch.listeners;
242

343
import javax.batch.api.chunk.listener.AbstractItemReadListener;

0 commit comments

Comments
 (0)