Skip to content

Commit

Permalink
Upgrade HtmlUnit 4.1.0 to 4.3.0.
Browse files Browse the repository at this point in the history
 - fix HtmlUnitUITest
 - fix HtmlUnitIsolateBrowserTest
 - fix HtmlServerUnloadedJSTest
 - fix HtmlUnitServerTest
 - fix HtmlUnitMergeTest
 - fix HtmlServerUnloadedJSProxyOnlyInstrumentRegTest
 - fix HtmlUnitServerBranchAndFunctionTest
 - fix HtmlServerUnloadedJSProxyTest
 - fix HtmlUnitProxyTest
 - fix HtmlServerUnloadedJSProxyUriToFileTest
  • Loading branch information
tntim96 committed Jul 6, 2024
1 parent cce1fa2 commit 80ec1de
Show file tree
Hide file tree
Showing 15 changed files with 145 additions and 71 deletions.
2 changes: 1 addition & 1 deletion History.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
2.0.20 / 2024-??-??
==================
* Upgrade closure-compiler v20231112 to v20240317, gson 2.10.1 to 2.11.0
* Internal: HtmlUnit 3.9.0 to 4.1.0, Mockito 5.8.0 to 5.12.0, JaCoCo 0.8.11 to 0.8.12, Rhino 1.7.14 to 1.7.15, Maven Resolver Ant Tasks 1.2.1-SNAPSHOT to 1.5.1
* Internal: HtmlUnit 3.9.0 to 4.3.0, Mockito 5.8.0 to 5.12.0, JaCoCo 0.8.11 to 0.8.12, Rhino 1.7.14 to 1.7.15, Maven Resolver Ant Tasks 1.2.1-SNAPSHOT to 1.5.1

2.0.19 / 2024-01-02
==================
Expand Down
18 changes: 9 additions & 9 deletions JSCover.iml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
<orderEntry type="library" name="Maven: com.google.javascript:closure-compiler:v20240317" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.27.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.httpcomponents:httpmime:4.5.14" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.httpcomponents:httpclient:4.5.14" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.httpcomponents:httpcore:4.4.16" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-core-js:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:neko-htmlunit:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-cssparser:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-xpath:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-csp:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-websocket-client:4.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-core-js:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:neko-htmlunit:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-cssparser:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-xpath:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-csp:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.htmlunit:htmlunit-websocket-client:4.3.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.commons:commons-lang3:3.14.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.commons:commons-text:1.12.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-io:commons-io:2.16.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-logging:commons-logging:1.3.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-net:commons-net:3.10.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-logging:commons-logging:1.3.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-net:commons-net:3.11.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: commons-codec:commons-codec:1.17.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.brotli:dec:0.1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mozilla:rhino:1.7.15" level="project" />
Expand Down
90 changes: 45 additions & 45 deletions JSCover.ipr
Original file line number Diff line number Diff line change
Expand Up @@ -764,28 +764,28 @@
<root url="jar://$MAVEN_REPOSITORY$/commons-io/commons-io/2.16.1/commons-io-2.16.1-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: commons-logging:commons-logging:1.3.1" type="java-imported" external-system-id="Maven">
<properties groupId="commons-logging" artifactId="commons-logging" version="1.3.1" />
<library name="Maven: commons-logging:commons-logging:1.3.2" type="java-imported" external-system-id="Maven">
<properties groupId="commons-logging" artifactId="commons-logging" version="1.3.2" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.1/commons-logging-1.3.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.2/commons-logging-1.3.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.1/commons-logging-1.3.1-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.2/commons-logging-1.3.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.1/commons-logging-1.3.1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.3.2/commons-logging-1.3.2-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: commons-net:commons-net:3.10.0" type="java-imported" external-system-id="Maven">
<properties groupId="commons-net" artifactId="commons-net" version="3.10.0" />
<library name="Maven: commons-net:commons-net:3.11.1" type="java-imported" external-system-id="Maven">
<properties groupId="commons-net" artifactId="commons-net" version="3.11.1" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.10.0/commons-net-3.10.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.11.1/commons-net-3.11.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.10.0/commons-net-3.10.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.11.1/commons-net-3.11.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.10.0/commons-net-3.10.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/commons-net/commons-net/3.11.1/commons-net-3.11.1-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: junit:junit:4.13.2" type="java-imported" external-system-id="Maven">
Expand Down Expand Up @@ -920,88 +920,88 @@
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest/2.2/hamcrest-2.2-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit-core-js:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-core-js" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit-core-js:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-core-js" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.1.0/htmlunit-core-js-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.3.0/htmlunit-core-js-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.1.0/htmlunit-core-js-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.3.0/htmlunit-core-js-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.1.0/htmlunit-core-js-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-core-js/4.3.0/htmlunit-core-js-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit-csp:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-csp" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit-csp:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-csp" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.1.0/htmlunit-csp-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.3.0/htmlunit-csp-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.1.0/htmlunit-csp-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.3.0/htmlunit-csp-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.1.0/htmlunit-csp-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-csp/4.3.0/htmlunit-csp-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit-cssparser:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-cssparser" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit-cssparser:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-cssparser" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.1.0/htmlunit-cssparser-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.3.0/htmlunit-cssparser-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.1.0/htmlunit-cssparser-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.3.0/htmlunit-cssparser-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.1.0/htmlunit-cssparser-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-cssparser/4.3.0/htmlunit-cssparser-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit-websocket-client:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-websocket-client" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit-websocket-client:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-websocket-client" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.1.0/htmlunit-websocket-client-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.3.0/htmlunit-websocket-client-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.1.0/htmlunit-websocket-client-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.3.0/htmlunit-websocket-client-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.1.0/htmlunit-websocket-client-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-websocket-client/4.3.0/htmlunit-websocket-client-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit-xpath:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-xpath" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit-xpath:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit-xpath" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.1.0/htmlunit-xpath-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.3.0/htmlunit-xpath-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.1.0/htmlunit-xpath-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.3.0/htmlunit-xpath-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.1.0/htmlunit-xpath-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit-xpath/4.3.0/htmlunit-xpath-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:htmlunit:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit" version="4.1.0" />
<library name="Maven: org.htmlunit:htmlunit:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="htmlunit" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.1.0/htmlunit-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.3.0/htmlunit-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.1.0/htmlunit-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.3.0/htmlunit-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.1.0/htmlunit-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/htmlunit/4.3.0/htmlunit-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.htmlunit:neko-htmlunit:4.1.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="neko-htmlunit" version="4.1.0" />
<library name="Maven: org.htmlunit:neko-htmlunit:4.3.0" type="java-imported" external-system-id="Maven">
<properties groupId="org.htmlunit" artifactId="neko-htmlunit" version="4.3.0" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.1.0/neko-htmlunit-4.1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.3.0/neko-htmlunit-4.3.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.1.0/neko-htmlunit-4.1.0-javadoc.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.3.0/neko-htmlunit-4.3.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.1.0/neko-htmlunit-4.1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/htmlunit/neko-htmlunit/4.3.0/neko-htmlunit-4.3.0-sources.jar!/" />
</SOURCES>
</library>
<library name="Maven: org.jacoco:org.jacoco.agent:0.8.12" type="java-imported" external-system-id="Maven">
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>4.1.0</version>
<version>4.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/jscover/server/SimpleWebServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,18 @@ You should also get your employer (if you work as a programmer) or your

package jscover.server;

import jscover.util.IoUtils;

import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class SimpleWebServer {
private static boolean running = true;
private static IoUtils ioUtils = new IoUtils();

public static void main(String args[]) throws Exception {
public static void main(String args[]) {
ServerSocket server = null;
try {
server = new ServerSocket(Integer.valueOf(args[1]));
Expand All @@ -358,8 +362,10 @@ public static void main(String args[]) throws Exception {
Socket socket = server.accept();
(new HttpServer(socket, wwwRoot, "simpleWebServer")).start();
}
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
server.close();
ioUtils.closeQuietly(server);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ You should also get your employer (if you work as a programmer) or your
public class HtmlServerUnloadedJSProxyOnlyInstrumentRegTest {
private static Thread webServer;
private static Thread proxyServer;
private static Thread reportWebServer;
private static Main main = new Main();
private static ServerSocket serverSocket;
private static int proxyPort = 3129;
Expand All @@ -383,6 +384,10 @@ public class HtmlServerUnloadedJSProxyOnlyInstrumentRegTest {
"--include-unloaded-js",
"--report-dir=" + reportDir
};
protected static String[] reportWebServerArgs = new String[]{
reportDir,
"9002",
};

@BeforeClass
public static void setUpOnce() {
Expand All @@ -401,6 +406,8 @@ public static void setUpOnce() {
}
});
webServer.start();
reportWebServer = new Thread(() -> SimpleWebServer.main(reportWebServerArgs));
reportWebServer.start();
}

@AfterClass
Expand Down Expand Up @@ -445,8 +452,7 @@ public void shouldIncludeUnloadJSInSavedReport() throws Exception {
assertThat(json, containsString("/level1/level1.js"));
assertThat(json, containsString("/level1/level2/level2.js"));

String url = "file:///" + new File(reportDir + "/jscoverage.html").getAbsolutePath();
page = webClient.getPage(url);
page = webClient.getPage("http://127.0.0.1:9002/jscoverage.html");
webClient.waitForBackgroundJavaScript(1000);

assertEquals("37%", page.getElementById("summaryTotal").getTextContent());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ You should also get your employer (if you work as a programmer) or your
public class HtmlServerUnloadedJSProxyTest extends HtmlServerUnloadedJSTest {
private static Thread webServer;
private static Thread proxyServer;
private static Thread reportWebServer;
private static Main main = new Main();
private static ServerSocket serverSocket;
private static int proxyPort = 3129;
Expand All @@ -371,6 +372,10 @@ public class HtmlServerUnloadedJSProxyTest extends HtmlServerUnloadedJSTest {
"--include-unloaded-js",
"--report-dir=" + reportDir
};
protected static String[] reportWebServerArgs = new String[]{
reportDir,
"9002",
};

@Override
protected String getReportDir() {
Expand All @@ -394,6 +399,8 @@ public static void setUpOnce() {
}
});
webServer.start();
reportWebServer = new Thread(() -> SimpleWebServer.main(reportWebServerArgs));
reportWebServer.start();
}

@AfterClass
Expand Down
Loading

0 comments on commit 80ec1de

Please sign in to comment.