[jboss-dev-forums] [Design of EJB 3.0] - Re: Unit Tests for Unbinding References from JNDI in EJB3 Pr
jaikiran
do-not-reply at jboss.com
Wed Jun 18 10:34:43 EDT 2008
Andrew, thanks very much for reviewing the test case. I have started incorporating the comments.
"ALRubinger" wrote :
| * Tests must check not only the default local and remote bind values, but also those of the interface-specific bindings
|
I do see the test cases and the logs which show that each bean binds to the default business JNDI name and also a interface-specific JNDI name. But what exactly is the difference between the default and the interface specific bindings? Let me know if i need to look up some document where this is explained.
For example, in this bean what gets bound to the interface specific jndi name and the what gets bound to the default jndi name?
@Stateless
| @Local(MyStatelessLocal.class)
| @Remote(MyStatelessRemote.class)
| public class MyStateless30OnlyBean implements MyStatelessLocal, MyStatelessRemote
|
"ALRubinger" wrote :
| * Already provided are SLSB and SFSB EJBs in the "common" test package; we can use these and do away with the ones specific to the "jndiregistrar" test package.
|
I'll start using the "common" EJBs. I introduced the beans in the "jndiregistrar" to keep these test cases in the jndiregistrar, self-contained. But looking at the EJBs in the "common" package, looks like they were meant to be used across test cases.
"ALRubinger" wrote :
| * The tests are checking for hardcoded JNDI bind values. Instead, should be checking against the same values used by Proxy; these are obtained from metadata:
|
| JBossSessionBeanMetaData md = statelessSessionContainer.getMetaData();
| | md.getLocalHomeJndiName(); // Local Home Binding
| | md.getHomeJndiName(); // Remote Home Binding
| | md.determineJndiName(); // Default Business Remote Binding
| | md.determineLocalJndiName(); // Default Business Local Binding
| | BusinessRemotesMetaData businessRemotes = md.getBusinessRemotes();
| | for(String businessRemoteInterfaceName : businessRemotes)
| | {
| | md.determineResolvedJndiName(businessRemoteInterfaceName); // Interface-specific business remote JNDI Binding
| | }
| | BusinessLocalsMetaData businessLocals = md.getBusinessLocals();
| | for(String businessLocalInterfaceName: businessLocals)
| | {
| | md.determineResolvedJndiName(businessLocalInterfaceName); // Interface-specific business local JNDI Binding
| | }
|
Thanks! I wasn't aware of those APIs :)
One more question - Once the bean is unbound from the JNDI registry using:
Ejb3RegistrarLocator.locateRegistrar().unbind(statelessSessionContainer.getName());
Is the JBossMetaData present in the statelessSessionContainer (which got unbound) expected to still maintain the jndi names? Ex: Is the metadata.determineJndiName() expected to return the jndi name after the bean was unbound? Or is it expected to return null?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159007#4159007
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159007
More information about the jboss-dev-forums
mailing list