You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2022/04/13 13:02:57 UTC

[ofbiz-framework] branch release22.01 updated: Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)

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

jleroux pushed a commit to branch release22.01
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release22.01 by this push:
     new 2e81ebe705 Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)
2e81ebe705 is described below

commit 2e81ebe7057d69c9f0a78135280eb5e57770f9bd
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Wed Apr 13 14:24:26 2022 +0200

    Fixed: Test run was unsuccessful because of failing solr tests (OFBIZ-12595)
    
    The previous commit for OFBIZ-12594 was only working on Windows. On *nix OSs
    there is no way to reliably get "--test" String from java.class.path property.
    
    Also the previous fix was brittle because relying only on 1 space separating
    words.
    
    This fix puts in the SolrDispatchFilter system property at the beginning of the
    4 Solr tests and removes it at end of them. That presence can reliably be tested
    in ControlFilter that is called before SolrDispatchFilter. It allows to bypass
    SecurityUtil::containsFreemarkerInterpolation that would else change the
    parameters content type that must be application/x-www-form-urlencoded.
    content
    
    Thanks: Tom Pietsch for report and Mart Naum for confirmation
---
 .../src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
index e87a538eed..b0e57181a2 100644
--- a/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
+++ b/framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java
@@ -149,9 +149,9 @@ public class ControlFilter extends HttpFilter {
             String uriWithContext = req.getRequestURI();
             String uri = uriWithContext.substring(context.length());
 
+
             if (!GenericValue.getStackTraceAsString().contains("ControlFilterTests")
-                    && !(System.getProperty("java.class.path").contains("--test component=solr") // Allows Solr tests
-                            || System.getProperty("java.class.path").contains("ofbiz --test_ManifestJar.jar")) // Allows Solr tests in testIntegration
+                    && null == System.getProperty("SolrDispatchFilter") // Allows Solr tests
                     && SecurityUtil.containsFreemarkerInterpolation(req, resp, uri)) {
                 return;
             }