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

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


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

commit da45698dc59f1bb71bea0db9ce0f466556cfed1f
Author: Jacques Le Roux <jacques.le.r...@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;
             }

Reply via email to