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 2023/04/28 18:40:56 UTC

[jmeter] branch master updated: chore: downgrade jodd back to 5.0.13 from 5.1.5 since there are failing tests

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 e802b98c2a chore: downgrade jodd back to 5.0.13 from 5.1.5 since there are failing tests
e802b98c2a is described below

commit e802b98c2abd84537bd887f4e3cd6c6752cd2b1e
Author: Vladimir Sitnikov <si...@gmail.com>
AuthorDate: Fri Apr 28 21:40:37 2023 +0300

    chore: downgrade jodd back to 5.0.13 from 5.1.5 since there are failing tests
    
    TestHTMLParser.testSpecificParserList fails with jodd 5.1.5
---
 src/bom-thirdparty/build.gradle.kts                |  8 ++---
 .../protocol/http/parser/TestHTMLParser.java       | 37 +++++++---------------
 2 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/src/bom-thirdparty/build.gradle.kts b/src/bom-thirdparty/build.gradle.kts
index 8e436e4e94..a89fcf38a7 100644
--- a/src/bom-thirdparty/build.gradle.kts
+++ b/src/bom-thirdparty/build.gradle.kts
@@ -111,10 +111,10 @@ dependencies {
         api("org.exparity:hamcrest-date:2.0.8")
         api("org.freemarker:freemarker:2.3.32")
         api("org.jdom:jdom:1.1.3")
-        api("org.jodd:jodd-core:5.1.5")
-        api("org.jodd:jodd-lagarto:5.1.5")
-        api("org.jodd:jodd-log:5.1.5")
-        api("org.jodd:jodd-props:5.1.5")
+        api("org.jodd:jodd-core:5.0.13")
+        api("org.jodd:jodd-lagarto:5.0.13")
+        api("org.jodd:jodd-log:5.0.13")
+        api("org.jodd:jodd-props:5.0.13")
         api("org.jsoup:jsoup:1.15.4")
         api("org.mongodb:mongo-java-driver:2.11.3")
         api("org.mozilla:rhino:1.7.14")
diff --git a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
index 8155eb1796..bcdea11aaa 100644
--- a/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
+++ b/src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/parser/TestHTMLParser.java
@@ -35,6 +35,11 @@ import java.util.Properties;
 import java.util.TreeSet;
 import java.util.Vector;
 import java.util.stream.Collectors;
+import java.util.stream.StreamSupport;
+
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.jmeter.junit.JMeterTestCaseJUnit;
@@ -395,38 +400,18 @@ public class TestHTMLParser extends JMeterTestCaseJUnit implements Describable {
         } else {
             result = p.getEmbeddedResourceURLs(userAgent, buffer, new URL(url), c,System.getProperty("file.encoding"));
         }
+        List<String> actual = Lists.newArrayList(Iterators.transform(result, Object::toString));
         /*
          * TODO: Exact ordering is only required for some tests; change the
          * comparison to do a set compare where necessary.
          */
-        Iterator<String> expected;
-        if (orderMatters) {
-            expected = getFile(resultFile).iterator();
-        } else {
-            // Convert both to Sets
-            expected = new TreeSet<>(getFile(resultFile)).iterator();
-            TreeSet<URL> temp = new TreeSet<>(new Comparator<Object>() {
-                @Override
-                public int compare(Object o1, Object o2) {
-                    return o1.toString().compareTo(o2.toString());
-                }
-            });
-            while (result.hasNext()) {
-                temp.add(result.next());
-            }
-            result = temp.iterator();
+        List<String> expected = getFile(resultFile);
+        if (!orderMatters) {
+            Collections.sort(expected);
+            Collections.sort(actual);
         }
 
-        while (expected.hasNext()) {
-            Object next = expected.next();
-            assertTrue(userAgent+"::"+fname+"::"+parserName + "::Expecting another result " + next, result.hasNext());
-            try {
-                assertEquals(userAgent+"::"+fname+"::"+parserName + "(next)", next, result.next().toString());
-            } catch (ClassCastException e) {
-                fail(userAgent+"::"+fname+"::"+parserName + "::Expected URL, but got " + e.toString());
-            }
-        }
-        assertFalse(userAgent+"::"+fname+"::"+parserName + "::Should have reached the end of the results", result.hasNext());
+        assertEquals("userAgent=" + userAgent + ", fname=" + fname + ", parserName=" + parserName, expected, actual);
     }
 
     // Get expected results as a List