Skip to content

Commit 16ed130

Browse files
committed
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 Conflicts handled by hand
1 parent 6789011 commit 16ed130

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/ControlFilter.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
135135
offset = requestUri.length();
136136
}
137137
if (!GenericValue.getStackTraceAsString().contains("ControlFilterTests")
138-
&& !(System.getProperty("java.class.path").contains("--test component=solr") // Allows Solr tests
139-
|| System.getProperty("java.class.path").contains("ofbiz --test_ManifestJar.jar") // Allows Solr tests in testIntegration
140-
|| System.getProperty("java.class.path").contains("ofbiz.jar")) // Allows Solr tests in testIntegration in 18.12
138+
&& null == System.getProperty("SolrDispatchFilter") // Allows Solr tests
141139
&& SecurityUtil.containsFreemarkerInterpolation(httpRequest, httpResponse, requestUri)) {
142140
return;
143141
}

0 commit comments

Comments
 (0)