You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by vl...@apache.org on 2019/09/28 20:52:41 UTC

[jmeter] branch master updated: Fix ParallelResourcesAndIpSource for Windows

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

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 70ffaf1  Fix ParallelResourcesAndIpSource for Windows
70ffaf1 is described below

commit 70ffaf18d9a4c03908dcb8719544d365b3b94e5d
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Sat Sep 28 23:52:31 2019 +0300

    Fix ParallelResourcesAndIpSource for Windows
    
    Java 8 lacks multiline string literals,
    so .replaceAll("\n", ...) was replacing the last line only.
---
 .../jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
index 351fa6f..767542e 100644
--- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
+++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/sampler/ParallelResourcesAndIpSource.java
@@ -106,7 +106,7 @@ public class ParallelResourcesAndIpSource {
 
         SampleResult result = http.sample();
 
-        Assertions.assertEquals(
+        String expected =
                 "url: http://wiremock/index.html\n" +
                         "response: OK\n" +
                         "data.size: 85\n" +
@@ -126,8 +126,9 @@ public class ParallelResourcesAndIpSource {
                         "- url: http://wiremock/index.html\n" +
                         "  response: OK\n" +
                         "  data.size: 85\n" +
-                        "  data: <html><body><img src='image1.png'><img src='image2.png'><img src='image3.png'></body>\n"
-                                .replaceAll("\n", System.lineSeparator()),
+                        "  data: <html><body><img src='image1.png'><img src='image2.png'><img src='image3.png'></body>\n";
+        Assertions.assertEquals(
+                expected.replaceAll("\n", System.lineSeparator()),
                 ResultAsString.toString(result)
                     .replaceAll(server.baseUrl(), "http://wiremock"));
     }