Skip to content

Commit 2e58bdf

Browse files
committed
working on retry
1 parent 6bcc746 commit 2e58bdf

11 files changed

Lines changed: 19 additions & 89 deletions

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<!-- test dependencies -->
4949
<junit.version>5.13.1</junit.version>
5050
<junit-launcher.version>1.13.1</junit-launcher.version>
51+
<junit-pioneer.version>2.3.0</junit-pioneer.version>
5152
<jetty.version>9.4.57.v20241219</jetty.version>
5253
<quercus.version>4.0.66</quercus.version>
5354
<log4j.version>2.25.0</log4j.version>
@@ -1332,6 +1333,13 @@
13321333
<version>${junit-launcher.version}</version>
13331334
<scope>test</scope>
13341335
</dependency>
1336+
<dependency>
1337+
<groupId>org.junit-pioneer</groupId>
1338+
<artifactId>junit-pioneer</artifactId>
1339+
<version>${junit-pioneer.version}</version>
1340+
<scope>test</scope>
1341+
</dependency>
1342+
13351343
<dependency>
13361344
<groupId>com.tngtech.archunit</groupId>
13371345
<artifactId>archunit-junit5</artifactId>

src/test/java/org/htmlunit/WebClient2Test.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ private void checkCookie(final String cookieString, final String name, final Str
296296
* @throws Exception if something goes wrong
297297
*/
298298
@Test
299-
@Retry
300299
@Alerts({"loadExtraContent started at Page 1", " loadExtraContent finished at Page 1"})
301300
@HtmlUnitNYI(CHROME = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"},
302301
EDGE = {"loadExtraContent started at Page 1", " loadExtraContent finished at Page 2"},

src/test/java/org/htmlunit/WebClientWaitForBackgroundJobsTest.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.htmlunit.javascript.background.JavaScriptJobManager;
2727
import org.htmlunit.junit.annotation.Tries;
2828
import org.junit.jupiter.api.Test;
29+
import org.junitpioneer.jupiter.RetryingTest;
2930

3031
/**
3132
* Tests for {@link WebClient#waitForBackgroundJavaScriptStartingBefore(long)} and
@@ -90,8 +91,7 @@ public void dontWaitWhenUnnecessary() throws Exception {
9091
/**
9192
* @throws Exception if the test fails
9293
*/
93-
@Test
94-
@Tries(3)
94+
@RetryingTest(3)
9595
public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception {
9696
final String content = DOCTYPE_HTML
9797
+ "<html>\n"
@@ -139,8 +139,7 @@ public void dontWaitWhenUnnecessary_jobRemovesOtherJob() throws Exception {
139139
* to wait for this job to finish, even if this clearXXX has been called for it.
140140
* @throws Exception if the test fails
141141
*/
142-
@Test
143-
@Tries(3)
142+
@RetryingTest(3)
144143
public void waitCalledDuringJobExecution() throws Exception {
145144
final String html = DOCTYPE_HTML
146145
+ "<html>\n"
@@ -250,8 +249,7 @@ public void waitWhenLastJobStartsNewOne() throws Exception {
250249
* a few retries should be done to see if new jobs exists.
251250
* @throws Exception if the test fails
252251
*/
253-
@Test
254-
@Tries(3)
252+
@RetryingTest(3)
255253
public void waitWithsubWindows() throws Exception {
256254
final String html = DOCTYPE_HTML
257255
+ "<html>\n"
@@ -310,8 +308,7 @@ public void waitWithsubWindows() throws Exception {
310308
* .
311309
* @throws Exception if the test fails
312310
*/
313-
@Test
314-
@Tries(3)
311+
@RetryingTest(3)
315312
public void newJobStartedAfterWait() throws Exception {
316313
final String html = DOCTYPE_HTML
317314
+ "<html>\n"
@@ -383,8 +380,7 @@ public WebResponse getResponse(final WebRequest request) throws IOException {
383380
* jobs occurs when one of this job is not active.
384381
* @throws Exception if the test fails
385382
*/
386-
@Test
387-
@Tries(3)
383+
@RetryingTest(3)
388384
public void waitForJobThatIsAlreadyLate() throws Exception {
389385
final String html = DOCTYPE_HTML
390386
+ "<html>\n"
@@ -510,8 +506,7 @@ public void jobSchedulesJobInOtherWindow2() throws Exception {
510506
* has not done its job correctly).
511507
* @throws Exception if the test fails
512508
*/
513-
@Test
514-
@Tries(3)
509+
@RetryingTest(3)
515510
public void waitForBackgroundJavaScriptStartingBefore_hangs() throws Exception {
516511
final String html = DOCTYPE_HTML
517512
+ "<html>\n"

src/test/java/org/htmlunit/html/HtmlFileInputTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public void contentTypeHeader() throws Exception {
7373
* @throws Exception if an error occurs
7474
*/
7575
@Test
76-
@Retry
7776
@Alerts("Content-Disposition: form-data; name=\"myInput\"; filename=\"\"")
7877
public void empty() throws Exception {
7978
final String htmlContent = DOCTYPE_HTML
@@ -133,7 +132,6 @@ public void realFile() throws Exception {
133132
* @throws Exception if an error occurs
134133
*/
135134
@Test
136-
@Retry
137135
public void chunked() throws Exception {
138136
final String htmlContent = DOCTYPE_HTML
139137
+ "<html>\n"

src/test/java/org/htmlunit/javascript/JavaScriptEngineTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,6 @@ private static ThreadLocal<List<PostponedAction>> getPostponedActions(final Abst
11751175
* @throws Exception if the test fails
11761176
*/
11771177
@Test
1178-
@Retry
11791178
@Alerts("starting")
11801179
public void shutdownShouldKill() throws Exception {
11811180
final String html = DOCTYPE_HTML
@@ -1218,7 +1217,6 @@ public void shutdownShouldKill() throws Exception {
12181217
* @throws Exception if the test fails
12191218
*/
12201219
@Test
1221-
@Retry
12221220
@Alerts("starting")
12231221
public void shutdownShouldKillJavaScriptTimeout() throws Exception {
12241222
final String html = DOCTYPE_HTML

src/test/java/org/htmlunit/javascript/host/dom/DocumentTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2918,7 +2918,6 @@ private void designMode(final String doc) throws Exception {
29182918
* @throws Exception if an error occurs
29192919
*/
29202920
@Test
2921-
@Retry
29222921
@Alerts(DEFAULT = {"0", "0", "0"},
29232922
FF = {"0", "1", "1"},
29242923
FF_ESR = {"0", "1", "1"})

src/test/java/org/htmlunit/javascript/host/xml/XMLHttpRequestLifeCycleTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ public void onKeyWord_async_preflight() throws Exception {
861861
* @throws Exception if the test fails
862862
*/
863863
@Test
864-
@Retry
865864
@Alerts({"readystatechange_1_0_true", "open-done: 1_0", "loadstart_1_0_false",
866865
"send-done: 1_0", "readystatechange_4_0_true", "abort_4_0_false",
867866
"loadend_4_0_false", "abort-done: 0_0"})

src/test/java/org/htmlunit/javascript/host/xml/XMLHttpRequestTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.htmlunit.util.MimeType;
4444
import org.htmlunit.util.NameValuePair;
4545
import org.junit.jupiter.api.Test;
46+
import org.junitpioneer.jupiter.RetryingTest;
4647
import org.openqa.selenium.By;
4748
import org.openqa.selenium.WebDriver;
4849
import org.opentest4j.AssertionFailedError;
@@ -70,8 +71,7 @@ public class XMLHttpRequestTest extends WebDriverTestCase {
7071
* Tests synchronous use of XMLHttpRequest.
7172
* @throws Exception if the test fails
7273
*/
73-
@Test
74-
@Tries(3)
74+
@RetryingTest(3)
7575
public void syncUse() throws Exception {
7676
final String html = DOCTYPE_HTML
7777
+ "<html>\n"

src/test/java/org/htmlunit/junit/annotation/AnnotationUtilsTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class AnnotationUtilsTest {
3636
FF = "ff",
3737
FF_ESR = "ff esr")
3838
public void obsoleteDefaultBecauseAllBrowserExpectationsDefinedIndividually() throws Exception {
39-
testFail("Obsolete DEFAULT because all browser expectations defined individually",
39+
testFail("Obsolete DEFAULT because all browser expectations defined individually"
40+
+ " ==> expected: <false> but was: <true>",
4041
"obsoleteDefaultBecauseAllBrowserExpectationsDefinedIndividually");
4142
}
4243

src/test/java/org/htmlunit/junit/annotation/Retry.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)