This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/jmeter.git
commit 3d49c6efb781035ab23e14127502e765abdb2534 Author: PJ Fanning <[email protected]> AuthorDate: Sat Jul 23 15:32:28 2022 +0100 Update XPathUtilTest.java --- src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java b/src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java index c258cba5d3..89f1f4dc76 100644 --- a/src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java +++ b/src/core/src/test/java/org/apache/jmeter/util/XPathUtilTest.java @@ -19,6 +19,7 @@ package org.apache.jmeter.util; import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -251,7 +252,12 @@ public class XPathUtilTest { assertEquals("<page>two</page>", matchs.get(1)); matchs=new ArrayList<>(); XPathUtil.putValuesForXPathInList(testDoc, xpathquery, matchs, false); + assertEquals(2, matchs.size()); assertEquals("one", matchs.get(0)); assertEquals("two", matchs.get(1)); + matchs=new ArrayList<>(); + XPathUtil.putValuesForXPathInList(testDoc, "/book/a", matchs, false); + assertEquals(1, matchs.size()); + assertNull(matchs.get(0)); } }
