Java Reference
In-Depth Information
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="ActionBazaar" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>
jdbc/chapter15-ejb-arquillian
</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property
name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
</persistence>
We didn't need to set different JNDI lookup values for the data source between the
chapter15-ejb-embedded-test
project and the
chapter15-ejb-
arquillian-test
project. Leaving them the same may have been easier, but easier
isn't always better. It's good practice to make these values specific. By doing so, you're
more likely to get the configuration right and you gain a better understanding of how the
different technologies of your application work together.
This concludes the configuration you need to do for the
chapter15-ejb-
arquillian-test
project. As you can see, it's similar to the configuration for the
chapter15-ejb-embedded-test
project in that the basic technologies still need to
be configured: Maven, GlassFish, Derby, and JAP. But doing so is a bit different in each
project. Now that you have the project configured, we can move on to the Arquillian integ-
ration test itself.
15.4.2. Integration test
The Arquillian integration test is much simpler and more streamlined than its embedded
EJBContainer
container counterpart. This makes the test easier to develop and main-
tain. The code for the Arquillian integration test of the
DiscountManager
EJB is shown
in the following listing.