3 Replies Latest reply on Jul 13, 2016 10:02 AM by bmajsak

    TestNG  @Parameters don't works using arquillian

    luis_1980

      No value is passed to the test method arguments.

      Anybody knows how to workaround this problem?

       

       

      <suite name="XXXX" verbose="1" preserve-order="true" configfailurepolicy="skip" parallel="false" thread-count="1">

          <parameter name="context" value="Default"/>

        <test name="Check Dao Availability" enabled="true">

        <classes>

        <class name="x.y.z.TestIT" />

        </classes>

        </test>

      </suite>

       

      @Parameters({"context"})

        @Test(dataProvider=Arquillian.ARQUILLIAN_DATA_PROVIDER)

        public void testCheckDao(String context){

        System.out.println("============== " + context + "==================");

        }

       

      Thanks

        • 1. Re: TestNG  @Parameters don't works using arquillian
          taylorbenson

          Luis,

          I finally decided to create an account so I can maybe help with other TestNG issues that I'm experiencing with paralleling with Arquillian, however I see your problem and within my projects I am able to use parameters within Arquillian.

           

          I have used parameters like you defined within the suite and using maven pom (surefire/fail-safe).

           

          How are you executing the tests? Maven or IDE?

           

          If you are running via IDE

          Are you right clicking on suite.xml and selecting Run As->TestNG Suite? (If so this should work fine)

          If you are right clicking on the test file itself, then you have to add the parameter as a vm argument. To do this you need to go to Run As->Run Configuration... and select the Arguments tab, add -Dcontext=Default to the vm arguments box. This will then pass "Default" to your test.

           

          If you are doing it via maven, if you can post you pom, I might be able to help.

           

          Cheers

          • 2. Re: TestNG  @Parameters don't works using arquillian
            luis_1980

            Hi Taylor,

             

            I'm using MAVEN

             

            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <version>2.16</version>
              <configuration>
                   <testSourceDirectory>src/integrationtest/java</testSourceDirectory>
                   <testClassesDirectory>${project.build.directory}/integrationtest-classes</testClassesDirectory>
                   <outputDirectory>${project.build.directory}/integrationtest-classes</outputDirectory>

                   <argLine>-Xmx1024m ${jacoco.agent.it.arg}</argLine>
                   <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <jboss.home>${jboss.home}</jboss.home>
                        <module.path>${jboss.home.modules}</module.path>
                   </systemPropertyVariables>
                   <suiteXmlFiles>
                        <suiteXmlFile>src/integrationtest/resources/testng.xml</suiteXmlFile>
                   </suiteXmlFiles>
              </configuration>
              <executions>
                   <execution>
                        <goals>
                             <goal>integration-test</goal>
                             <goal>verify</goal>
                        </goals>
                   </execution>
              </executions>

            </plugin>

            • 3. Re: TestNG  @Parameters don't works using arquillian
              bmajsak

              Moved to general Arquillian space.


              If this is not the exact issue you are struggling with [ARQ-1282] TestNG @DataProvider is fully invoked for each record - JBoss Issue Tracker please create new one and we will take a closer look.