jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject svn commit: r1782628 - /jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java
Date Sat, 11 Feb 2017 17:16:28 GMT
Author: fschumacher
Date: Sat Feb 11 17:16:27 2017
New Revision: 1782628

URL: http://svn.apache.org/viewvc?rev=1782628&view=rev
Log:
Remove sysout in test and use assertThat instead of assertTrue, to get better error reporting.

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java

Modified: jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java?rev=1782628&r1=1782627&r2=1782628&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/extractor/TestXPathExtractor.java Sat Feb 11 17:16:27
2017
@@ -29,6 +29,7 @@ import org.apache.jmeter.samplers.Sample
 import org.apache.jmeter.threads.JMeterContext;
 import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.JMeterVariables;
+import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -302,10 +303,8 @@ public class TestXPathExtractor {
             
             assertEquals(1, result.getAssertionResults().length);
             assertEquals(extractor.getName(), result.getAssertionResults()[0].getName());
-            System.out.println(result.getAssertionResults()[0].
-                    getFailureMessage());
-            org.junit.Assert.assertTrue(result.getAssertionResults()[0].
-                    getFailureMessage().contains("XML document structures must start and
end within the same entity"));
+            org.junit.Assert.assertThat(result.getAssertionResults()[0].
+                    getFailureMessage(), CoreMatchers.containsString("XML document structures
must start and end within the same entity"));
 
             assertEquals("Default", vars.get(VAL_NAME));
             assertEquals("0", vars.get(VAL_NAME_NR));



Mime
View raw message