11 Replies Latest reply on Jun 8, 2008 8:04 PM by Tanev Serafim

    Can't run Seam tests

    Adrien Orsier Newbie

      Hi,


      I'm trying to run tests using seam tests on my application, but I can't get it working.
      At the beginning, Seam was just telling me I was missing a testng.xml file (which is odd since it's not written you need such a file in the docs), so I used one I found in the Seam examples.
      Though, it still doesn't work, the test execution throwing me a pretty long exception:



       [testng] [Parser] Running:
         [testng]   /home/adrien/workspace/metabook/test-build/AllTest.xml
         [testng] WARN  26-02 11:05:00,955 [org.jboss.mx.loading.UnifiedLoaderRepository3.addClassLoader():713] Tried to add non-URLClassLoader.  Ignored
         [testng] ERROR 26-02 11:05:01,316 [org.jboss.dependency.plugins.AbstractController.incrementState():755] Error installing to Described: name=SARDeployer state=PreInstall
      
      ...
      
         [testng] java.  [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.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
         [testng]      at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
         [testng]      at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
         [testng]      at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
         [testng] Caused by: org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException: Entry not found with name: MainDeployer
         [testng]      at org.jboss.kernel.plugins.registry.AbstractKernelRegistry.getEntry(AbstractKernelRegistry.java:89)
         [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:143)
         [testng]      ... 29 more
         [testng] ... Removed 22 stack frames
         [testng] SKIPPED CONFIGURATION: @BeforeMethod begin
         [testng] SKIPPED CONFIGURATION: @AfterMethod end
         [testng] SKIPPED CONFIGURATION: @AfterClass cleanup
         [testng] SKIPPED: loginTestlang.RuntimeException: java.lang.reflect.UndeclaredThrowableException
      



      My xml file is pretty simple:



      <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
      
      <suite name="Metabook" verbose="2" parallel="false">
      
         <test name="Login">
           <classes>
             <class name="com.lrb.metabook.test.LoginTest"/>
           </classes>
         </test>
         
      </suite>
      


      Aswell as my test class, which is actually just trying to do a sysout at the moment:



      package com.lrb.metabook.test;
      
      public class LoginTest extends SeamTest{
           
           @Test
           public void loginTest(){
                System.out.println("test....");
           }
      }
      



      Thanks for your help!

        • 1. Re: Can't run Seam tests
          Pete Muir Master

          What version of Seam?

          • 3. Re: Can't run Seam tests
            Pete Muir Master

            How did you create your project? Seam-gen or JBoss Tools?


            Basically, you have a problem either with your /bootstrap or with your classpath order or the jars you are using. So make sure you are using the ones as created by seam-gen for each.

            • 4. Re: Can't run Seam tests
              Bolke de Bruin Newbie

              Pete,


              Could you shed a little more light on this? I am running in the exact same error and after ours of googling I cannot come up with a solution.


              The setup I am using is straight seam-gen (2.0.1GA). A ant -v test output can be found here pastebin.


              Thanks very much!

              • 5. Re: Can't run Seam tests
                Pete Muir Master

                Paste it here in a code block.

                • 6. Re: Can't run Seam tests
                  Adrien Orsier Newbie

                  Still can't get those tests working...
                  I found a topic where someone seems to meet the same problem as me (or something quite similar) that said it was maybe a jvm issue, and that switching back to 1.5 would solved it.
                  I tryed it but I still got the same problem.


                  I found out that if I wasn't extending the SeamTest class with my tests class, the tests were actually launched normally.


                  Here's a part of the stack trace I have:



                  [testng] [Parser] Running:
                     [testng]   /home/adrien/workspace/metabook/test-build/AllTest.xml
                     [testng] WARN  08-04 11:29:16,402 [org.jboss.mx.loading.UnifiedLoaderRepository3.addClassLoader():713] Tried to add non-URLClassLoader.  Ignored
                     [testng] ERROR 08-04 11:29:17,204 [org.jboss.dependency.plugins.AbstractController.incrementState():755] Error installing to Configured: name=ResourcesToDeploy state=Instantiated
                     [testng] java.lang.IllegalArgumentException: Wrong arguments. setMainDeployer for target org.jboss.embedded.DeploymentScanner@504ec1 expected=[org.jboss.deployers.client.spi.main.MainDeployer] actual=[org.jboss.deployers.plugins.deployment.MainDeployerImpl]
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:356)
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:60)
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
                     [testng]      at org.jboss.beans.info.plugins.AbstractPropertyInfo.set(AbstractPropertyInfo.java:182)
                     [testng]      at org.jboss.beans.info.plugins.BeanInfoUtil.set(BeanInfoUtil.java:177)
                     [testng]      at org.jboss.beans.info.plugins.AbstractBeanInfo.setProperty(AbstractBeanInfo.java:242)
                     [testng]      at org.jboss.kernel.plugins.dependency.PropertyDispatchWrapper.execute(PropertyDispatchWrapper.java:83)
                     [testng]      at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
                     [testng]      at org.jboss.kernel.plugins.dependency.ConfigureAction.dispatchSetProperty(ConfigureAction.java:108)
                     [testng]      at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:88)
                     [testng]      at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:45)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
                     [testng]      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                     [testng]      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                     [testng]      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                     [testng]      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
                     [testng]      at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
                     [testng]      at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
                     [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
                     [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.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
                     [testng]      at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
                     [testng]      at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
                     [testng]      at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
                     [testng]      at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
                     [testng]      at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
                     [testng]      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
                     [testng]      at org.testng.TestRunner.runWorkers(TestRunner.java:678)
                     [testng]      at org.testng.TestRunner.privateRun(TestRunner.java:624)
                     [testng]      at org.testng.TestRunner.run(TestRunner.java:495)
                     [testng]      at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
                     [testng]      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
                     [testng]      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
                     [testng]      at org.testng.SuiteRunner.run(SuiteRunner.java:190)
                     [testng]      at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
                     [testng]      at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
                     [testng]      at org.testng.TestNG.run(TestNG.java:699)
                     [testng]      at org.testng.TestNG.privateMain(TestNG.java:824)
                     [testng]      at org.testng.TestNG.main(TestNG.java:802)
                     [testng] ERROR 08-04 11:29:17,242 [org.jboss.dependency.plugins.AbstractController.incrementState():755] Error installing to Start: name=UserTransaction state=Create
                     [testng] java.lang.RuntimeException: Unable to locate the transaction manager
                     [testng]      at org.jboss.tm.TransactionManagerLocator.locate(TransactionManagerLocator.java:105)
                     [testng]      at org.jboss.ejb3.tx.TxUtil.getTransactionManager(TxUtil.java:56)
                     [testng]      at org.jboss.embedded.adapters.LocalOnlyUserTransaction.start(LocalOnlyUserTransaction.java:69)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56)
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110)
                     [testng]      at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
                     [testng]      at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
                     [testng]      at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
                     [testng]      at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
                     [testng]      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                     [testng]      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                     [testng]      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                     [testng]      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
                     [testng]      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
                     [testng]      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
                     [testng]      at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
                     [testng]      at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
                     [testng]      at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
                     [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.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
                     [testng]      at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
                     [testng]      at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
                     [testng]      at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                     [testng]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                     [testng]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                     [testng]      at java.lang.reflect.Method.invoke(Method.java:585)
                     [testng]      at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:604)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:394)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
                     [testng]      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:79)
                     [testng]      at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:165)
                     [testng]      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
                     [testng]      at org.testng.TestRunner.runWorkers(TestRunner.java:678)
                     [testng]      at org.testng.TestRunner.privateRun(TestRunner.java:624)
                     [testng]      at org.testng.TestRunner.run(TestRunner.java:495)
                     [testng]      at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
                     [testng]      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
                     [testng]      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
                     [testng]      at org.testng.SuiteRunner.run(SuiteRunner.java:190)
                     [testng]      at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
                     [testng]      at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
                     [testng]      at org.testng.TestNG.run(TestNG.java:699)
                     [testng]      at org.testng.TestNG.privateMain(TestNG.java:824)
                     [testng]      at org.testng.TestNG.main(TestNG.java:802)
                     [testng] ERROR 08-04 11:29:17,283 [org.jboss.dependency.plugins.AbstractController.incrementState():755] Error installing to Configured: name=ResourcesToDeploy2 state=Instantiated
                     [testng] java.lang.IllegalArgumentException: Wrong arguments. setMainDeployer for target org.jboss.embedded.DeploymentScanner@91f005 expected=[org.jboss.deployers.client.spi.main.MainDeployer] actual=[org.jboss.deployers.plugins.deployment.MainDeployerImpl]
                     [testng]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:356)


                  • 7. Re: Can't run Seam tests
                    Adrien Orsier Newbie

                    Actually, starting again from a brand new project from Seam-gen (seam 2.02), it seems to work, although I had to kill jboss to have  the 3873 port available (not a big deal though).
                    It seems that it actually was the java version which was bad, though now I have to get it working with my current application.

                    • 8. Re: Can't run Seam tests
                      Pete Muir Master

                      Adrien Orsier wrote on Apr 08, 2008 03:12 PM:

                      although I had to kill jboss to have  the 3873 port available (not a big deal though).


                      JBSEAM-2813

                      • 9. Re: Can't run Seam tests
                        Adrien Orsier Newbie

                        That's a good thing, but I still can't figure out why my tests aren't working in my current application (see the stack trace above).
                        I guess this line is rather explicit for someone who knows more about Seam tests than I do:



                          [testng] ERROR 08-04 11:29:17,204 [org.jboss.dependency.plugins.AbstractController.incrementState():755] Error installing to Configured: name=ResourcesToDeploy state=Instantiated
                           [testng] java.lang.IllegalArgumentException: Wrong arguments. setMainDeployer for target org.jboss.embedded.DeploymentScanner@504ec1 expected=[org.jboss.deployers.client.spi.main.MainDeployer] actual=[org.jboss.deployers.plugins.deployment.MainDeployerImpl]
                           [testng]      at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:356)


                        • 10. Re: Can't run Seam tests
                          Adrien Orsier Newbie

                          Just a short answer to say Pete was right, it was just my /bootstrap directoy that wasn't updated.
                          It now works perfectly.

                          • 11. Re: Can't run Seam tests
                            Tanev Serafim Newbie

                            How can I upload my bootstrap Folder? I have too this Problem with SeamTest :(



                            D:\Semester2008SS\ASEngineering\Workspace2\athletica\src\test\Test.xml]
                               [testng] ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=ServerConfig state=PreInstall
                               [testng] java.lang.NoClassDefFoundError: Lorg/jboss/system/server/BaseServerConfig;

                            where I can put Jboss-system.jar ?


                                    by reason of:

                            "It's very important you don't put the compile time JBoss AS dependencies from lib/
                            (e.g. jboss-system.jar) on the classpath, these will cause Embedded JBoss to not
                            boot. So, just add the dependencies (e.g. Drools, jBPM)you need as you go."
                            ^^