<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: Does the SpiraTest JUnit integration library support parameterized tests? (Thread)</title><description>
Hello,

    I'm using the JUnit integration with JUnit. It's working fine for my normal test cases and test result are transmitted to SpiraTest.      Now, I'am adding parametrized tests which is a feature of JUnit 4. When I add the SpiraTest annotation to a parametrized test, and run it with the Main class as documented in the SpiraTest Automated Testing Integration Guide, it fails. I get the following error messages:  java.lang.NoSuchMethodException: org.test.FibonacciTest.test[0]()     Does the SpiraTest JUnit integration library support parameterized tests?     Here is my code to give you an idea what I try to accomplish:   @RunWith(Parameterized.class)  @SpiraTestConfiguration(url = URL, login = USER, password = PWD, projectId = PROJECT_ID)  public class FibonacciTest {         @Parameters      public static Collection  data() {          return Arrays.asList(new Object[][] { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, { 6, 8 } });      }         private int fInput;         private int fExpected;         public FibonacciTest(int input, int expected) {          fInput = input;          fExpected = expected;      }         @Test      @SpiraTestCase(testCaseId=21966)      public void test() {          assertEquals(fExpected, compute(fInput));      }         private int compute(int fInput2) {          return 1;      }  }          public class SpiraApplicationMain {         public final static String URL = "";      public final static String USER = ";      public final static String PWD = "";      public final static int PROJECT_ID = 0;         /**       * Entry point for command line execution       *        * @param args       *            The command line arguments       */      public static void main(String[] args) {          // Instantiate the JUnit core          JUnitCore core = new JUnitCore();             // Add the custom SpiraTest listener          core.addListener(new SpiraTestListener());             // Finally run the test fixture          core.run(FibonacciTest.class);      }         /**       * Entry point for JUnit 4.x runners       *       * @return Handle to the test framework       */      public static junit.framework.Test suite() {          return new JUnit4TestAdapter(FibonacciTest.class);      }  }      Regards,  Rene    </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spiratest/issues-questions/1213.aspx</link><item><guid isPermaLink="false">threadId=1213</guid><author>René Mischak (mischak@adesso.de)</author><category domain="http://www.inflectra.com/kronodesk/thread/tag">junit</category><title>Does the SpiraTest JUnit integration library support parameterized tests?</title><description>
Hello,

    I'm using the JUnit integration with JUnit. It's working fine for my normal test cases and test result are transmitted to SpiraTest.      Now, I'am adding parametrized tests which is a feature of JUnit 4. When I add the SpiraTest annotation to a parametrized test, and run it with the Main class as documented in the SpiraTest Automated Testing Integration Guide, it fails. I get the following error messages:  java.lang.NoSuchMethodException: org.test.FibonacciTest.test[0]()     Does the SpiraTest JUnit integration library support parameterized tests?     Here is my code to give you an idea what I try to accomplish:   @RunWith(Parameterized.class)  @SpiraTestConfiguration(url = URL, login = USER, password = PWD, projectId = PROJECT_ID)  public class FibonacciTest {         @Parameters      public static Collection  data() {          return Arrays.asList(new Object[][] { { 0, 0 }, { 1, 1 }, { 2, 1 }, { 3, 2 }, { 4, 3 }, { 5, 5 }, { 6, 8 } });      }         private int fInput;         private int fExpected;         public FibonacciTest(int input, int expected) {          fInput = input;          fExpected = expected;      }         @Test      @SpiraTestCase(testCaseId=21966)      public void test() {          assertEquals(fExpected, compute(fInput));      }         private int compute(int fInput2) {          return 1;      }  }          public class SpiraApplicationMain {         public final static String URL = "";      public final static String USER = ";      public final static String PWD = "";      public final static int PROJECT_ID = 0;         /**       * Entry point for command line execution       *        * @param args       *            The command line arguments       */      public static void main(String[] args) {          // Instantiate the JUnit core          JUnitCore core = new JUnitCore();             // Add the custom SpiraTest listener          core.addListener(new SpiraTestListener());             // Finally run the test fixture          core.run(FibonacciTest.class);      }         /**       * Entry point for JUnit 4.x runners       *       * @return Handle to the test framework       */      public static junit.framework.Test suite() {          return new JUnit4TestAdapter(FibonacciTest.class);      }  }      Regards,  Rene    </description><pubDate>Wed, 29 Apr 2015 14:35:31 -0400</pubDate><a10:updated>2015-05-05T15:11:51-04:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/1213.aspx</link></item><item><guid isPermaLink="false">messageId=2117</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> &#xD;
&#xD;
&#xD;
Hi Rene  I have checked with our team and it was not developed with that feature in mind, so </title><description> &#xD;
&#xD;
&#xD;
Hi Rene  I have checked with our team and it was not developed with that feature in mind, so there is a possibility that it will not work with such tests.  Regards  Adam </description><pubDate>Tue, 05 May 2015 15:11:51 -0400</pubDate><a10:updated>2015-05-05T15:11:51-04:00</a10:updated><link>/Support/Forum/spiratest/issues-questions/1213.aspx#reply2117</link></item></channel></rss>