4 Replies Latest reply on Jul 2, 2010 3:29 PM by Philip Dudley

    Integration Testing - @In EntityManager

    Philip Dudley Newbie

      Hello,


      I have been working on an integration test using TestNG. I have read through sections and followed examples in books such as Beginning JBoss Seam and Seam 2.X Web Development. I have also done numerous searches across this and other forums.


      Despite my reading, I am unable to create an integration test that is able to persist and import @In components. I try to set the values in the updateModelValues() method but still have no luck. If I were to run the same test by removing persistence and @In then my test completes.


      I have tried numerous things including editing components-test.properties and persistence-test.xml. Both of which now affect how the application runs regularly on the server. Editing these simply to get tests to work when the application works regularly I’d imagine surely cannot be right.


      What am I doing wrong? From my understanding I should not have to do anything extra to get @In and EntityManager to work when I am extending SeamTest.


      Any help would be greatly appreciated.
      Thank you
      Phil

        • 1. Re: Integration Testing - @In EntityManager
          Arbi Sookazian Master

          Do you have any errors?  Are you using an embedded container?  pg. 146 of SiA book states test class extends SeamTest which bootstraps the Embedded JBoss to provide a Java EE-compliant environment...


          Also check out Arquillian testing frmwk, new for CDI TCK and EE 6.

          • 2. Re: Integration Testing - @In EntityManager
            Philip Dudley Newbie

            As for the embedded container, I am using JBoss when it is run on the server... It is a Seam Gen created project.


            Below are the errors when I run the test.


            Thanks for the reply,
            Phil


            [testng] [Parser] Running:
               [testng]   C:\development\sitedev\lfapi\test-build\TestTest.xml
               [testng] ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] Unsuccessful: create table lf01.address (id integer generated by default as identity (start with 1), active bit, address1 varchar(35), address2 varchar(35), address_type varchar(12) not null, city varchar(35), company varchar(35), contact varchar(35), country varchar(45), dropoff_location varchar(45), instructions varchar(150), last_update_date timestamp, latitude numeric, longitude numeric, master_address_id integer, phone varchar(24), pickup varchar(45), pickup_location varchar(45), postal_code varchar(12), state_prov varchar(35), primary key (id), unique (id))
               [testng] WARN  [org.jboss.seam.Component] Component class should be serializable: createPromotion
               [testng] WARN  [org.jboss.seam.Component] Component class should be serializable: createPromotionDiscount
               [testng] WARN  [org.jboss.seam.Component] Component class should be serializable: mailExample
               [testng] WARN  [org.jboss.seam.Component] Component class should be serializable: operator
               [testng] WARN  [org.jboss.seam.Component] Component class should be serializable: sessionTracking
               [testng] INFO  [org.quartz.core.QuartzScheduler] Quartz Scheduler v.1.5.2 created.
               [testng] INFO  [org.quartz.simpl.RAMJobStore] RAMJobStore initialized.
               [testng] INFO  [org.quartz.impl.StdSchedulerFactory] Quartz scheduler 'Sched1' initialized from an externally opened InputStream.
               [testng] INFO  [org.quartz.impl.StdSchedulerFactory] Quartz scheduler version: 1.5.2
               [testng] INFO  [org.quartz.core.QuartzScheduler] Scheduler Sched1_$_NON_CLUSTERED started.
               [testng] WARN  [org.jboss.seam.security.permission.PersistentPermissionResolver] no permission store available - please install a PermissionStore with the name 'org.jboss.seam.security.jpaPermissionStore' if persistent permissions are required.
               [testng] PASSED: Testing3
               [testng] PASSED: Testing1
               [testng] PASSED: Testing2
               [testng] PASSED: UtilityTesting
               [testng] ===============================================
               [testng]     Test Tests
               [testng]     Tests run: 4, Failures: 0, Skips: 0
               [testng] ===============================================
               [testng] FAILED: testPromotionDiscount
               [testng] java.lang.AssertionError: org.jboss.seam.InstantiationException: Could not instantiate Seam component: promotionHome
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.onException(AbstractSeamTest.java:455)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:504)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
               [testng]     at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
               [testng]     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.run(AbstractSeamTest.java:491)
               [testng]     at com.luggageforward.test.PromotionTests.testPromotionDiscount(PromotionTests.java:12)
               [testng] Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: promotionHome
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2144)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2021)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
               [testng]     at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
               [testng]     at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
               [testng]     at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
               [testng]     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
               [testng]     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
               [testng]     at org.jboss.seam.core.Validators$ValidatingResolver.getValue(Validators.java:176)
               [testng]     at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
               [testng]     at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
               [testng]     at org.jboss.el.parser.AstValue.setValue(AstValue.java:83)
               [testng]     at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
               [testng]     at org.jboss.seam.core.Validators.validate(Validators.java:136)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.validateValue(AbstractSeamTest.java:440)
               [testng]     at com.luggageforward.test.PromotionTests$1.processValidations(PromotionTests.java:16)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.processValidationsPhase(AbstractSeamTest.java:687)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:589)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.access$100(AbstractSeamTest.java:177)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:497)
               [testng]     ... 44 more
               [testng] Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: userHome
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2144)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2021)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
               [testng]     at org.jboss.seam.Component.getValueToInject(Component.java:2301)
               [testng]     at org.jboss.seam.Component.injectAttributes(Component.java:1736)
               [testng]     at org.jboss.seam.Component.inject(Component.java:1554)
               [testng]     at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
               [testng]     at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
               [testng]     at com.luggageforward.action.PromotionHome_$$_javassist_seam_4.create(PromotionHome_$$_javassist_seam_4.java)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2132)
               [testng]     ... 65 more
               [testng] Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.unwrap(Component.java:2275)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2041)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1972)
               [testng]     at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272)
               [testng]     at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20)
               [testng]     at org.jboss.seam.framework.EntityHome.getEntityManager(EntityHome.java:177)
               [testng]     at org.jboss.seam.framework.EntityHome.create(EntityHome.java:31)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
               [testng]     at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
               [testng]     at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
               [testng]     at com.luggageforward.action.UserHome_$$_javassist_seam_5.create(UserHome_$$_javassist_seam_5.java)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2132)
               [testng]     ... 95 more
               [testng] Caused by: javax.naming.NameNotFoundException: entityManager not bound
               [testng]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
               [testng]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
               [testng]     at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
               [testng]     at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
               [testng]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
               [testng]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
               [testng]     at javax.naming.InitialContext.lookup(InitialContext.java:351)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
               [testng]     ... 141 more
               [testng] ... Removed 38 stack frames
               [testng] ===============================================
               [testng]     Promotion Tests
               [testng]     Tests run: 1, Failures: 1, Skips: 0
               [testng] ===============================================
               [testng] ********0**************
               [testng] percent
               [testng] Trip
               [testng] item
               [testng] 100% off 1 small bag(s) for the entire trip
               [testng] null
               [testng] ********0**************
               [testng] amount
               [testng] Trip
               [testng] item
               [testng] $100 off 1 small bag(s) for the entire trip
               [testng] 100
               [testng] PASSED: percentTripItem
               [testng] PASSED: amountTripItem
               [testng] ===============================================
               [testng]     PromotionDiscount Tests
               [testng]     Tests run: 2, Failures: 0, Skips: 0
               [testng] ===============================================
               [testng] FAILED: testPromotionDiscount
               [testng] java.lang.AssertionError: org.jboss.seam.InstantiationException: Could not instantiate Seam component: promotionHome
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.onException(AbstractSeamTest.java:455)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:504)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
               [testng]     at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
               [testng]     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
               [testng]     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               [testng]     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.run(AbstractSeamTest.java:491)
               [testng]     at com.luggageforward.test.PromotionDiscountOriginal.testPromotionDiscount(PromotionDiscountOriginal.java:37)
               [testng] Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: promotionHome
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2144)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2021)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
               [testng]     at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
               [testng]     at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:148)
               [testng]     at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
               [testng]     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
               [testng]     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
               [testng]     at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
               [testng]     at org.jboss.el.parser.AstValue.getTarget(AstValue.java:34)
               [testng]     at org.jboss.el.parser.AstValue.setValue(AstValue.java:83)
               [testng]     at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.setValue(AbstractSeamTest.java:430)
               [testng]     at com.luggageforward.test.PromotionDiscountOriginal$1.updateModelValues(PromotionDiscountOriginal.java:40)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.updateModelValuesPhase(AbstractSeamTest.java:670)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.emulateJsfLifecycle(AbstractSeamTest.java:592)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request.access$100(AbstractSeamTest.java:177)
               [testng]     at org.jboss.seam.mock.AbstractSeamTest$Request$2.doFilter(AbstractSeamTest.java:497)
               [testng]     ... 44 more
               [testng] Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: userHome
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2144)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2021)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2349)
               [testng]     at org.jboss.seam.Component.getValueToInject(Component.java:2301)
               [testng]     at org.jboss.seam.Component.injectAttributes(Component.java:1736)
               [testng]     at org.jboss.seam.Component.inject(Component.java:1554)
               [testng]     at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
               [testng]     at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
               [testng]     at com.luggageforward.action.PromotionHome_$$_javassist_seam_4.create(PromotionHome_$$_javassist_seam_4.java)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2132)
               [testng]     ... 63 more
               [testng] Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/entityManager
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.unwrap(Component.java:2275)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:2041)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1983)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1977)
               [testng]     at org.jboss.seam.Component.getInstance(Component.java:1972)
               [testng]     at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272)
               [testng]     at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20)
               [testng]     at org.jboss.seam.framework.EntityHome.getEntityManager(EntityHome.java:177)
               [testng]     at org.jboss.seam.framework.EntityHome.create(EntityHome.java:31)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
               [testng]     at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
               [testng]     at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
               [testng]     at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
               [testng]     at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
               [testng]     at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
               [testng]     at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
               [testng]     at com.luggageforward.action.UserHome_$$_javassist_seam_5.create(UserHome_$$_javassist_seam_5.java)
               [testng]     at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
               [testng]     at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
               [testng]     at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
               [testng]     at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
               [testng]     at org.jboss.seam.Component.newInstance(Component.java:2132)
               [testng]     ... 93 more
               [testng] Caused by: javax.naming.NameNotFoundException: entityManager not bound
               [testng]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
               [testng]     at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
               [testng]     at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
               [testng]     at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
               [testng]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
               [testng]     at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
               [testng]     at javax.naming.InitialContext.lookup(InitialContext.java:351)
               [testng]     at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
               [testng]     ... 139 more
               [testng] ... Removed 38 stack frames
               [testng] ===============================================
               [testng]     PromotionDiscount Original Tests
               [testng]     Tests run: 1, Failures: 1, Skips: 0
               [testng] ===============================================
               [testng] INFO  [org.quartz.core.QuartzScheduler] Scheduler Sched1_$_NON_CLUSTERED shutting down.
               [testng] INFO  [org.quartz.core.QuartzScheduler] Scheduler Sched1_$_NON_CLUSTERED paused.
               [testng] INFO  [org.quartz.core.QuartzScheduler] Scheduler Sched1_$_NON_CLUSTERED shutdown complete.
               [testng] ===============================================
               [testng] test
               [testng] Total tests run: 8, Failures: 2, Skips: 0
               [testng] ===============================================

            • 3. Re: Integration Testing - @In EntityManager
              Philip Dudley Newbie

              According to http://docs.jboss.org/seam/2.2.1.CR1/reference/en-US/html/testing.html Section 37.3.1 seeing as my Project is Seam Gen then I should be ready for action. I put foo-ds.xml into my bootstrap/deploy directory. Now when I run the tests I get the following error.


              Any ideas?


              Thank you,
              Phil



               [testng] [Parser] Running:
                 [testng]   C:\development\sitedev\lfapi\test-build\TestTest.xml
                 [testng] SKIPPED CONFIGURATION: @BeforeClass setupClass
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @AfterClass cleanupClass
                 [testng] SKIPPED: Testing3
                 [testng] SKIPPED: Testing1
                 [testng] SKIPPED: Testing2
                 [testng] SKIPPED: UtilityTesting
                 [testng] ===============================================
                 [testng]     Test Tests
                 [testng]     Tests run: 4, Failures: 0, Skips: 4
                 [testng]     Configuration Failures: 0, Skips: 10
                 [testng] ===============================================
                 [testng] SKIPPED CONFIGURATION: @BeforeClass setupClass
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @AfterClass cleanupClass
                 [testng] SKIPPED: testPromotionDiscount
                 [testng] ===============================================
                 [testng]     Promotion Tests
                 [testng]     Tests run: 1, Failures: 0, Skips: 1
                 [testng]     Configuration Failures: 0, Skips: 4
                 [testng] ===============================================
                 [testng] SKIPPED CONFIGURATION: @BeforeClass setupClass
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @AfterClass cleanupClass
                 [testng] SKIPPED: percentTripItem
                 [testng] SKIPPED: amountTripItem
                 [testng] ===============================================
                 [testng]     PromotionDiscount Tests
                 [testng]     Tests run: 2, Failures: 0, Skips: 2
                 [testng]     Configuration Failures: 0, Skips: 6
                 [testng] ===============================================
                 [testng] FAILED CONFIGURATION: @BeforeSuite startSeam
                 [testng] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                 [testng] *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
                 [testng] jboss.jca:name=lfapiDatasource,service=DataSourceBinding
                 [testng]  -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
                 [testng]  -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
                 [testng] *** CONTEXTS IN ERROR: Name -> Error
                 [testng] jboss:service=invoker,type=jrmp -> ** NOT FOUND **
                 [testng]      at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
                 [testng]      at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
                 [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149)
                 [testng]      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
                 [testng]      at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
                 [testng]      at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
                 [testng]      at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1024)
                 [testng]      at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:915)
                 [testng]      at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58)
                 [testng] ... Removed 15 stack frames
                 [testng] SKIPPED CONFIGURATION: @BeforeClass setupClass
                 [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
                 [testng] SKIPPED CONFIGURATION: @AfterMethod end
                 [testng] SKIPPED CONFIGURATION: @AfterClass cleanupClass
                 [testng] SKIPPED: testPromotionDiscount
                 [testng] ===============================================
                 [testng]     PromotionDiscount Original Tests
                 [testng]     Tests run: 1, Failures: 0, Skips: 1
                 [testng]     Configuration Failures: 1, Skips: 4
                 [testng] ===============================================
                 [testng] ===============================================
                 [testng] test
                 [testng] Total tests run: 8, Failures: 0, Skips: 8
                 [testng] Configuration Failures: 1, Skips: 25
                 [testng] ===============================================
              BUILD SUCCESSFUL
              Total time: 6 seconds
              


              • 4. Re: Integration Testing - @In EntityManager
                Philip Dudley Newbie

                Please know I am still working on this but still am unable to get past the problem above. Does anyone have any ideas?


                Thank you
                Phil