Skip to content

Commit 0d446ea

Browse files
committed
junit4 is gone
1 parent 66d858c commit 0d446ea

7 files changed

Lines changed: 285 additions & 304 deletions

File tree

src/test/java/org/htmlunit/SocksProxyTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package org.htmlunit;
1616

1717
import static org.eclipse.jetty.http.HttpVersion.HTTP_1_1;
18-
import static org.junit.Assume.assumeTrue;
1918

2019
import java.io.IOException;
2120
import java.net.MalformedURLException;
@@ -28,6 +27,7 @@
2827
import org.eclipse.jetty.util.ssl.SslContextFactory.Server;
2928
import org.htmlunit.html.HtmlPage;
3029
import org.junit.jupiter.api.Assertions;
30+
import org.junit.jupiter.api.Assumptions;
3131
import org.junit.jupiter.api.Test;
3232

3333
/**
@@ -98,7 +98,7 @@ private static void assumeSocksProxyInUse() {
9898
}
9999
}
100100
catch (final IOException e) {
101-
assumeTrue("Socks proxy is not available", false);
101+
Assumptions.assumeTrue(false, "Socks proxy is not available");
102102
}
103103
}
104104

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.htmlunit.javascript.host.event.KeyboardEvent;
2626
import org.htmlunit.junit.annotation.Alerts;
2727
import org.htmlunit.platform.AwtClipboardHandler;
28-
import org.junit.Assume;
28+
import org.junit.jupiter.api.Assumptions;
2929
import org.junit.jupiter.api.Test;
3030

3131
/**
@@ -643,7 +643,7 @@ public void minLengthValidation() throws Exception {
643643
*/
644644
@Test
645645
public void clipboardCopy() throws Exception {
646-
Assume.assumeFalse(SKIP_);
646+
Assumptions.assumeFalse(SKIP_);
647647

648648
final String html = DOCTYPE_HTML
649649
+ "<html><head>\n"
@@ -678,7 +678,7 @@ public void clipboardCopy() throws Exception {
678678
*/
679679
@Test
680680
public void clipboardPaste() throws Exception {
681-
Assume.assumeFalse(SKIP_);
681+
Assumptions.assumeFalse(SKIP_);
682682

683683
final String html = DOCTYPE_HTML
684684
+ "<html><head>\n"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import org.htmlunit.WebDriverTestCase;
2525
import org.htmlunit.junit.annotation.Alerts;
2626
import org.htmlunit.util.MimeType;
27-
import org.junit.Assume;
2827
import org.junit.jupiter.api.Assertions;
28+
import org.junit.jupiter.api.Assumptions;
2929
import org.junit.jupiter.api.Test;
3030
import org.openqa.selenium.By;
3131
import org.openqa.selenium.InvalidElementStateException;
@@ -1151,7 +1151,7 @@ private void validation(final String htmlPart, final String jsPart, final String
11511151
@Test
11521152
@Alerts({"abcx", "", "abcx", "abcx"})
11531153
public void clipboard() throws Exception {
1154-
Assume.assumeFalse(SKIP_);
1154+
Assumptions.assumeFalse(SKIP_);
11551155

11561156
final String html = DOCTYPE_HTML
11571157
+ "<html><head>\n"

src/test/java/org/htmlunit/javascript/host/intl/DateTimeFormat2Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import org.htmlunit.junit.annotation.Alerts;
2020
import org.htmlunit.junit.annotation.BuggyWebDriver;
2121
import org.htmlunit.junit.annotation.HtmlUnitNYI;
22-
import org.junit.ComparisonFailure;
2322
import org.junit.jupiter.api.Test;
23+
import org.opentest4j.AssertionFailedError;
2424

2525
/**
2626
* Tests for {@link DateTimeFormat}.
@@ -53,7 +53,7 @@ private void test(final String... string) throws Exception {
5353
try {
5454
loadPageVerifyTextArea2(html.toString());
5555
}
56-
catch (final ComparisonFailure e) {
56+
catch (final AssertionFailedError e) {
5757
final String msg = e.getMessage();
5858
for (int i = 0; i < msg.length(); i++) {
5959
final char c = msg.charAt(i);

src/test/java/org/htmlunit/javascript/host/intl/NumberFormat2Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import org.apache.commons.lang3.CharUtils;
1818
import org.htmlunit.WebDriverTestCase;
1919
import org.htmlunit.junit.annotation.Alerts;
20-
import org.junit.ComparisonFailure;
2120
import org.junit.jupiter.api.Test;
21+
import org.opentest4j.AssertionFailedError;
2222

2323
/**
2424
* Tests for {@link NumberFormat}.
@@ -50,7 +50,7 @@ private void test(final String... string) throws Exception {
5050
try {
5151
loadPageVerifyTextArea2(html.toString());
5252
}
53-
catch (final ComparisonFailure e) {
53+
catch (final AssertionFailedError e) {
5454
final String msg = e.getMessage();
5555
for (int i = 0; i < msg.length(); i++) {
5656
final char c = msg.charAt(i);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
import org.htmlunit.junit.annotation.Tries;
4343
import org.htmlunit.util.MimeType;
4444
import org.htmlunit.util.NameValuePair;
45-
import org.junit.ComparisonFailure;
4645
import org.junit.jupiter.api.Test;
4746
import org.openqa.selenium.By;
4847
import org.openqa.selenium.WebDriver;
48+
import org.opentest4j.AssertionFailedError;
4949

5050
/**
5151
* Tests for {@link XMLHttpRequest}.
@@ -235,7 +235,7 @@ private static void assertLog(final WebDriver driver, final String expected) thr
235235
assertEquals(expected, text);
236236
return;
237237
}
238-
catch (final ComparisonFailure e) {
238+
catch (final AssertionFailedError e) {
239239
if (System.currentTimeMillis() > maxWait) {
240240
throw e;
241241
}

0 commit comments

Comments
 (0)