6 Replies Latest reply on Aug 9, 2008 7:59 PM by Pete Muir

    Seam testing issues

    Guillaume Jeudy Master

      Hi,


      I try to run Seam Test by extending SeamTest class and running with jboss embedded container. I use seam 2.0.1GA and I get the below stacktrace when starting up embedded container:


      ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Instantiated: name=FileStructure state=Described
      java.lang.NoSuchMethodError: javassist.scopedpool.ScopedClassPool.<init>(Ljava/lang/ClassLoader;Ljavassist/ClassPool;Ljavassist/scopedpool/ScopedClassPoolRepository;Z)V
           at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:69)
           at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:59)
           at org.jboss.aop.classpool.AOPClassPoolFactory.create(AOPClassPoolFactory.java:40)
           at javassist.scopedpool.ScopedClassPoolRepositoryImpl.createScopedClassPool(ScopedClassPoolRepositoryImpl.java:99)
           at javassist.scopedpool.ScopedClassPoolRepositoryImpl.registerClassLoader(ScopedClassPoolRepositoryImpl.java:125)
           at org.jboss.aop.classpool.AOPClassPoolRepository.registerClassLoader(AOPClassPoolRepository.java:158)
           at org.jboss.aop.AspectManager.registerClassLoader(AspectManager.java:721)
           at org.jboss.aop.AspectManager.findClassPool(AspectManager.java:709)
           at org.jboss.aop.proxy.container.ContainerProxyFactory.createProxyCtClass(ContainerProxyFactory.java:187)
           at org.jboss.aop.proxy.container.ContainerProxyFactory.createProxyCtClass(ContainerProxyFactory.java:171)
           at org.jboss.aop.proxy.container.ContainerProxyFactory.generateProxy(ContainerProxyFactory.java:143)
           at org.jboss.aop.proxy.container.ContainerProxyFactory.getProxyClass(ContainerProxyFactory.java:133)
           at org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.generateProxy(GeneratedAOPProxyFactory.java:130)
           at org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.getProxy(GeneratedAOPProxyFactory.java:116)
           at org.jboss.aop.proxy.container.GeneratedAOPProxyFactory.createAdvisedProxy(GeneratedAOPProxyFactory.java:85)
           at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:87)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214)
           at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69)
           at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:53)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135)
           at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46)
           at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
           at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
           at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
           at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
           at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
           at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574)
           at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279)
           at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
           at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
           at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130)
           at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142)
           at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183)
           at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195)
           at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
           at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:1041)
           at org.jboss.seam.mock.BaseSeamTest.startSeam(BaseSeamTest.java:935)
           at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:923)
           at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
           at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145)
           at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82)
           at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:167)
           at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
           at org.testng.TestRunner.runWorkers(TestRunner.java:712)
           at org.testng.TestRunner.privateRun(TestRunner.java:582)
           at org.testng.TestRunner.run(TestRunner.java:477)
           at org.testng.SuiteRunner.runTest(SuiteRunner.java:324)
           at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:319)
           at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
           at org.testng.SuiteRunner.run(SuiteRunner.java:198)
           at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823)
           at org.testng.TestNG.runSuitesLocally(TestNG.java:790)
           at org.testng.TestNG.run(TestNG.java:708)
           at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
           at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      ERROR [org.jboss.embedded.DeploymentScanner] Failed to deploy
      org.jboss.deployers.spi.DeploymentException: No deployer recognised the structure of vfsfile:/C:/gjeudy/workspace/rdm/rdm-service/src/test/embedded/bootstrap/conf/jboss-service.xml



      I followed instructions in the following link but can't figure out what is wrong:


      Seam testing config

        • 1. Re: Seam testing issues
          System Administrator Expert

          I am having a similar problem (getting errors when I run my integration test).


          Buildfile: C:\projects\SHIMS\build.xml
          compiletest:
          copytestclasses:
          buildtest:
               [copy] Copying 1 file to C:\projects\SHIMS\test-build\META-INF
               [copy] Copying 1 file to C:\projects\SHIMS\test-build
          test:
             [testng] [Parser] Running:
             [testng]   C:\projects\SHIMS\test-build\assignInventoryToTechTest.xml
             [testng] ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Described: name=ServerConfig state=PreInstall
             [testng] java.lang.NoClassDefFoundError: org/jboss/bootstrap/BaseServerConfig



          I am using Seam 2.0.1.GA as well and this is a seam-gen'd app.


          The instructions state the following:



          If you used seam-gen to create your project you are ready to start writing tests. Otherwise you'll need to setup the testing environment in your favorite build tool (e.g. ant, maven, eclipse).

          Some may say it's easy to write and run integration tests using testNG and SeamTest, but this is a pain...

          • 2. Re: Seam testing issues
            Daniel Hinojosa Master

            Documentation says that integration testing only works on Java 5.0 and not Java 6.0. I was able to make it work for Java 6.0 by adding:


            <sysproperty key="sun.lang.ClassLoader.allowArraySyntax" value="true"/>
            



            to the testng task

            • 3. Re: Seam testing issues
              System Administrator Expert

              if you run your integration test via the ant test target, it shouldn't matter what your project buildpath consists of, correct??


              it's all in the build.xml...

              • 4. Re: Seam testing issues
                Daniel Hinojosa Master

                The ordering does, and it is very sensitive.  I have had to give up my own ant script and move to seam-gen over it at a couple of points in my life.

                • 5. Re: Seam testing issues
                  System Administrator Expert

                  well I moved the bootstrap class folder below the JRE System library in the order and export tab of the project properties.


                  same behavior/errors...

                  • 6. Re: Seam testing issues
                    Pete Muir Master

                    The only supported way to run integration tests (unfortunately, we need someone to fix Embedded properly, but this is still a way off) is via the ant target in a seam-gen project. The ant script doesn't have a project properties.


                    And use Seam 2.0.2.SP1, I put fixes into this stuff post 2.0.1