11 Replies Latest reply on May 24, 2012 9:05 AM by yogesh_skr

    Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)

    yogesh_skr

      Hi,

        I am new to the arquillian, and looking for some help to configuare the Arquillian ...However I am not able to see much help to set it up with TestNG and JBoss5.1.0GA.

       

        Currently I have tried to do following :

        1.  Created a class by extending Arquillian and added the test cases in the class.

        2.  Added liabraries in the class path as follows:

       

      TestClasspath.JPG

       

        I am getting the below error:

       

      FAILED CONFIGURATION: @BeforeSuite arquillianBeforeSuite

      java.lang.RuntimeException: Could not create and startup manager

          at org.jboss.arquillian.impl.core.ManagerImpl.<init>(ManagerImpl.java:95)

       

      Also is there any site where the arquillian usage is being given w.r.t TestNG ?

       

       

      Thanks, Yogesh

        • 1. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
          bmajsak

          Hi Yogesh,

           

          first question - did you configure your classpath in Eclipse manually? I would suggest to try a build tool with dependency management such as Maven, Ant+Ivy or Gradle. It will save you a lot of time when dealing with dependencies and configuration. I would also strongly recommend to use newer version of Arquillian, preferably 1.0.0.CR7. I see from the screenshot that you are using quite old Alpha5. A lot have been improved since then.

           

          Please have a look at Arquillian Showcase on GitHub. Some modules are using TestNG while other are based on JUnit.

           

          Cheers,

          Bartosz

          • 2. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
            yogesh_skr

            Hi Bartosz,

               Thanks for your quick response, I agree that I will need to use the dependancy tool, however at this time, I am trying to get the implementation done as a POC for my project, which will be with simple files and making Arquillian as remote client.

             

             

               I had taken CR7 jars from jboss org site.

             

              There were some interdependancy due to that I have to take few old ones as well. Here is the new jars listed:

            TestClasspath.JPG

             

              I am still seeing the same error while running it as TestNG Test. I am sure I must be missing on some configuration settings....

             

             

            Thanks, Yogesh.

            • 3. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
              bmajsak

              Hi Yogesh,

               

              as I can see from the attached screenshot you still have some Alpha5 leftovers in the classpath. Could you please provide .classpath file, test class and full stacktrace which you are getting?

               

              On the other hand I will still try to convince you to use Maven (as all showcases are build on that). Besides not struggling with manual dependencies you could have profiles to run your tests on different containers very easily. You can follow this "Getting Started" guide to see yourself that it is in fact very easy.

              • 4. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                yogesh_skr

                Hi Bartosz,

                   Here is the log file and .classpath attached.

                 

                   Since we are using SVN as our repository, I would like to go for TestNG, Arqillian and SVN option to create the POC. I had seen the maven examples , they art e helpful too, but while molding it to my project requirement, it is giving issues...

                 

                 

                Thanks, Yogesh.

                • 5. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                  bmajsak

                  Thanks, I will have a look soon.

                   

                  I've been using maven and ant based project versioned by SVN without any issues but I understand that you might have some strict requirements / processes where neither of those two can be used.

                   

                  Do you have arquillian.xml configuration and test class which you can share too? That might be really helpful to understand the whole picture.

                  • 6. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                    yogesh_skr

                    Sure, Here is the arquillian.xml & test class

                     

                    Thanks, Yogesh.

                    • 7. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                      yogesh_skr

                      another parent class adding here...

                       

                       

                      Thanks, Yogesh

                      • 8. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                        yogesh_skr

                        Hi Bartosz,

                           Did you get a chance to find out what is wrong? or any other way I could do it?

                         

                         

                        Thanks, Yogesh.

                        • 9. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                          bmajsak

                          Hi Yogesh,

                           

                          this might help https://gist.github.com/2363038

                          1 of 1 people found this helpful
                          • 10. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                            yogesh_skr

                            Hi Bartosz,

                               Yes, that helped me, now moved ahead in creating the test but still getting an NPE whenever I run the java prg with TestNG.

                             

                            FAILED: f

                            java.lang.NullPointerException

                                at org.jboss.arquillian.testng.Arquillian.run(Arquillian.java:212)

                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

                                at java.lang.reflect.Method.invoke(Unknown Source)

                                at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:194)

                                at org.testng.internal.Invoker.invokeMethod(Invoker.java:692)

                                at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:891)

                                at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1215)

                                at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)

                                at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)

                                at org.testng.TestRunner.privateRun(TestRunner.java:758)

                                at org.testng.TestRunner.run(TestRunner.java:613)

                                at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)

                                at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)

                                at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)

                                at org.testng.SuiteRunner.run(SuiteRunner.java:240)

                                at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)

                                at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:87)

                                at org.testng.TestNG.runSuitesSequentially(TestNG.java:1170)

                                at org.testng.TestNG.runSuitesLocally(TestNG.java:1095)

                                at org.testng.TestNG.run(TestNG.java:1007)

                                at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:109)

                                at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:202)

                                at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:173)

                             

                            I have verified from the code that it is trying to get Deployable Test and failing in getting so. Not sure what is wrong, I have added following jar in it :

                            arquillian-jbossas-managed-5.1-1.0.0.CR3.jar

                             

                            And these are the other supporting jars:

                            arquillian-api-1.0.0.Alpha4.SP7.jar

                            arquillian-container-spi-1.0.0.Final.jar

                            arquillian-container-test-api-1.0.0.Final.jar

                            arquillian-core-api-1.0.0.Final.jar

                            arquillian-core-impl-base-1.0.0.Final.jar

                            arquillian-core-spi-1.0.0.Final.jar

                            arquillian-test-api-1.0.0.Final.jar

                            arquillian-test-impl-base-1.0.0.Final.jar

                            arquillian-testng-core-1.0.0.Final.jar

                            arquillian-test-spi-1.0.0.Final.jar

                            shrinkwrap-api-1.0.0-alpha-8.jar

                            testng-6.3.1.jar

                             

                            Thanks, Yogesh

                            • 11. Re: Arquillian with TestNG and SVN in eclipse (with JBoss 5.1.0GA)
                              yogesh_skr

                              Ok, I am able to run the arquillian with TestNG , I was missing arquillian-testng-standalone-1.0.0.Final.jar in my class path, after adding it, It ran fine, so I could able to test a simple class of TestNG with Arquillian without Maven now.

                               

                              Thanks, Yogesh.