Skip to content

Commit d4d91f1

Browse files
authored
Fix retry implementation; upgrade settings (#71)
1 parent 57a7172 commit d4d91f1

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ repositories {
195195
dependencies {
196196
constraints {
197197
api 'com.nordstrom.tools:java-utils:3.4.1'
198-
api 'com.nordstrom.tools:settings:3.0.7'
198+
api 'com.nordstrom.tools:settings:3.0.8'
199199
}
200200
api 'com.nordstrom.tools:java-utils'
201201
api 'com.nordstrom.tools:settings'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
profile=java11
2-
version=3.0.8-SNAPSHOT
2+
version=5.2.0-SNAPSHOT

src/main/java/com/nordstrom/automation/testng/RetryManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class RetryManager implements IRetryAnalyzer {
7878

7979
private final TestNGConfig config;
8080
private final Map<InvocationRecord, Integer> invocations;
81-
private final ServiceLoader<IRetryAnalyzer> retryAnalyzerLoader;
81+
private final ServiceLoader<TestNGRetryAnalyzer> retryAnalyzerLoader;
8282
private final Logger logger = LoggerFactory.getLogger(getClass());
8383

8484
/**
@@ -87,7 +87,7 @@ public class RetryManager implements IRetryAnalyzer {
8787
public RetryManager() {
8888
config = TestNGConfig.getConfig();
8989
invocations = new ConcurrentHashMap<>();
90-
retryAnalyzerLoader = ServiceLoader.load(IRetryAnalyzer.class);
90+
retryAnalyzerLoader = ServiceLoader.load(TestNGRetryAnalyzer.class);
9191
}
9292

9393
/**
@@ -126,7 +126,7 @@ public boolean retry(final ITestResult result) {
126126
*/
127127
protected boolean isRetriable(final ITestResult result) {
128128
synchronized(retryAnalyzerLoader) {
129-
for (IRetryAnalyzer analyzer : retryAnalyzerLoader) {
129+
for (TestNGRetryAnalyzer analyzer : retryAnalyzerLoader) {
130130
if (analyzer.retry(result)) {
131131
return true;
132132
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.nordstrom.automation.testng;
2+
3+
import org.testng.ITestResult;
4+
5+
/**
6+
* <b>TestNG Foundation</b> retry analyzers implement this interface.
7+
*/
8+
public interface TestNGRetryAnalyzer {
9+
10+
/**
11+
* Determine if the specified failed test should be retried.
12+
*
13+
* @param result failed result to be evaluated
14+
* @return {@code true} if test should be retried; otherwise {@code false}
15+
*/
16+
boolean retry(final ITestResult result);
17+
18+
}

0 commit comments

Comments
 (0)