2 Replies Latest reply on Mar 4, 2008 6:57 AM by maxandersen

    Runnigs test

    hispeedsurfer

      Hi,

      I have problem to runnig tests inside a Seam Web Project using the JBoss Tools IDE.

      Environment: JBoss Tools 2.0.GA, Seam 2.0.1.GA

      When I create a new Seam Web (ear)Project with a simple Seam Action and try to run TestNG test as discriped in 'Seam Dev Tools Reference Guide' the first excetion is

      [Parser] Running:
       V:\workspaces\datenvisualisierung\testproject-test\test-src\org\domain\testproject\test\ActionTest.xml
      
      WARN [org.jboss.seam.init.Initialization] Did not install PojoCache due to NoClassDefFoundError: org/jgroups/MembershipListener
      INFO [org.ajax4jsf.cache.CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {}
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      INFO [org.ajax4jsf.cache.CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {}
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      FAILED CONFIGURATION: @BeforeMethod begin
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
       at org.jboss.seam.Component.newInstance(Component.java:1970)
       at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
       at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
       at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:191)
       at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
       at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:912)
       at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
      Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
       at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:152)
       at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)
       at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:117)
       at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94)
       at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:40)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
       at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
       at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
       at org.jboss.seam.Component.newInstance(Component.java:1976)
       at org.jboss.seam.Component.getInstance(Component.java:1873)
       at org.jboss.seam.Component.getInstance(Component.java:1840)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
       at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
       at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
       at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
       at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2360)
       at org.jboss.seam.Component.initialize(Component.java:1389)
       at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
       at org.jboss.seam.Component.instantiate(Component.java:1268)
       at org.jboss.seam.Component.newInstance(Component.java:1966)
       ... 30 more
      Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
       at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:93)
       at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:54)
       at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:148)
       ... 58 more
      ... Removed 28 stack frames
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @AfterClass cleanup
      SKIPPED: test
      
      ===============================================
       Action Test
       Tests run: 1, Failures: 0, Skips: 1
       Configuration Failures: 1, Skips: 2
      ===============================================
      
      
      ===============================================
      Action Tests
      Total tests run: 1, Failures: 0, Skips: 1
      Configuration Failures: 1, Skips: 2
      ===============================================
      

      After this i putted org.eclipse.jdt.core_3.3.1.v_780_R33x.jar from Eclipse installation to classpath and the following error occurs:
      [Parser] Running:
       V:\workspaces\datenvisualisierung\testproject-test\test-src\org\domain\testproject\test\ActionTest.xml
      
      WARN [org.jboss.seam.init.Initialization] Did not install PojoCache due to NoClassDefFoundError: org/jgroups/MembershipListener
      INFO [org.ajax4jsf.cache.CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {}
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      INFO [org.ajax4jsf.cache.CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {}
      INFO [org.ajax4jsf.cache.LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      FAILED CONFIGURATION: @BeforeMethod begin
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
       at org.jboss.seam.Component.newInstance(Component.java:1970)
       at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
       at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
       at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:191)
       at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
       at org.jboss.seam.mock.BaseSeamTest.begin(BaseSeamTest.java:912)
       at org.jboss.seam.mock.SeamTest.begin(SeamTest.java:28)
      Caused by: java.lang.IllegalStateException: could not locate rule file: /security.drl
       at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:51)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
       at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
       at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
       at org.jboss.seam.Component.newInstance(Component.java:1976)
       at org.jboss.seam.Component.getInstance(Component.java:1873)
       at org.jboss.seam.Component.getInstance(Component.java:1840)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
       at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
       at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:166)
       at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
       at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
       at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2360)
       at org.jboss.seam.Component.initialize(Component.java:1389)
       at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
       at org.jboss.seam.Component.instantiate(Component.java:1268)
       at org.jboss.seam.Component.newInstance(Component.java:1966)
       ... 30 more
      ... Removed 28 stack frames
      SKIPPED CONFIGURATION: @AfterMethod end
      SKIPPED CONFIGURATION: @AfterClass cleanup
      SKIPPED: test
      
      ===============================================
       Action Test
       Tests run: 1, Failures: 0, Skips: 1
       Configuration Failures: 1, Skips: 2
      ===============================================
      
      
      ===============================================
      Action Tests
      Total tests run: 1, Failures: 0, Skips: 1
      Configuration Failures: 1, Skips: 2
      ===============================================


      Than I removed securityRules from component.xml and all is ok
      <!--drools:rule-base name="securityRules">
       <drools:rule-files>
       <value>/security.drl</value>
       </drools:rule-files>
       </drools:rule-base-->
      
       <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>


      Is this a kown problem or what's wrong in my case?

        • 1. Re: Runnigs test
          hispeedsurfer

          Ok, have seen this issue in jira: JBIDE-1478

          But I have another problem using tests:

          On startup I use @Observer("org.jboss.seam.postInitialization") to check some tasks like scheduling jobs(quartz), putting a message to queue using a mdb etc.

          I don't use this class in my test but I receive an exception:

          [Parser] Running:
           V:\workspaces\datenvisualisierung\datenvisualisierung-test\test-src\de\oats\datenvisualisierung\test\AlltestTest.xml
          
          WARN [org.jboss.seam.init.Initialization] Did not install PojoCache due to NoClassDefFoundError: org/jgroups/MembershipListener
          INFO [org.quartz.simpl.SimpleThreadPool] Job execution threads will use class loader of thread: main
          INFO [org.quartz.core.QuartzScheduler] Quartz Scheduler v.1.5.2 created.
          INFO [org.quartz.simpl.RAMJobStore] RAMJobStore initialized.
          INFO [org.quartz.impl.StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
          INFO [org.quartz.impl.StdSchedulerFactory] Quartz scheduler version: 1.5.2
          INFO [org.quartz.core.QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
          FAILED CONFIGURATION: @BeforeClass init
          javax.ejb.EJBException: java.lang.RuntimeException: exception invoking: init
           at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
           at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:193)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:86)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:166)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:261)
           at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
           at $Proxy98.observe(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:41)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
           at org.javassist.tmp.java.lang.Object_$$_javassist_0.observe(Object_$$_javassist_0.java)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.core.Events.raiseEvent(Events.java:84)
           at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:97)
           at org.jboss.seam.init.Initialization.init(Initialization.java:583)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:939)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
          Caused by: java.lang.RuntimeException: exception invoking: init
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:135)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
           at org.jboss.seam.Component.newInstance(Component.java:1976)
           at org.jboss.seam.Component.getInstance(Component.java:1873)
           at org.jboss.seam.Component.getInstance(Component.java:1840)
           at org.jboss.seam.Component.getInstance(Component.java:1819)
           at org.jboss.seam.Component.getInstance(Component.java:1814)
           at org.jboss.seam.jms.QueueConnection.instance(QueueConnection.java:75)
           at org.jboss.seam.jms.QueueSession.create(QueueSession.java:38)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
           at org.jboss.seam.Component.newInstance(Component.java:1976)
           at org.jboss.seam.Component.getInstance(Component.java:1873)
           at org.jboss.seam.Component.getInstance(Component.java:1840)
           at org.jboss.seam.Component.getInstance(Component.java:1819)
           at org.jboss.seam.Component.getInstance(Component.java:1814)
           at org.jboss.seam.jms.QueueSession.instance(QueueSession.java:55)
           at org.jboss.seam.jms.ManagedQueueSender.create(ManagedQueueSender.java:51)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
           at org.jboss.seam.Component.newInstance(Component.java:1976)
           at org.jboss.seam.Component.getInstance(Component.java:1873)
           at org.jboss.seam.Component.getInstance(Component.java:1840)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
           at org.jboss.seam.Component.getValueToInject(Component.java:2134)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:48)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:26)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:27)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
           at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
           at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
           at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
           ... 65 more
          Caused by: javax.naming.NameNotFoundException: UIL2ConnectionFactory not bound
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:542)
           at org.jnp.server.NamingServer.getBinding(NamingServer.java:550)
           at org.jnp.server.NamingServer.getObject(NamingServer.java:556)
           at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:669)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:629)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at org.jboss.seam.jms.QueueConnection.getQueueConnectionFactory(QueueConnection.java:64)
           at org.jboss.seam.jms.QueueConnection.init(QueueConnection.java:51)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           ... 132 more
          ... Removed 46 stack frames
          SKIPPED CONFIGURATION: @BeforeMethod begin
          SKIPPED CONFIGURATION: @AfterMethod end
          SKIPPED CONFIGURATION: @BeforeMethod begin
          SKIPPED CONFIGURATION: @AfterMethod end
          SKIPPED CONFIGURATION: @AfterClass cleanup
          SKIPPED: logintest
          SKIPPED: testLoginComponent
          
          ===============================================
           Logintest Test
           Tests run: 2, Failures: 0, Skips: 2
           Configuration Failures: 1, Skips: 5
          ===============================================


          here the content of service xml file under project/ejbModule
          <?xml version="1.0" encoding="UTF-8"?>
          <server>
           <mbean code="org.jboss.mq.server.jmx.Queue"
           name="jboss.mq.destination:service=Queue,name=oatsMessageQueue">
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
           <attribute name="JNDIName">queue/oatsMessageQueue</attribute>
           </mbean>
          </server>

          Is there a workaround or have I to remove the corresponding class each time testing my project.

          Sorry for my spelling mistake on topic and content of previous post ;)

          • 2. Re: Runnigs test
            maxandersen

            I think the last question is more apropriate on the seam forum.