Integration Testing with TestNG and embeddedEjb
eagleeye Aug 13, 2007 8:10 AMI have a lot problems to let run Integration Tests.
The main problem is to grab the loaded Components from the Container.
It seems that they are not loaded. I'm not able to get the by hand from the JNDI.
here the Request:
new FacesRequest() { @Override protected void invokeApplication() { Object test = JndiUtil.lookup("mediportal/KomunikatyManagerBean/local", KomunikatyManagerBean.class); KomunikatyManager komunikatyManager = (KomunikatyManager) getInstance(KomunikatyManagerBean.class); invokeMethod("#{komunikatyManager.nowy}"); } }.run();
here the console output for this component, while starting embeddedEjb:
12:40:11,812 INFO [Initialization] Installing components... 12:40:12,375 INFO [Component] Component: komunikatyManager, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: pl.alternativ.med.portal.komunikaty.KomunikatyManagerBean, JNDI: mediportal/KomunikatyManagerBean/local
and finally the error message:
14:07:01,609 INFO [Initialization] done initializing Seam Start Nowy Test----------------------------------------- 14:07:01,734 INFO [Ejb] stopping the embedded EJB container 14:07:01,765 ERROR [AbstractKernelController] Internal error during uninstall current state not found: name=jboss.j2ee:jar=test-build,name=MailMDB,service=EJB3 state=**ERROR** error=javax.naming.NameNotFoundException: DefaultJMSProvider not bound 14:07:01,765 ERROR [AbstractKernelController] Internal error during uninstall: toState=ControllerState@262730{Not Installed} context=name=jboss.j2ee:jar=test-build,name=MailMDB,service=EJB3 state=**ERROR** error=javax.naming.NameNotFoundException: DefaultJMSProvider not bound 14:07:01,765 ERROR [AbstractKernelController] Internal error during uninstall current state not found: name=jboss.j2ee:jar=test-build,name=PlikiKlientowMDB,service=EJB3 state=**ERROR** error=javax.naming.NameNotFoundException: DefaultJMSProvider not bound 14:07:01,765 ERROR [AbstractKernelController] Internal error during uninstall: toState=ControllerState@262730{Not Installed} context=name=jboss.j2ee:jar=test-build,name=PlikiKlientowMDB,service=EJB3 state=**ERROR** error=javax.naming.NameNotFoundException: DefaultJMSProvider not bound 14:07:01,796 INFO [SessionFactoryImpl] closing 14:07:01,796 INFO [SchemaExport] Running hbm2ddl schema export 14:07:01,796 INFO [SchemaExport] exporting generated schema to database 14:07:01,812 INFO [SchemaExport] schema export complete FAILED: testNowyKomunikat org.jbpm.util.JndiLookupException: couldn't fetch 'mediportal/KomunikatyManagerBean/local' from jndi at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:41) at pl.alternativ.med.portal.test.komunikaty.KomunikatyTest$1.invokeApplication(KomunikatyTest.java:49) at org.jboss.seam.mock.SeamTest$Request.run(SeamTest.java:489) at pl.alternativ.med.portal.test.komunikaty.KomunikatyTest.testNowyKomunikat(KomunikatyTest.java:54) Caused by: javax.naming.NameNotFoundException: mediportal not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:529) at org.jnp.server.NamingServer.getBinding(NamingServer.java:537) at org.jnp.server.NamingServer.getObject(NamingServer.java:543) at org.jnp.server.NamingServer.lookup(NamingServer.java:267) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:626) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:588) at javax.naming.InitialContext.lookup(Unknown Source) at org.jbpm.util.JndiUtil.lookup(JndiUtil.java:36) ... 24 more ... Removed 21 stack frames
I'm really running out of ideas! Before the startup is looking good,
init the DS is working,
Mapping of the beans,
import of data,
I have no idea why i can't grab any of the Components or where they are gone! The configuration i have checked million times.
I would be pleased if somebody could give some new ideas or hints.