Java Reference
In-Depth Information
named chapter15-ejb , and they're relatively simple so the EJBContainer config-
uration won't be too difficult. But the example code is also not trivial, so it's worthwhile to
demonstrate the use of EJBContainer . The first configuration we'll look at is the Maven
The /chapter15-ejb-embedded-test/pom.xml will need a number of changes to run the in-
tegration tests using the embedded EJBContainer . The first change you need to be
aware of is a property defining what version of the chapter15-ejb project you want to
test. Your EJB project will most likely have multiple versions because code is developed
and pushed to production over the years. As this happens, testing must also change to keep
pace with the code it's testing. This property defines what version of the EJB code is to be
The reason you define this as a property is because you're going to need the value in a
couple of different places inside pom.xml. It's always bad to duplicate version numbers
like this, so a property to hold the value will do nicely. The first use of this property will be
to add a dependency on the chapter15-ejb project. Adding the dependency is just like
adding any other Maven dependency, but you use the property to define the version:
You need to use this property in one more configuration change in pom.xml. You need to
configure maven-surefire-plugin and pass a module name to the integration test.
You'll see why you need to do this in a moment, but for right now, this is the maven-
surefire-plugin configuration:
Search WWH ::

Custom Search