Skip to content

Commit 0977acb

Browse files
author
Reza Rahman
committed
Instructions.
1 parent f8a7d15 commit 0977acb

File tree

2 files changed

+74
-3
lines changed

2 files changed

+74
-3
lines changed

ActionBazaarDB-jdbc.xml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<jdbc-data-source
3+
xmlns="http://xmlns.oracle.com/weblogic/jdbc-data-source"
4+
xmlns:sec="http://xmlns.oracle.com/weblogic/security"
5+
xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/jdbc-data-source http://xmlns.oracle.com/weblogic/jdbc-data-source/1.0/jdbc-data-source.xsd">
8+
<name>ActionBazaarDB</name>
9+
<jdbc-driver-params>
10+
<url>jdbc:derby:/tmp/actionbazaar-database;create=true</url>
11+
<driver-name>org.apache.derby.jdbc.EmbeddedDriver</driver-name>
12+
<properties>
13+
<property>
14+
<name>create</name>
15+
<value>true</value>
16+
</property>
17+
<property>
18+
<name>databaseName</name>
19+
<value>actionbazaar-database</value>
20+
</property>
21+
</properties>
22+
</jdbc-driver-params>
23+
<jdbc-connection-pool-params>
24+
<test-table-name>SQL SELECT 1 FROM SYS.SYSTABLES</test-table-name>
25+
</jdbc-connection-pool-params>
26+
<jdbc-data-source-params>
27+
<jndi-name>jdbc/ActionBazaarDB</jndi-name>
28+
<global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
29+
</jdbc-data-source-params>
30+
</jdbc-data-source>

README.md

+44-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,45 @@
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).
38

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

Comments
 (0)