|
1 |
| -Testing Java EE Applications Using Arquillian |
2 |
| -========== |
| 1 | +Testing Java EE Applications on WebLogic 12.1.3 Using Arquillian |
| 2 | +================================================================ |
| 3 | +This application demonstrates how Java EE applications can be effectively |
| 4 | +tested using Arquillian on WebLogic 12.1.3. The application contains a |
| 5 | +set of JUnit tests that you should examine. The tests will be run as part |
| 6 | +of the Maven build. The tests require a locally running instance of |
| 7 | +WebLogic (please see setup instructions). |
3 | 8 |
|
4 |
| -This application demonstrates how Java EE applications can be effectively tested using Arquillian. |
| 9 | +WebLogic 12.1.3 supports Java EE 6 and some key Java EE 7 APIs - |
| 10 | +WebSocket, JAX-RS 2, JSON-P and JPA 2.1. The application uses both |
| 11 | +these APIs as well as Java EE 6 features such as CDI, EJB 3.1 and JSF 2. |
| 12 | + |
| 13 | +Setup |
| 14 | +----- |
| 15 | +* Install WebLogic 12.1.3 |
| 16 | +* The Java EE 7 APIs are not automatically enabled. This |
| 17 | + [Aquarium blog entry](https://blogs.oracle.com/theaquarium/entry/java_ee_7_support_comes) |
| 18 | + is invaluable in better understanding the Java EE 7 API support in |
| 19 | + WebLogic 12.1.3. The referenced white paper explains the steps necessary to |
| 20 | + enable the APIs. |
| 21 | +* The demo application requires a data source. WebLogic 12.1.3 supports the |
| 22 | + Java EE 6 standard @DataSourceDefinition and corresponding XML elements. |
| 23 | + However, this does not seem to work with JPA 2.1 so we could not use it. A bug |
| 24 | + has been filed to get this fixed. Yet another approach is to use WebLogic |
| 25 | + proprietary JDBC modules. This requires an EAR file and would significantly |
| 26 | + complicate an otherwise simple WAR build. For this reason, this was not an |
| 27 | + approach we used. As a result, however, you will need to manually create a |
| 28 | + data source for the demo application. The data source is expected to be bound |
| 29 | + to 'jdbc/ActionBazaarDB'. We used embedded Derby but any underlying database |
| 30 | + should work. If helpful, a sample source definition is provided |
| 31 | + [here](ActionBazaarDB-jdbc.xml). |
| 32 | +* Please download this repository. You can use GitHub or just the simple zip |
| 33 | + download. |
| 34 | +* The demo is just a simple Maven project under the [actionbazaar](actionbazaar) |
| 35 | + directory. You should be able to open it up in any Maven capable IDE, we used |
| 36 | + NetBeans. |
| 37 | +* If desired setup WebLogic in your IDE. This is what we tested. |
| 38 | +* The tests in the Maven build are executed against a running WebLogic instance. |
| 39 | + You will need to configure |
| 40 | + [this file] (actionbazaar\src\test\resources\arquillian.xml) with the details |
| 41 | + of our running WebLogic instance (you could run the instance via the IDE). |
| 42 | + For details on configuring WebLogic for Arquillian, look |
| 43 | + [here] (https://docs.jboss.org/author/display/ARQ/WLS+12.1+-+Remote). |
| 44 | +* If desired, you can deploy and run the application itself. We did this both |
| 45 | + via NetBeans and by using the plain Maven generated war file. |
0 commit comments