5 Replies Latest reply on Jan 8, 2008 10:41 AM by Valerij Timofeev

    approach using seam tests

    Feivel Frey Newbie

      Hi,

      one question. What is the right way using test in seam-gen project.

      I have a project created with seam-gen (using RHDS, same like in console). In my test folder I have created a test class and a testng.xml.

      If I choose the class and use "run as - TestNG Test" the result is Total tests run: 0, Failures: 0, Skips: 0

      If I use build.xml -> test: You need to specify at least one testng.xml or one class

      or if I use "testng.xml -> run as -> TestNG Suite" here the error

      java.lang.NoClassDefFoundError: org/jboss/deployers/spi/DeploymentException
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at org.jboss.seam.mock.BaseSeamTest.embeddedJBossAvailable(BaseSeamTest.java:977)
       at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:967)
       at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:893)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:397)
       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:166)
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
       at org.testng.TestRunner.run(TestRunner.java:466)
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      


      after add the lib/test/*.jar files to run dialog the error was the following
      ERROR 14-10 19:59:43,856 [org.jboss.dependency.plugins.AbstractController.incrementState():456] Error installing to Instantiated: name=DeploymentFilter state=Described
      java.lang.IllegalStateException: Class not found: [Ljava.lang.String;
       at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:174)
       at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:125)
       at org.jboss.metadata.spi.signature.Signature.getParametersTypes(Signature.java:292)
       at org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader.getComponentMetaDataRetrieval(AnnotatedElementMetaDataLoader.java:138)
       at org.jboss.metadata.plugins.context.AbstractMetaDataContext.getComponentMetaDataRetrieval(AbstractMetaDataContext.java:280)
       at org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge.getComponentMetaData(MetaDataRetrievalToMetaDataBridge.java:159)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.methodHasAnnotations(AOPConstructorJoinpoint.java:202)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasMethodMetaData(AOPConstructorJoinpoint.java:172)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.hasInstanceOrJoinpointMetaData(AOPConstructorJoinpoint.java:152)
       at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:99)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
       at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:52)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
       at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:302)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:272)
       at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:119)
       at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96)
       at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:150)
       at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:162)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:201)
       at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:214)
       at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11)
       at org.jboss.seam.mock.BaseSeamTest.startJbossEmbeddedIfNecessary(BaseSeamTest.java:968)
       at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:893)
       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:597)
       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580)
       at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:397)
       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:166)
       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:103)
       at org.testng.TestRunner.runWorkers(TestRunner.java:689)
       at org.testng.TestRunner.privateRun(TestRunner.java:566)
       at org.testng.TestRunner.run(TestRunner.java:466)
       at org.testng.SuiteRunner.runTest(SuiteRunner.java:301)
       at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:296)
       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:276)
       at org.testng.SuiteRunner.run(SuiteRunner.java:191)
       at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808)
       at org.testng.TestNG.runSuitesLocally(TestNG.java:776)
       at org.testng.TestNG.run(TestNG.java:701)
       at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73)
       at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124)
      Caused by: java.lang.ClassNotFoundException: [Ljava.lang.String;
       at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
       at org.jboss.metadata.spi.signature.Signature.stringsToClasses(Signature.java:170)
       ... 55 more


      Hey guys, big thanks to your work. Seam rocks. But can you please update/refresh documentation. The correct approach is not clear how to use seam tests.


      Thanks