Commit Graph
33 Commits
Author SHA1 Message Date
Jacques Le Roux 2b15c0302c Fixed: Add http to https redirect rule for ofbiz.apache.org (OFBIZ-10590)
This prevented to run the stable demo
2021-07-20 07:35:11 +02:00
Jacques Le Roux ec763d3196 "Applied fix from trunk for revision: 1850015 "
------------------------------------------------------------------------
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/release17.12@1850016 13f79535-47bb-0310-9956-ffa450edef68
2018-12-31 06:39:23 +00:00
Nicolas Malin 48f90d5b74 Implemented: Implement Groovy test in testtools (OFBIZ-9996)
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
2017-11-25 17:35:20 +00:00
Jacopo Cappellato 34339a976b Improved: Migrated unit tests for UtilCodec defined in the old "integration test" group to the new class that contains actual unit tests for the UtilCodec class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760047 13f79535-47bb-0310-9956-ffa450edef68
2016-09-09 15:54:01 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Adrian Crum cd4f6cdbb3 Fixed a bug in UtilMisc.java where the List returned by the availableLocales() method included an empty Locale - causing errors in FreeMarker templates.
https://issues.apache.org/jira/browse/OFBIZ-6309

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1676674 13f79535-47bb-0310-9956-ffa450edef68
2015-04-29 06:10:01 +00:00
Jacopo Cappellato a5879b6f8f Moved code dependent on OWASP ESAPI and utilities for codec tasks from StringUtil to a new UtilCodec class: now the UtilCodec class is the only class dependent on OWASP ESAPI.
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
2014-12-29 18:24:57 +00:00
Jacopo Cappellato 3552f65800 Merged json-integration-refactoring into trunk:
* 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
2014-11-01 09:06:42 +00:00
Jacopo Cappellato f14003d799 Removed a bunch of never used classes from the base/concurrent package.
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
2014-09-23 10:52:29 +00:00
Adrian Crum fe9cd1f776 Added the ability to exclude certain classes from XML serialization/deserialization.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1557427 13f79535-47bb-0310-9956-ffa450edef68
2014-01-11 17:39:38 +00:00
Jacques Le Roux 7d943cb341 A patch from Anne Jessel "Support validation of resource xml files" https://issues.apache.org/jira/browse/OFBIZ-4723
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
2012-03-25 11:07:57 +00:00
Jacques Le Roux 0c07b6df6f Revert r1304193 for now
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1304737 13f79535-47bb-0310-9956-ffa450edef68
2012-03-24 09:35:09 +00:00
Jacques Le Roux 1c5a0459c3 A patch from Anne Jessel "Support validation of resource xml files" https://issues.apache.org/jira/browse/OFBIZ-4723
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
2012-03-23 05:47:10 +00:00
Erwan de Ferrieres 195ebb9010 missing license header and xml prefix
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1244208 13f79535-47bb-0310-9956-ffa450edef68
2012-02-14 20:54:19 +00:00
Marco Risaliti 65d922b529 Change a wrong class name in the base test suite to be executed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1125971 13f79535-47bb-0310-9956-ffa450edef68
2011-05-22 14:17:08 +00:00
Marco Risaliti 0291aa60d8 Change a wrong package name in the test suite to be executed
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1125970 13f79535-47bb-0310-9956-ffa450edef68
2011-05-22 14:11:55 +00:00
Adrian Crum 355cc6a59e Fix framework/base tests that were not running. Patch from Bob Morley with a few changes by me - https://issues.apache.org/jira/browse/OFBIZ-3662.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1085735 13f79535-47bb-0310-9956-ffa450edef68
2011-03-26 15:11:00 +00:00
Adam Heath fcd5a641ad s/test-case/test-group/, taken from OFBIZ-3661, so that all tests will
be run.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@932233 13f79535-47bb-0310-9956-ffa450edef68
2010-04-09 03:19:27 +00:00
Adam Heath 160e608257 Thread-pool baesd dependency resolution framework. This implementation
is also non-blocking.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@930739 13f79535-47bb-0310-9956-ffa450edef68
2010-04-04 19:14:04 +00:00
Adam Heath 8f74e23e50 Start UtilCache tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@929392 13f79535-47bb-0310-9956-ffa450edef68
2010-03-31 06:05:05 +00:00
Adam Heath b289b45142 Move the test case for ComparableRange to the correct package.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@918724 13f79535-47bb-0310-9956-ffa450edef68
2010-03-03 22:10:52 +00:00
Adam Heath a4b4761af9 ObjectType tests.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@917362 13f79535-47bb-0310-9956-ffa450edef68
2010-03-01 03:11:37 +00:00
Adam Heath a6cf22123c Move ComparableRange tests to a separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@915682 13f79535-47bb-0310-9956-ffa450edef68
2010-02-24 05:41:49 +00:00
Adam Heath 052c48555f Move FMA tests to a separate file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@915390 13f79535-47bb-0310-9956-ffa450edef68
2010-02-23 15:42:17 +00:00
Adam Heath f7ec7cb185 Move FlexibleStringExpander tests to a separate file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@912272 13f79535-47bb-0310-9956-ffa450edef68
2010-02-21 01:27:32 +00:00
Adam Heath e0eb9976f6 Some tests for UtilObject; not full coverage, but very close.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@911092 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 17:25:09 +00:00
Adam Heath 2feee8bec9 Add TimeDurationTests; full line coverage, almost full branch coverage.
There are some bugs not fixed by this commit, those will come shortly.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910827 13f79535-47bb-0310-9956-ffa450edef68
2010-02-17 05:15:59 +00:00
Adam Heath 3e476eedcd Move DateTime conversion tests to separate class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@910354 13f79535-47bb-0310-9956-ffa450edef68
2010-02-15 22:23:55 +00:00
Adam Heath d946201a4b A writer that allows calling code to add non-important spaces, tabs, and
new lines, then this extra formatting can easily be turned off.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908711 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:46:29 +00:00
Adam Heath 93f5a082d7 UtilIO.readString enhancements.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908702 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:42:51 +00:00
Adam Heath f10280139d Correct pass thru conversion, to return the correct source/target types.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@908691 13f79535-47bb-0310-9956-ffa450edef68
2010-02-10 22:32:51 +00:00
Adrian Crum fba568b7bc Fixed incorrect framework/base test class binary name.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@833781 13f79535-47bb-0310-9956-ffa450edef68
2009-11-08 00:01:06 +00:00
Jacques Le Roux bf3d2e6726 Patches from Chris Lombardi "POS: full credit card number is printed on receipt" (https://issues.apache.org/jira/browse/OFBIZ-1687) - OFBIZ-1687
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@637310 13f79535-47bb-0310-9956-ffa450edef68
2008-03-15 00:33:36 +00:00