3 Replies Latest reply on Jul 16, 2009 10:35 PM by jervin

    Running tests with TestNG exlipse plugin

    gaboo.gael.livre-rare-book.com

      I've been trying to run our applications seam tests in eclipse testng with little success. First, documentation isn't easily found.


      There is the seam documentation that mention There are instructions for running these tests using Ant, or using the TestNG plugin for eclipse: . There are, but where ?


      Some there :
      GettingStarted


      Indeed, it's gotten me started. But, I've add to add way more jars that the ones that are mentionned there. Here is the full list :




      • test/hibernate-all.jar

      • test/jboss-embedded-all.jar

      • test/thirdparty-all.jar

      • activation.jar

      • el-api.jar

      • jboss-embedded-api.jar

      • jboss-seam.jar

      • jsf-api.jar

      • jboss-el.jar

      • jboss-cache.jar

      • jbpm-jpdl.jar

      • drools-core.jar

      • drools-compiler.jar

      • mvel14.jar

      • antlr-runtime.jar

      • core-3.2.3.v686R32x.jar




      The last one is from the full binary drools distribution. It was needed and mentioned in another post I don't remember.


      Some of the tests passes. Some don't with this error, and I'm stuck :



      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: coreManager.renderer
           at org.jboss.seam.Component.getValueToInject(Component.java:2257)
           at org.jboss.seam.Component.injectAttributes(Component.java:1663)
           at org.jboss.seam.Component.inject(Component.java:1481)
      



      The injected value is :



      import org.jboss.seam.faces.Renderer;
      @In 
      private Renderer renderer;



      I'm going to spend some time again, but I really don't have anymore idea about this.


      I should mention that tests run flawlessly with a simple 'ant test'. But using the eclipse integration is really useful :)


      Any help would be appreciated, and I think the getting started part and the reference documentation should be improved a little.

        • 1. Re: Running tests with TestNG exlipse plugin
          gaboo.gael.livre-rare-book.com

          Ahhh. The error wasn't explicit, it was still jars missing, namely those two : jsf-faceleets.jar and jboss-seam-ui.jar.


          The only thing I miss is that when I debug, eclipse doesn't find the source because the class are named something lie MyClassName$6.java. I've found nothing about this, but I can live without it ...


          I hope this topic can save time for other people trying to setup TestNG tests in eclipse.

          • 2. Re: Running tests with TestNG exlipse plugin

            Click HELP for text formatting instructions. Then edit this text and check the preview.


            Hi,


            I follwed the Link given here! But i am still facing problems with running the TestNG test.


            Here is the Stacktrace!


            java.lang.NullPointerException
                 at org.jboss.seam.mock.AbstractSeamTest$Request.run(AbstractSeamTest.java:492)
                 at dk.mathmagicians.skills.action.registration.RegisterTest.testRegisterHappyDay(RegisterTest.java:30)
                 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.invokeMethod(Invoker.java:478)
                 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:617)
                 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:885)
                 at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
                 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:110)
                 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)



            Please help!!!!!

            • 3. Re: Running tests with TestNG exlipse plugin
              jervin

              I don't know if this is your problem or not, but I have recently been using TestNG inside Eclipse.  First off the TestNG plugin is antediluvian, i.e. really really old and out of date, but it still manages to barely function in my setup (Eclipse 3.5/M2Eclipse/JBoss Tools).  Still I did notice one hangup, do not run the tests but rather debug the tests.  I found that the right click option to debug as TestNG test from the desired test class seemed to provide the most consistent results.  Of course, to run all the tests in a project I still had to defer to running it from Maven.


              Good luck...