Skip to content

Commit aeac4fd

Browse files
committed
fix some tests
1 parent dfd4173 commit aeac4fd

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ public void requestHeaderSendFile() throws Exception {
243243
+ "}\n"
244244
+ "</script></body></html>";
245245

246+
getMockWebConnection().setDefaultResponse("<html></html>");
246247
final WebDriver driver = loadPage2(html);
247248

248249
final File tstFile = File.createTempFile("HtmlUnitUploadTest", ".txt");
@@ -596,7 +597,7 @@ public void post_cookies() throws Exception {
596597
responseHeader = new ArrayList<>();
597598
responseHeader.add(new NameValuePair("Set-Cookie", "cookie=sweet"));
598599

599-
getMockWebConnection().setResponse(URL_FIRST, html,
600+
getMockWebConnection().setResponse(URL_FIRST, "<html></html>",
600601
200, "OK", "text/html;charset=ISO-8859-1", ISO_8859_1, responseHeader);
601602
loadPage2(URL_FIRST, null);
602603

@@ -610,8 +611,7 @@ public void post_cookies() throws Exception {
610611
public static class PostServlet2 extends HttpServlet {
611612

612613
@Override
613-
protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
614-
throws ServletException, IOException {
614+
protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
615615
final Writer writer = resp.getWriter();
616616

617617
writer.write(req.getQueryString() + ',' + req.getContentLength());
@@ -1094,22 +1094,18 @@ public void encodedXml() throws Exception {
10941094
+ "date\\sXYZ\\sGMT\\r\\n"
10951095
+ "server:\\sJetty(XXX)\\r\\n"
10961096
+ "transfer-encoding:\\schunked\\r\\n"})
1097-
@HtmlUnitNYI(CHROME = {"", "", "Date\\sXYZ\\sGMT\\r\\n"
1097+
@HtmlUnitNYI(CHROME = {"", "", "Server:\\sJetty(XXX)\\r\\nDate\\sXYZ\\sGMT\\r\\n"
10981098
+ "Content-Type:\\stext/xml;charset=iso-8859-1\\r\\n"
1099-
+ "Transfer-Encoding:\\schunked\\r\\n"
1100-
+ "Server:\\sJetty(XXX)\\r\\n"},
1101-
EDGE = {"", "", "Date\\sXYZ\\sGMT\\r\\n"
1099+
+ "Transfer-Encoding:\\schunked\\r\\n"},
1100+
EDGE = {"", "", "Server:\\sJetty(XXX)\\r\\nDate\\sXYZ\\sGMT\\r\\n"
11021101
+ "Content-Type:\\stext/xml;charset=iso-8859-1\\r\\n"
1103-
+ "Transfer-Encoding:\\schunked\\r\\n"
1104-
+ "Server:\\sJetty(XXX)\\r\\n"},
1105-
FF = {"", "", "Date\\sXYZ\\sGMT\\r\\n"
1102+
+ "Transfer-Encoding:\\schunked\\r\\n"},
1103+
FF = {"", "", "Server:\\sJetty(XXX)\\r\\nDate\\sXYZ\\sGMT\\r\\n"
11061104
+ "Content-Type:\\stext/xml;charset=iso-8859-1\\r\\n"
1107-
+ "Transfer-Encoding:\\schunked\\r\\n"
1108-
+ "Server:\\sJetty(XXX)\\r\\n"},
1109-
FF_ESR = {"", "", "Date\\sXYZ\\sGMT\\r\\n"
1105+
+ "Transfer-Encoding:\\schunked\\r\\n"},
1106+
FF_ESR = {"", "", "Server:\\sJetty(XXX)\\r\\nDate\\sXYZ\\sGMT\\r\\n"
11101107
+ "Content-Type:\\stext/xml;charset=iso-8859-1\\r\\n"
1111-
+ "Transfer-Encoding:\\schunked\\r\\n"
1112-
+ "Server:\\sJetty(XXX)\\r\\n"})
1108+
+ "Transfer-Encoding:\\schunked\\r\\n"})
11131109
public void getAllResponseHeaders() throws Exception {
11141110
final String html = DOCTYPE_HTML
11151111
+ "<html>\n"

src/test/java/org/htmlunit/util/JettyServerUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ public boolean handle(Request request, Response response, Callback callback) thr
409409
if (errorException != null) {
410410
System.err.println("\n==== Jetty Servlet Error ====");
411411
System.err.println("URI: " + request.getHttpURI());
412+
System.err.println("Method: " + request.getMethod());
412413
System.err.println("Exception: " + errorException.getClass().getName());
413414
System.err.println("Message: " + errorException.getMessage());
414415
errorException.printStackTrace(System.err);

0 commit comments

Comments
 (0)