jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1783783 - /jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java
Date Mon, 20 Feb 2017 17:30:26 GMT
Author: fschumacher
Date: Mon Feb 20 17:30:25 2017
New Revision: 1783783

URL: http://svn.apache.org/viewvc?rev=1783783&view=rev
Log:
Use a OS dependent lineseparator to compare the results of the XPath-util.

Bugzilla Id: 60752

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java?rev=1783783&r1=1783782&r2=1783783&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/util/XPathUtilTest.java Mon Feb 20 17:30:25 2017
@@ -27,11 +27,13 @@ import org.junit.Test;
 
 public class XPathUtilTest {
 
+    final String lineSeparator = System.getProperty("line.separator");
+
     @Test
     public void testFormatXmlSimple() {
         assertThat(XPathUtil.formatXml("<one foo='bar'>Test</one>"),
                 CoreMatchers.is("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-                        + "<one foo=\"bar\">Test</one>\n"));
+                        + "<one foo=\"bar\">Test</one>" + lineSeparator));
     }
 
     @Test
@@ -39,10 +41,12 @@ public class XPathUtilTest {
         assertThat(
                 XPathUtil.formatXml(
                         "<one foo='bar'><two/><three><four p=\"1\"/></three>...</one>"),
-                CoreMatchers.is("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-                        + "<one foo=\"bar\">\n" + "  <two/>\n" + "  <three>\n"
-                        + "    <four p=\"1\"/>\n" + "  </three>" + "..."
-                        + "</one>\n"));
+                CoreMatchers.is(String.join(lineSeparator, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><one
foo=\"bar\">",
+                        "  <two/>",
+                        "  <three>",
+                        "    <four p=\"1\"/>",
+                        "  </three>...</one>",
+                        "")));
     }
 
     @Test()



Mime
View raw message