------------------------------------------------------------------------
r1850015 | jleroux | 2018-12-31 07:38:36 +0100 (lun. 31 déc. 2018) | 16 lignes
Improved: Prepare the migration to XStream 1.5
(OFBIZ-10756)
Fixes CVE-2018-17200
We currently use the UnsupportedClassConverter method in UtilXml class.
When the 1.5 version of XStream will be available another way to handle this
kind of things will be available and used by default. It's already possible to
use the same with the 1.4 version of XStream with its setupDefaultSecurity method.
So this replaces the UnsupportedClassConverter in UtilXml class by
XStream::setupDefaultSecurity method.
It's an improvement but better to backport it as much as possible
The UtilXmlTests class and its use is removed and the UnsupportedClassConverter
method deprecated (no use OOTB)
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1850018 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10646)
Following discussion at https://markmail.org/message/y3izmnxd7jd6jbkf
this cleans some Groovy files in the base component, notably:
* remove ant-scripts folder and its content.
* Rename framework/base/groovyScript to framework/base/groovyScripts;
* Move GroovyInit.groovy and GroovyServiceTest.groovy respectively to
framework/base/groovyScripts and framework/common/groovyScripts
and change their paths where used.
* Removes GroovyInit.groovy from excludedConfigFiles in build.gradle
* After OFBIZ-10611 it's possible to move GroovyBaseScript.groovy from
framework/service/src/main/java/org/apache/ofbiz/service/engine
to
framework/service/src/main/groovy/org/apache/ofbiz/service/engine
* Removes FileUtilTests.groovy from basetests.xml (missed it in OFBIZ-10611)
* Fixes a typo in test-suite.xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846485 13f79535-47bb-0310-9956-ffa450edef68
Add zipFileStream method that will zip FileStream to a zipped one.
Add unzipFileToFolder method to unzip a given archive to a given Folder.
Add fileUtil groovy test suite that create zip file containing README.md, then unzip it to tmp folder and compare original and unzipped files.
Thanks Jacques for the review.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823567 13f79535-47bb-0310-9956-ffa450edef68
With the minilang deprecation and the migration to groovy, I implemented on the ofbiz testtools the possibility to use groovy for write new integration test or convert current simple xml test.
Now you can define a new element as child of test-group on your xml test-suite file like
<groovy-test-suite name=simple location=component://base/groovyScript/test/SimpleTests.groovy/>
To Write your test, you need to create a Groovy class that extends GroovyScriptTestCase class :
import org.apache.ofbiz.testtools.GroovyScriptTestCase
class BaseTest extends GroovyScriptTestCase {
void testTrue() {
assert 1, 1
}
}
All your function will execute as TestCase.
For more information on groovy specific testing language see http://groovy-lang.org/testing.html
At this time the OFBiz Groovy DSL isn't supported to write groovy test case but you have access to the delegator and the disphatcher as native class variable.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1816335 13f79535-47bb-0310-9956-ffa450edef68
The DefaultEncoder from OWASP ESAPI, used internally by UtilCodec is now built with the default constructor that also adds the JavascriptCodec to the list of codecs used to canonicalize and validate the input.
Renamed the UrlEncoder class to UrlCodec in order to better describe its behavior.
Misc minor cleanups.
Added to the list of tests of the base component a series of Junit test classes that were missing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1648403 13f79535-47bb-0310-9956-ffa450edef68
* moved the json-lib jar (json-lib-2.2.3-jdk15.jar) from the framework/webapp to the framework/base component
* removed the SQL select Parser.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code
* removed the JSON.jj (parser definition) and its unit tests: it was not used (and never used) by any OFBiz code apart from the JSON Converters (now migrated to json-lib, see next items in this list) some utility methods in UtilIO.java (that have been removed too because they have never been used in OFBiz)
* removed the JavaCC jar and related ant scripts because no more needed after the removal of Parser.jj and JSON.jj
* converted the JSONConverter code that was based on JSON.jj to Jackson
* added a new class org.ofbiz.base.lang.JSON that have been contributed by Adrian Crum that is a facade for simplifying the client code and for hiding the specific JSON library being used
* removed an unused method: ImageManagementServices.toJsonObject(...)
* added TestBooleanConverters to the list of tests
* new unit tests for the new JSON converters
* refactored Ajax code in applications to use the common request json response rather than a custom method
* OFBIZ-5790 Implemented ability to call a service event by passing its input parameters in the request body as JSON data. These classes provide a simple mechanism, based on the request's content type, that can be extended to support other formats (e.g. XML).
This commit resolves OFBIZ-4572, OFBIZ-3365, OFBIZ-5751, OFBIZ-5790
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1635901 13f79535-47bb-0310-9956-ffa450edef68
Provided better settings for the thread pools to avoid to keep alive threads that are only needed at startup.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1626977 13f79535-47bb-0310-9956-ffa450edef68
The xsd for the resource xml files is invalid. In addition, the format of the value of the xml:lang attribute in resource xml files is invalid, according to the xml standard.
The attached patch:
provides a valid xsd
updates UtilProperties and the Label Manager to deal with the correct formatting of the xml:lang value, while still working with the old format, following Adrian Crum's recommendation on the mailing list
includes simple unit tests for UtilProperties to ensure it does work with both formats
changes the Label Manager to include a reference to the new xsd, and to use the correct format of the xml:lang value, when writing a resource xml file.
Some minor code cleanups to these files.
jleroux: the base test suite was successfully run locally once UtilIOTests have been commented out (still an issue with it on Windows)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1305004 13f79535-47bb-0310-9956-ffa450edef68
The xsd for the resource xml files is invalid. In addition, the format of the value of the xml:lang attribute in resource xml files is invalid, according to the xml standard.
The attached patch:
provides a valid xsd
updates UtilProperties and the Label Manager to deal with the correct formatting of the xml:lang value, while still working with the old format, following Adrian Crum's recommendation on the mailing list
includes simple unit tests for UtilProperties to ensure it does work with both formats
changes the Label Manager to include a reference to the new xsd, and to use the correct format of the xml:lang value, when writing a resource xml file.
Some minor code cleanups to these files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1304193 13f79535-47bb-0310-9956-ffa450edef68