[arquillian-issues] [JBoss JIRA] (ARQ-1282) TestNG @DataProvider is fully invoked for each record

Chris Dollar (JIRA) issues at jboss.org
Thu Apr 21 17:25:01 EDT 2016


    [ https://issues.jboss.org/browse/ARQ-1282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13195483#comment-13195483 ] 

Chris Dollar commented on ARQ-1282:
-----------------------------------

I'm using arquillian 1.1.11.Final and the attached workaround isn't working for me. I only get the first element from the data provider and the rest are skipped. Trying to use a @DataProvider normally (without the _provide_ hack) results in the same squared behavior of executions.

Does anyone have any other workarounds? Or maybe a clue as what to look at in the arquillian source that might be causing the issue?

> TestNG @DataProvider is fully invoked for each record
> -----------------------------------------------------
>
>                 Key: ARQ-1282
>                 URL: https://issues.jboss.org/browse/ARQ-1282
>             Project: Arquillian
>          Issue Type: Bug
>          Components: JBoss AS Containers
>    Affects Versions: 1.0.3.Final
>            Reporter: Karel Cemus
>         Attachments: ArquillianDataProvider.java, FlightServiceTest.java
>
>
> h2. Expected behavior
> TestNG defines @DataProvider annotation to allow single method to perform multiple test cases. Provider method annotated with @DataProvider returns an array of arrays, each containing one test case. These parameters are given to the target method as input parameters. By the definition, the total count of performed test by single method is equal to number of test cases in related data provider.
> h2. Actual behavior
> Using TestNG under Arquillian framework makes this functionality buggy. Although the client (maven, IDE, etc.) thinks, that the total number of invoked test is correct, it is not. When we take a look into server's log, we can see that for each single test case it invoked full set of all test cases. It means, that in the end the amount of performed tests is equal to expected count squared. Such behaviour is not only slow but also in some cases it doesn't work and it makes tests to fail.
> h2. Example
> {code:java}
> @DataProvider
> public Object[][] sumProvider() {
>     return new Object[][]{
>         new Object[]{ 0, 0, 0 },
>         new Object[]{ 1, 1, 2 },
>         new Object[]{ 1, 5, 6 },
>         new Object[]{ 5, 1, 6 }
>     };
> }
> {code}
> h3. Expected output in server log
> {quote}
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> {quote}
> h3. Actual output
> {quote}
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> Execution of sum: 0 + 0 = 0
> Execution of sum: 1 + 1 = 2
> Execution of sum: 1 + 5 = 6
> Execution of sum: 5 + 1 = 6
> {quote}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the arquillian-issues mailing list