You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 16 Members of 4546 |
| Forum: Seam Users |
26. Feb 2008, 13:33 CET | Link |
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!
What version of Seam?
Read about how to report a bug.
2.0.1 GA
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.
Read about how to report a bug.
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!
Paste it here in a code block.
Read about how to report a bug.
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:
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.
JBSEAM-2813
Read about how to report a bug.
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:
Just a short answer to say Pete was right, it was just my /bootstrap directoy that wasn't updated. It now works perfectly.
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."^^