-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamline invocation numbers in failed xml file
Closes #3180
- Loading branch information
1 parent
f78cdbd
commit bebe004
Showing
8 changed files
with
294 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
testng-core/src/test/java/test/invocationcount/issue3180/RetryAnalyzer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package test.invocationcount.issue3180; | ||
|
||
import org.testng.IRetryAnalyzer; | ||
import org.testng.ITestResult; | ||
|
||
public class RetryAnalyzer implements IRetryAnalyzer { | ||
|
||
int counter = 0; | ||
int retryLimit = 3; | ||
|
||
/* | ||
* Retry method | ||
*/ | ||
public boolean retry(ITestResult result) { | ||
return counter++ < retryLimit; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
testng-core/src/test/java/test/invocationcount/issue3180/SampleTestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package test.invocationcount.issue3180; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
|
||
import java.util.concurrent.atomic.AtomicInteger; | ||
import org.testng.annotations.DataProvider; | ||
import org.testng.annotations.Test; | ||
|
||
public class SampleTestCase { | ||
|
||
@Test(dataProvider = "dp", retryAnalyzer = RetryAnalyzer.class) | ||
public void testDataProvider(AtomicInteger counter) { | ||
assertEquals(counter.incrementAndGet(), 3); | ||
} | ||
|
||
@Test | ||
public void normalTestMethod() {} | ||
|
||
@DataProvider(name = "dp") | ||
public Object[][] createTestData() { | ||
return new Object[][] {{new AtomicInteger(0)}}; | ||
} | ||
} |
Oops, something went wrong.