1 Reply Latest reply on Jan 29, 2008 6:30 AM by Pete Muir

    Integration Testing problems with Seam 2.0.0GA

    Jeff Skjonsby Newbie

      I am trying to get testing to work in a seam-gen created project, and keep having the same problem that I cannot figure out. I've tried using the new beta 3 embedded JBoss container and using the bootstrap configuration from the examples (which work fine) but it doesn't work still. I've tried the Sun 1.5/1.6 JDKs and the BEA JRockit 1.5 jvm. I've been searching the forums for the last several days and tried everything I could find, but nothing changes anything other than JDK 1.6 which has the class loader problem. Any help is appreciated, I'm new to Seam and I've been tearing my hair out trying to figure this one out. Thanks.


      Here's the error output:

      test:
       [testng] [Parser] Running:
       [testng] E:\Programming\g2d\test-build\testng.xml
       [testng]
       [testng] WARN 26-01 20:29:36,994 (UnifiedLoaderRepository3.java:addClassLoader:713) -Tried to add non-URLClassLoader. Ignored
       [testng] INFO 26-01 20:29:38,037 (TransactionManagerService.java:startService:127) -JBossTS Transaction Service (JTA version) - JBoss Inc.
       [testng] INFO 26-01 20:29:38,038 (TransactionManagerService.java:startService:129) -Setting up property manager MBean and JMX layer
       [testng] WARN 26-01 20:29:38,113 (TxControl.java:<clinit>:302)
      -[com.arjuna.ats.arjuna.coordinator.TxControl_1] - Name of XA node not defined. Using -3f57ff61:d9f7:479c08b2:0
       [testng] INFO 26-01 20:29:38,149 (TransactionStatusManager.java:addService:110) -[com.arjuna.ats.arjuna.recovery.TransactionStatusManager_1] - Starting service com.arjuna.ats.arjuna.recovery.ActionStatusService on port 55799
       [testng] INFO 26-01 20:29:38,155 (?:?:?) -TransactionStatusManagerItem - host: 192.168.0.159 port: 55799
       [testng] INFO 26-01 20:29:38,185 (TransactionStatusManager.java:start:161) -[com.arjuna.ats.arjuna.recovery.TransactionStatusManager_3] - TransactionStatusManager started on port 55799 with service com.arjuna.ats.arjuna.recovery.ActionStatusService
       [testng] INFO 26-01 20:29:38,193 (?:?:?) -Registering mbean for module 'arjuna'
       [testng] INFO 26-01 20:29:38,197 (?:?:?) -Initialising JMX agent com.arjuna.ats.internal.jbossatx.agent.LocalJBossAgentImpl
       [testng] INFO 26-01 20:29:38,222 (TransactionManagerService.java:startService:167) -Starting recovery manager
       [testng] INFO 26-01 20:29:38,230 (?:?:?) -
       [testng] --- Start RecoveryActivators
       [testng] INFO 26-01 20:29:38,240 (RecoveryManagerImple.java:<init>:142)
      -[com.arjuna.ats.internal.arjuna.recovery.ready] RecoveryManagerImple is ready on port 55,800
       [testng] INFO 26-01 20:29:38,241 (TransactionManagerService.java:startService:172) -Recovery manager started
       [testng] INFO 26-01 20:29:38,242 (TransactionManagerService.java:startService:195) -Binding TransactionManager JNDI Reference
       [testng] WARN 26-01 20:29:38,594 (AspectManagerService.java:baseAop:228) -Could not find base-aspects.xml file in the resources of sun.misc.Launcher$AppClassLoader@2c8a1b
       [testng] INFO 26-01 20:29:39,579 (AspectDeployer.java:deployXml:151) -Deploying xml into org.jboss.aop.AspectManager@74a9fc for sun.misc.Launcher$AppClassLoader@2c8a1b
       [testng] INFO 26-01 20:29:40,242 (RARDeployment.java:startService:146) -Required license terms exist, view vfsfile:/E:/Programming/g2d/bootstrap/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
       [testng] INFO 26-01 20:29:40,288 (ConnectionFactoryBindingService.java:bindConnectionFactory:160) -Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
       [testng] INFO 26-01 20:29:40,291 (RARDeployment.java:startService:146) -Required license terms exist, view vfsfile:/E:/Programming/g2d/bootstrap/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
       [testng] INFO 26-01 20:29:40,297 (RARDeployment.java:startService:146) -Required license terms exist, view vfsfile:/E:/Programming/g2d/bootstrap/deploy/jms-ra.rar/META-INF/ra.xml
       [testng] WARN 26-01 20:29:41,032 (SecurityMetadataStore.java:checkDefaultSuckerPassword:311) -WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
       [testng] INFO 26-01 20:29:41,070 (ServerPeer.java:startService:312) -JBoss Messaging 1.4.0.SP1 server [0] started
       [testng] INFO 26-01 20:29:41,167 (ConnectionFactory.java:startService:224) -Connector bisocket://Uber-Desktop:4457 has leasing enabled, lease period 10000 milliseconds
       [testng] INFO 26-01 20:29:41,168 (ConnectionFactory.java:startService:225) -org.jboss.jms.server.connectionfactory.ConnectionFactory@574e55 started
       [testng] INFO 26-01 20:29:41,224 (QueueService.java:startService:141) -Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
       [testng] INFO 26-01 20:29:41,231 (ConnectionFactory.java:startService:224) -Connector bisocket://Uber-Desktop:4457 has leasing enabled, lease period 10000 milliseconds
       [testng] INFO 26-01 20:29:41,232 (ConnectionFactory.java:startService:225) -org.jboss.jms.server.connectionfactory.ConnectionFactory@527b36 started
       [testng] INFO 26-01 20:29:41,234 (QueueService.java:startService:141) -Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
       [testng] WARN 26-01 20:29:41,236 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:155) -supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
       [testng] WARN 26-01 20:29:41,237 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:161) -supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
       [testng] INFO 26-01 20:29:41,238 (ConnectionFactory.java:startService:224) -Connector bisocket://Uber-Desktop:4457 has leasing enabled, lease period 10000 milliseconds
       [testng] INFO 26-01 20:29:41,240 (ConnectionFactory.java:startService:225) -org.jboss.jms.server.connectionfactory.ConnectionFactory@55da18 started
       [testng] INFO 26-01 20:29:41,244 (ConnectionFactoryBindingService.java:bindConnectionFactory:160) -Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
       [testng] INFO 26-01 20:29:41,330 (PersistenceUnitParsingDeployer.java:parse:115) -Found persistence units [org.jboss.ejb3.metadata.jpa.spec.PersistenceUnitMetaData@5e2a2f{name=g2d}]
       [testng] WARN 26-01 20:29:41,565 (CollectionPropertyHandler.java:<init>:92)
      -ClassInfo.getDeclaredConstructor(null) didn't work for org.jboss.metadata.ejb.spec.InterceptorClassesMetaData, found the default ctor in ClassInfo.getDeclaredConstructors()
       [testng] INFO 26-01 20:29:42,008 (MCKernelAbstraction.java:install:124) -installing bean: persistence.units:jar=test-build.jar,unitName=g2d with dependencies:
       [testng] INFO 26-01 20:29:42,008 (MCKernelAbstraction.java:install:138) - and supplies:
       [testng] INFO 26-01 20:29:42,074 (MCKernelAbstraction.java:install:124) -installing bean: jboss.j2ee:jar=test-build,name=ManagerAction,service=EJB3 with dependencies:
       [testng] INFO 26-01 20:29:42,074 (MCKernelAbstraction.java:install:138) - and supplies:
       [testng] INFO 26-01 20:29:42,076 (MCKernelAbstraction.java:install:141) - Class:com.grocery2dinner.actions.Manager
       [testng] INFO 26-01 20:29:42,152 (MCKernelAbstraction.java:install:124) -installing bean: jboss.j2ee:jar=test-build,name=ROTDAction,service=EJB3 with dependencies:
       [testng] INFO 26-01 20:29:42,153 (MCKernelAbstraction.java:install:138) - and supplies:
       [testng] INFO 26-01 20:29:42,154 (MCKernelAbstraction.java:install:141) - Class:com.grocery2dinner.actions.ROTD
       [testng] INFO 26-01 20:29:42,157 (MCKernelAbstraction.java:install:124) -installing bean: jboss.j2ee:jar=test-build,name=SearchAction,service=EJB3 with dependencies:
       [testng] INFO 26-01 20:29:42,157 (MCKernelAbstraction.java:install:138) - and supplies:
       [testng] INFO 26-01 20:29:42,158 (MCKernelAbstraction.java:install:141) - Class:com.grocery2dinner.actions.Search
       [testng] INFO 26-01 20:29:42,159 (MCKernelAbstraction.java:install:124) -installing bean: jboss.j2ee:jar=test-build,name=UserManagerAction,service=EJB3 with dependencies:
       [testng] INFO 26-01 20:29:42,160 (MCKernelAbstraction.java:install:138) - and supplies:
       [testng] INFO 26-01 20:29:42,160 (MCKernelAbstraction.java:install:141) - Class:com.grocery2dinner.actions.UserManager
       [testng] FAILED CONFIGURATION: @BeforeClass init
       [testng] org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
       [testng]
       [testng] *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
       [testng]
       [testng] jboss.j2ee:jar=test-build,name=ManagerAction,service=EJB3
       [testng] -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=test-build.jar,unitName=g2d **}
       [testng]
       [testng] jboss.j2ee:jar=test-build,name=ROTDAction,service=EJB3
       [testng] -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=test-build.jar,unitName=g2d **}
       [testng]
       [testng] jboss.j2ee:jar=test-build,name=SearchAction,service=EJB3
       [testng] -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=test-build.jar,unitName=g2d **}
       [testng]
       [testng] jboss.j2ee:jar=test-build,name=UserManagerAction,service=EJB3
       [testng] -> <UNKNOWN>{Described:** UNRESOLVED Demands 'persistence.units:jar=test-build.jar,unitName=g2d **}
       [testng]
       [testng] persistence.units:jar=test-build.jar,unitName=g2d
       [testng] -> <UNKNOWN>{Described:** UNRESOLVED Demands 'jboss.jca:name=g2dDatasource,service=DataSourceBinding **}
       [testng]
       [testng]
       [testng] *** CONTEXTS IN ERROR: Name -> Error
       [testng]
       [testng] <UNKNOWN> -> ** UNRESOLVED Demands 'jboss.jca:name=g2dDatasource,service=DataSourceBinding **
       [testng]
       [testng]
       [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.DeploymentGroup.process(DeploymentGroup.java:128)
       [testng] at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289)
       [testng] at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:14)
       [testng] at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1006)
       [testng] at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:931)
       [testng] at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
       [testng] ... Removed 22 stack frames
       [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
       [testng] SKIPPED CONFIGURATION: @AfterMethod end
       [testng] SKIPPED CONFIGURATION: @AfterClass cleanup
       [testng] SKIPPED: testUserManager
       [testng]
       [testng] ===============================================
       [testng] Actions
       [testng] Tests run: 1, Failures: 0, Skips: 1
       [testng] Configuration Failures: 1, Skips: 3
       [testng] ===============================================
       [testng]
       [testng] PASSED: findBlankStrings
       [testng]
       [testng] ===============================================
       [testng] Utils
       [testng] Tests run: 1, Failures: 0, Skips: 0
       [testng] ===============================================
       [testng]
       [testng]
       [testng] ===============================================
       [testng] Grocery2DinnerTest
       [testng] Total tests run: 2, Failures: 0, Skips: 1
       [testng] Configuration Failures: 1, Skips: 3
       [testng] ===============================================
      



      Here's my persistence.xml:
      <persistence-unit name="g2d">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/g2dDatasource</jta-data-source>
      
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
       <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
       <property name="hibernate.cache.use_query_cache" value="true"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.jdbc.batch_size" value="0"/>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/g2dEntityManagerFactory"/>
       </properties>
       </persistence-unit>
      


      Here's my components.xml:
      <core:init debug="true" jndi-pattern="@jndiPattern@"/>
      
       <core:manager concurrent-request-timeout="500"
       conversation-timeout="120000"
       conversation-id-parameter="cid"/>
      
       <persistence:managed-persistence-context name="entityManager"
       auto-create="true"
       persistence-unit-jndi-name="java:/g2dEntityManagerFactory"/>
      


      Here's my test:
      package com.grocery2dinner.action;
      
      import org.jboss.seam.mock.SeamTest;
      import org.testng.annotations.Test;
      
      import com.grocery2dinner.model.Recipe;
      import static org.testng.AssertJUnit.assertNotNull;
      
      public class UserManagerTest extends SeamTest
      {
       @Test
       public void testUserManager() throws Exception
       {
       new NonFacesRequest()
       {
       @Override
       protected void renderResponse()
       {
       Recipe rotd = (Recipe) getValue("#{rotd}");
       assertNotNull("rotd", rotd);
       }
       }.run();
       }
      }