diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/AbstractJettyTestCase.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/AbstractJettyTestCase.java index f7d7722a980..aaafdd4e6e4 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/AbstractJettyTestCase.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/AbstractJettyTestCase.java @@ -103,6 +103,19 @@ public abstract class AbstractJettyTestCase extends TestCase return str; } - return str.replaceAll("\n","\r\n"); + StringBuffer ret = new StringBuffer(); + for (char c : str.toCharArray()) + { + switch (c) + { + case '\n': + ret.append("\r\n"); + break; + default: + ret.append(c); + } + } + + return ret.toString(); } } diff --git a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTester.java b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTester.java index 7e1ac66456c..a7b97d030e8 100644 --- a/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTester.java +++ b/tests/test-integration/src/test/java/org/eclipse/jetty/test/support/rawhttp/HttpResponseTester.java @@ -366,8 +366,21 @@ public class HttpResponseTester { return str; } + + StringBuffer ret = new StringBuffer(); + for (char c : str.toCharArray()) + { + switch (c) + { + case '\n': + ret.append("\r\n"); + break; + default: + ret.append(c); + } + } - return str.replaceAll("\n","\r\n"); + return ret.toString(); } public void assertNoBody(String msg)