[jboss-user] [JBoss Seam] - SeamTest Unit Tests Working...But Not Integration Tests
neilac333
do-not-reply at jboss.com
Thu Dec 6 14:24:06 EST 2007
Since I have my SeamTest unit tests running smoothly, I assumed I had my testing configuration correct. However, when I run the most basic integration test just to see what happens, I get an exception.
Here first is my classpath in Ant:
| <path id="seam.test.class.path.libs">
| <fileset dir="${seam-hibernate.lib.dir}"
| includes="*embedded*.jar,*-all.jar,jboss-deployers.jar"/>
| <pathelement path="${seam-hibernate.lib.dir}/bootstrap"/>
| <fileset dir="${sun-jsf.lib.dir}"/>
| <fileset dir="${commons.lib.dir}"/>
| <fileset dir="${seam-hibernate.lib.dir}" includes="jboss-seam.jar"/>
| </path>
|
Hopefully, the property names are self-explanatory.
Here now is my test:
| public void testSearchActionComponent() throws Exception {
| logger.debug("Starting method testSearchActionComponent");
|
| new ComponentTest() {
| protected void testComponents() throws Exception {
| getValue("#{identity.loggedIn}");
| }
|
| }.run();
| }
|
|
As you can see, this test won't win any awards for code coverage. I am simply trying to verify everything is configured as it should be.
Here now is the exception I am finding:
| java.lang.NullPointerException
| at org.jboss.seam.servlet.ServletApplicationMap.get(ServletApplicationMap.java:54)
| at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:48)
| at org.jboss.seam.Component.getInstance(Component.java:1843)
| at org.jboss.seam.Component.getInstance(Component.java:1821)
| at org.jboss.seam.Component.getInstance(Component.java:1816)
| at org.jboss.seam.core.Expressions.instance(Expressions.java:253)
| at org.jboss.seam.mock.BaseSeamTest$ComponentTest.getValue(BaseSeamTest.java:152)
| at model.test.SearchActionAdvancedTest$1.testComponents(SearchActionAdvancedTest.java:39)
| at org.jboss.seam.mock.BaseSeamTest$ComponentTest.run(BaseSeamTest.java:170)
| at model.test.SearchActionAdvancedTest.testSearchActionComponent(SearchActionAdvancedTest.java:36)
| 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:604)
| at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
| at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
| at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
| at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
| at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| at org.testng.TestRunner.privateRun(TestRunner.java:624)
| at org.testng.TestRunner.run(TestRunner.java:495)
| at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| at org.testng.TestNG.run(TestNG.java:699)
| at org.testng.TestNG.privateMain(TestNG.java:824)
| at org.testng.TestNG.main(TestNG.java:802)
|
I have looked at the samples, and I have even looked at what SeamGen gives me. I don't see anything different than what I have.
So then I tried adding a couple of SeamTest method calls to my test just for kicks:
| public void testSearchActionComponent() throws Exception {
| logger.debug("Starting method testSearchActionComponent");
| init();
| begin();
|
| new ComponentTest() {
| protected void testComponents() throws Exception {
| getValue("#{identity.loggedIn}");
| }
|
| }.run();
| }
|
|
As you can see, the only difference is adding two methods in SeamTest that I imagine help get everything going.
Here is the result of that:
| DEBUG [model.test.SearchActionAdvancedTest] Starting method testSearchActionComponent
| DEBUG [org.jboss.kernel.KernelFactory] Starting JBoss Kernel construction...
| DEBUG [org.jboss.kernel.KernelFactory] Completed JBoss Kernel construction. Duration: 63 milliseconds
| DEBUG [jboss.kernel.plugins.deployment.xml.BeanXMLDeployer] Parsing file:/C:/project/libs/seam-hibernate/bootstrap/conf/bootstrap-beans.xml took 407 milliseconds
| WARN [org.jboss.mx.loading.UnifiedLoaderRepository3] Tried to add non-URLClassLoader. Ignored
| ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=JMXKernel state=Create
| java.lang.NoSuchMethodError: org.jboss.system.ServiceController.setKernel(Lorg/jboss/kernel/Kernel;)V
| at org.jboss.embedded.adapters.JMXKernel.start(JMXKernel.java:160)
| 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.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:107)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextActions.dispatchJoinPoint(KernelControllerContextActions.java:100)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$LifecycleAction.installAction(KernelControllerContextActions.java:582)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:175)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:593)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:346)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:438)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:379)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:225)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:151)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:291)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:261)
| at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:117)
| at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:95)
| 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:1006)
| at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:931)
| at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
| at model.test.SearchActionAdvancedTest.testSearchActionComponent(SearchActionAdvancedTest.java:34)
| 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:604)
| at org.testng.internal.Invoker.invokeMethod(Invoker.java:470)
| at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:564)
| at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:830)
| at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
| at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
| at org.testng.TestRunner.runWorkers(TestRunner.java:678)
| at org.testng.TestRunner.privateRun(TestRunner.java:624)
| at org.testng.TestRunner.run(TestRunner.java:495)
| at org.testng.SuiteRunner.runTest(SuiteRunner.java:300)
| at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:295)
| at org.testng.SuiteRunner.privateRun(SuiteRunner.java:275)
| at org.testng.SuiteRunner.run(SuiteRunner.java:190)
| at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:792)
| at org.testng.TestNG.runSuitesLocally(TestNG.java:765)
| at org.testng.TestNG.run(TestNG.java:699)
| at org.testng.TestNG.privateMain(TestNG.java:824)
| at org.testng.TestNG.main(TestNG.java:802)
| DEBUG [org.jboss.embedded.adapters.LocalOnlyUserTransaction] new UserTx: org.jboss.embedded.adapters.LocalOnlyUserTransaction at 2515
| DEBUG [jboss.kernel.plugins.deployment.xml.BeanXMLDeployer] Deploying file:/C:/project/libs/seam-hibernate/bootstrap/conf/bootstrap-beans.xml took 736 milliseconds
|
I have no idea what to make of any of that.
If anyone has some insight into what my issue is, please let me know ASAP since I really need to get this testing going. Let me know if I need to provide additional information.
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110978#4110978
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110978
More information about the jboss-user
mailing list