callB
110111112113114115116117118119120
assertTrue("eardeployment/SessionB is registered", isRegisterd); InitialContext ctx = new InitialContext(); SessionAHome home = (SessionAHome) ctx.lookup("eardeployment/SessionA"); SessionA bean = home.create(); bean.callB(); bean.remove(); undeploy("cpejbs-manifest.ear"); } }
5253545556575859606162
{ SessionAHome aHome = (SessionAHome)getInitialContext().lookup("eardeployment/SessionA"); SessionBHome bHome = (SessionBHome)getInitialContext().lookup("eardeployment/SessionB"); SessionA a = aHome.create(); SessionB b = bHome.create(); assertTrue("a call b failed!", a.callB()); assertTrue("b call a failed!", b.callA()); } finally { undeploy("unpacked/eardeployment.ear");
8687888990919293949596
{ SessionAHome aHome = (SessionAHome) getInitialContext().lookup("eardeployment/SessionA"); SessionBHome bHome = (SessionBHome) getInitialContext().lookup("eardeployment/SessionB"); SessionA a = aHome.create(); SessionB b = bHome.create(); assertTrue("a called b", a.callB()); assertTrue("b called a", b.callA()); } finally { undeploy(testUrl);