8 Replies Latest reply on Mar 11, 2008 12:33 PM by pmuir

    Dependent testing

    larshuber

      BUG: JBSEAM-2519


      discussed in:previous forum entry


      What do you think when this bug will be fixed? Dependent testing is very helpful.


      Thanks
      Lars

        • 1. Re: Dependent testing
          pmuir

          Please test in Seam trunk.

          • 2. Re: Dependent testing
            larshuber

            I'm working with JBoss Developer Studion and it doesn't accept Seam 2.1


            What can I do to solve this?

            • 3. Re: Dependent testing
              pmuir

              Bug in JBDS. Create a Seam 2 project using Seam 2.0 and then replace the jars with the ones from Seam 2.1. Or use seam-gen.

              • 4. Re: Dependent testing
                larshuber

                it works, thanks

                • 5. Re: Dependent testing
                  pmuir

                  Great, I closed the issue.

                  • 6. Re: Dependent testing
                    larshuber

                    Hi Pete


                    I came across on strange behaviour with derived classes and dependent testing. By the way, the snapshot I'm using is Build 77 from 2.1



                    public class SimpleTest extends SeamTest {
                         
                         @BeforeMethod
                         public void beforeMethod() {
                              assert true;
                         }
                         
                         @BeforeMethod(dependsOnMethods={"beforeMethod"})
                         public void postBeforeMethod() {
                              assert true;
                         }
                         
                         @Test
                         public void testSimple() {
                              assert true;
                         }
                    }
                    




                    public class SimpleTestDerived extends SimpleTest {
                         
                         @Override
                         @BeforeMethod
                         public void beforeMethod() {
                              super.beforeMethod();
                              assert true;
                         }
                         
                         @Test
                         public void testSimple2() {
                              assert true;
                         }
                    }
                    



                    org.testng.TestNGException: 
                    ch.pomop.testframework.test.SimpleTest.postBeforeMethod() is depending on nonexistent method ch.pomop.testframework.test.SimpleTest.beforeMethod
                         at org.testng.internal.MethodHelper.findMethodsNamed(MethodHelper.java:143)
                         at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:472)
                         at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:544)
                         at org.testng.internal.MethodHelper.internalCollectAndOrderMethods(MethodHelper.java:77)
                         at org.testng.internal.MethodHelper.collectAndOrderConfigurationMethods(MethodHelper.java:61)
                         at org.testng.internal.TestNGMethodFinder.findConfiguration(TestNGMethodFinder.java:192)
                         at org.testng.internal.TestNGMethodFinder.getBeforeTestMethods(TestNGMethodFinder.java:64)
                         at org.testng.TestClass.initMethods(TestClass.java:150)
                         at org.testng.TestClass.init(TestClass.java:74)
                         at org.testng.TestClass.<init>(TestClass.java:43)
                         at org.testng.TestRunner.initMethods(TestRunner.java:288)
                         at org.testng.TestRunner.init(TestRunner.java:216)
                         at org.testng.TestRunner.init(TestRunner.java:178)
                         at org.testng.TestRunner.<init>(TestRunner.java:139)
                         at org.testng.remote.RemoteTestNG$1.newTestRunner(RemoteTestNG.java:102)
                         at org.testng.remote.RemoteTestNG$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG.java:154)
                         at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:494)
                         at org.testng.SuiteRunner.privateRun(SuiteRunner.java:235)
                         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)




                    As you can see the derived class overrides beforeMethod() from the subclass. Now on startup testing an exception occures: the method beforeMethod() on which postBeforeMethod() is depending on is missing. But in reality the method will be called in the subclass.


                    Is this wanted that you have to override all depending methods or is it just not implemented yet?


                    By the way - testing with 2.1 is much faster. Initialization time is little bit longer but the Test execution time is much shorter. I hope this is because of reengineering and not because of missing parts of the snapshot.


                    greets
                    Lars

                    • 7. Re: Dependent testing
                      larshuber

                      EDIT: As you can see the derived class overrides beforeMethod() from superclass.

                      • 8. Re: Dependent testing
                        pmuir

                        Lars Huber wrote on Mar 11, 2008 08:12 AM:


                        As you can see the derived class overrides beforeMethod() from the subclass. Now on startup testing an exception occures: the method beforeMethod() on which postBeforeMethod() is depending on is missing. But in reality the method will be called in the subclass.

                        Is this wanted that you have to override all depending methods or is it just not implemented yet?


                        I'm pretty sure this is a limitation in TestNG not Seam test right? So ask there ;-)


                        By the way - testing with 2.1 is much faster. Initialization time is little bit longer but the Test execution time is much shorter. I hope this is because of reengineering and not because of missing parts of the snapshot.


                        Yes, this was the intention of the refactor :-)