1 package test.retryAnalyzer; 2 3 import org.testng.Assert; 4 import org.testng.annotations.Test; 5 6 import java.util.concurrent.atomic.AtomicBoolean; 7 8 public class EventualSuccess { 9 private static final AtomicBoolean ranYet = new AtomicBoolean(false); 10 11 @Test(retryAnalyzer = MyRetry.class) test()12 public void test() { 13 if (!ranYet.getAndSet(true)) { 14 Assert.fail(); 15 } 16 } 17 } 18