Java Reference
In-Depth Information
}catch(Exception ex){
Given the changes in JMS 2.0 Specification, the EJB 3.2 Specification has a revised
list of JMS MDB activation properties to conform to the list of standard properties.
Thesepropertiesare: destinationLookup , connectionFactoryLookup , cli-
entId , subscriptionName , and shareSubscriptions . In addition, it has ad-
ded the ability in MDB to implement a no-method message listener, resulting in the
exposure of all public methods of the bean as message listener methods.
Other improvements
As we said earlier, the EJB 3.1 Specification has given developers the opportunity to
test EJB applications outside a full Java EE server. This was made possible through
an embeddable EJBContainer . The following example demonstrates how to test
an EJB using an embeddable EJBContainer :
public void testAddition(){
Map<String, Object> properties = new
HashMap<String, Object>();
properties.put(EJBContainer.MODULES, new
EJBContainer container =
try {
NewSessionBean bean = (NewSessionBean)
int restult = bean.addition(10, 10);
Assert.assertEquals(20, restult);
Search WWH ::

Custom Search