You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/09/16 16:40:30 UTC

[tomcat] branch 8.5.x updated: Fix test failure on Windows

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 5debbdf  Fix test failure on Windows
5debbdf is described below

commit 5debbdfc0dfbf03ed5d9236f31323527250d5258
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Sep 13 18:05:47 2019 +0100

    Fix test failure on Windows
---
 test/org/apache/coyote/http2/TestStreamProcessor.java | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/coyote/http2/TestStreamProcessor.java b/test/org/apache/coyote/http2/TestStreamProcessor.java
index 5f9651a..a4dd5f1 100644
--- a/test/org/apache/coyote/http2/TestStreamProcessor.java
+++ b/test/org/apache/coyote/http2/TestStreamProcessor.java
@@ -35,6 +35,7 @@ import org.junit.Test;
 import org.apache.catalina.Context;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.startup.Tomcat;
+import org.apache.tomcat.util.compat.JrePlatform;
 import org.apache.tomcat.util.http.FastHttpDateFormat;
 
 public class TestStreamProcessor extends Http2TestBase {
@@ -150,11 +151,19 @@ public class TestStreamProcessor extends Http2TestBase {
 
         parser.readFrame(true);
 
-        Assert.assertEquals("3-HeadersStart\n" +
-                "3-Header-[:status]-[304]\n" +
-                "3-Header-[etag]-[W/\"934-1447269522000\"]\n" +
-                "3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n" +
-                "3-HeadersEnd\n", output.getTrace());
+        StringBuilder expected = new StringBuilder();
+        expected.append("3-HeadersStart\n");
+        expected.append("3-Header-[:status]-[304]\n");
+        // Different line-endings -> different files size -> different weak eTag
+        if (JrePlatform.IS_WINDOWS) {
+            expected.append("3-Header-[etag]-[W/\"957-1447269522000\"]\n");
+        } else {
+            expected.append("3-Header-[etag]-[W/\"934-1447269522000\"]\n");
+        }
+        expected.append("3-Header-[date]-[Wed, 11 Nov 2015 19:18:42 GMT]\n");
+        expected.append("3-HeadersEnd\n");
+
+        Assert.assertEquals(expected.toString(), output.getTrace());
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org