1 Reply Latest reply on Dec 14, 2009 4:49 AM by xsalefter.xsalefter.yahoo.com

    Seam Component Test Doesn't Work in Seam 2.2.0 GA

    xsalefter.xsalefter.yahoo.com

      Hi seam users..


      I have some problem to run Seam Component Test in Seam 2.2.0 GA. FYI, I have do something like this in previous seam release (2.1.2 CR1) and run well.


      Lets say that I create Seam Test called EntityClassesAsComponentTest:



      public class EntityClassesAsComponentTest extends SeamTest {
      
        @SuppressWarnings("unchecked")
        @Test
        public void testCategoryComponentEntity() throws Exception {
          new ComponentTest() {
          @Override
          protected void testComponents() throws Exception {
          EntityManager em = (EntityManager) getInstance("entityManager");
          assert em != null;
      
          List<Category> list = 
          em.createQuery("from Category").getResultList();
      
          for (Category category : list) {
            System.out.println
            ("----------> Category : " + category.getId()category.getName());
          }
          assert list.size() == 3;
          }
          };
        }
      }



      and the xml configuration:



      <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
      <suite name="Simple Sales Test Suite" verbose="2" parallel="false">
      
         <test name="EntityClassesAsComponentTest - Test all entity classes as component application.">
           <classes>
             <class name="com.xl.simplesales.test.component.entity.EntityClassesAsComponentTest" />
           </classes>
         </test>
           
      </suite>



      Then im craeted the data source config in bootstrap/deploy called:


      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE datasources
          PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
          "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
      <datasources>
         
         <local-tx-datasource>
            <jndi-name>DefaultDS</jndi-name>
            <use-java-context>false</use-java-context>
            <connection-url>jdbc:mysql:///simplesales_test</connection-url>
            <driver-class>com.mysql.jdbc.Driver</driver-class>
            <user-name>root</user-name>
            <password>admin</password>
         </local-tx-datasource>
          
      </datasources>
      



      Then I got the following error:


      [testng] [Parser] Running:
         [testng]   E:\JavaPlatform\IDEProject\Eclipse\Seam\220GA\simplesales\test-build\BeanClassesTest.xml
         [testng]   E:\JavaPlatform\IDEProject\Eclipse\Seam\220GA\simplesales\test-build\EntitiesTest.xml
         [testng]   E:\JavaPlatform\IDEProject\Eclipse\Seam\220GA\simplesales\test-build\EntityClassesAsComponentTest.xml
         [testng]   E:\JavaPlatform\IDEProject\Eclipse\Seam\220GA\simplesales\test-build\EntityClassesTest.xml
         [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=DefaultDS,service=DataSourceBinding
         [testng]  -> jboss:service=invoker,type=jrmp{Start:** NOT FOUND **}
         [testng]  -> jboss:service=invoker,type=jrmp{Create:** NOT FOUND **}
         [testng] jboss.jca:name=JmsXA,service=ConnectionFactoryBinding
         [testng]  -> jboss.jca:name=JmsXA,service=TxCM{Start:Configured}
         [testng]  -> jboss.jca:name=JmsXA,service=TxCM{Create:Configured}
         [testng] jboss.jca:name=JmsXA,service=ManagedConnectionFactory
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng] jboss.jca:name=JmsXA,service=ManagedConnectionPool
         [testng]  -> jboss.jca:name=JmsXA,service=ManagedConnectionFactory{Create:Configured}
         [testng]  -> jboss.jca:name=JmsXA,service=ManagedConnectionFactory{Start:Configured}
         [testng] jboss.jca:name=JmsXA,service=TxCM
         [testng]  -> jboss.jca:name=JmsXA,service=ManagedConnectionPool{Start:Configured}
         [testng]  -> jboss.jca:name=JmsXA,service=ManagedConnectionPool{Create:Configured}
         [testng] jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Create:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Start:Configured}
         [testng] jboss.messaging.connectionfactory:service=ClusteredConnectionFactory
         [testng]  -> jboss.messaging:service=PostOffice{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Create:Configured}
         [testng] jboss.messaging.connectionfactory:service=ConnectionFactory
         [testng]  -> jboss.messaging:service=PostOffice{Start:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Create:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng] jboss.messaging.destination:name=DLQ,service=Queue
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Create:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng] jboss.messaging.destination:name=ExpiryQueue,service=Queue
         [testng]  -> jboss.messaging:service=PostOffice{Start:Configured}
         [testng]  -> jboss.messaging:service=PostOffice{Create:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng] jboss.messaging:service=JMSUserManager
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:Configured}
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:Configured}
         [testng] jboss.messaging:service=PersistenceManager
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:Configured}
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:Configured}
         [testng] jboss.messaging:service=PostOffice
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Create:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.jca:name=DefaultDS,service=DataSourceBinding{Start:Configured}
         [testng] jboss.messaging:service=ServerPeer
         [testng]  -> jboss.messaging:service=JMSUserManager{Create:Configured}
         [testng]  -> jboss.messaging:service=PersistenceManager{Start:Configured}
         [testng]  -> jboss.messaging:service=PersistenceManager{Create:Configured}
         [testng]  -> jboss.messaging:service=JMSUserManager{Start:Configured}
         [testng] jboss.mq:service=DestinationManager
         [testng]  -> jboss.messaging:service=ServerPeer{Start:Configured}
         [testng]  -> jboss.messaging:service=ServerPeer{Create:Configured}
         [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: @BeforeMethod begin
         [testng] SKIPPED CONFIGURATION: @AfterMethod end
         [testng] SKIPPED CONFIGURATION: @AfterClass cleanupClass
         [testng] SKIPPED: testSaleDetailHomeClass
         [testng] SKIPPED: testAuthenticatorClass
         [testng] ===============================================
         [testng]     BeanClassesTest - Test all non entity classes.
         [testng]     Tests run: 2, Failures: 0, Skips: 2
         [testng]     Configuration Failures: 1, Skips: 6
         [testng] ===============================================
         [testng] ===============================================
         [testng] Simple Sales Test Suite
         [testng] Total tests run: 2, Failures: 0, Skips: 2
         [testng] Configuration Failures: 1, Skips: 7
         [testng] ===============================================
         [testng] FAILED CONFIGURATION: @BeforeSuite startSeam
         [testng] java.lang.RuntimeException: Unable to bootstrap: 
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147)
         [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] Caused by: java.lang.IllegalStateException: ServerConfig is already installed.
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:525)
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
         [testng]      at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:141)
         [testng]      ... 21 more
         [testng] ... Removed 15 stack frames
         [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: @AfterClass cleanupClass
         [testng] SKIPPED: testSaleEntity
         [testng] SKIPPED: testProductEntity
         [testng] SKIPPED: testCategoryEntity
         [testng] ===============================================
         [testng]     EntitiesTest
         [testng]     Tests run: 3, Failures: 0, Skips: 3
         [testng]     Configuration Failures: 1, Skips: 8
         [testng] ===============================================
         [testng] ===============================================
         [testng] Simple Sales Test Suite
         [testng] Total tests run: 3, Failures: 0, Skips: 3
         [testng] Configuration Failures: 1, Skips: 9
         [testng] ===============================================
         [testng] FAILED CONFIGURATION: @BeforeSuite startSeam
         [testng] java.lang.RuntimeException: Unable to bootstrap: 
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147)
         [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] Caused by: java.lang.IllegalStateException: ServerConfig is already installed.
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:525)
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
         [testng]      at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:141)
         [testng]      ... 21 more
         [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: testCategoryComponentEntity
         [testng] ===============================================
         [testng]     EntityClassesAsComponentTest - Test all entity classes as component application.
         [testng]     Tests run: 1, Failures: 0, Skips: 1
         [testng]     Configuration Failures: 1, Skips: 4
         [testng] ===============================================
         [testng] ===============================================
         [testng] Simple Sales Test Suite
         [testng] Total tests run: 1, Failures: 0, Skips: 1
         [testng] Configuration Failures: 1, Skips: 5
         [testng] ===============================================
         [testng] FAILED CONFIGURATION: @BeforeSuite startSeam
         [testng] java.lang.RuntimeException: Unable to bootstrap: 
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:147)
         [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] Caused by: java.lang.IllegalStateException: ServerConfig is already installed.
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:525)
         [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
         [testng]      at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:96)
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:141)
         [testng]      ... 21 more
         [testng] ... Removed 15 stack frames
         [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: @AfterClass cleanupClass
         [testng] SKIPPED: testSaleEntity
         [testng] SKIPPED: testCategoryEntity
         [testng] SKIPPED: testProductEntity
         [testng] ===============================================
         [testng]     EntityClassesTest - Test all entity classes.
         [testng]     Tests run: 3, Failures: 0, Skips: 3
         [testng]     Configuration Failures: 1, Skips: 8
         [testng] ===============================================
         [testng] ===============================================
         [testng] Simple Sales Test Suite
         [testng] Total tests run: 3, Failures: 0, Skips: 3
         [testng] Configuration Failures: 1, Skips: 9
         [testng] ===============================================
      



      Can someone help me to resolve this problem? I get stuck for this night and have no idea about this problem.


      Thanks before.