Mathieu Lirzin
229fdbb6d5
Implemented: Add unit tests for ‘UtilHttp#makeParamListWithSuffix’
...
(OFBIZ-11138)
Adapt implementation to facilitate mocking.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863440 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 22:07:55 +00:00
Mathieu Lirzin
1720a2ff62
Improved: Refactor ‘UtilHttp#makeParamValueFromComposite’
...
(OFBIZ-11138)
Use ‘LocalDateTime’ instead of ‘Calendar’ and
‘HttpServletRequest#getParameterMap’ instead of
‘HttpServletRequest#getParameterNames’.
The tests and callers has been adapted to remove the ‘locale’ arguments which
made sense only for ‘Calendar’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863439 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 22:06:48 +00:00
Mathieu Lirzin
479c16d96b
Implemented: Add unit tests for ‘UtilHttp#makeParamValueFromComposite’
...
(OFBIZ-11138)
The implementation has been adapted to facilitate mocking.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863437 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 21:50:14 +00:00
Mathieu Lirzin
37b6edb2a6
Improved: Remove useless ‘UtilHttp#parametersToAttributes’
...
(OFBIZ-11138)
This method was so trivial that it doesn't make sense to provide it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863403 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:32:18 +00:00
Mathieu Lirzin
4c72492d26
Improved: Remove unused ‘UtilHttp#checkURLforSpiders’
...
(OFBIZ-11138)
It was not used anywhere in the framework or the official plugins.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863402 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:30:57 +00:00
Mathieu Lirzin
abf0a9ac4b
Improved: Use a predicate in ‘UtilHttp#getParameterMap’
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863401 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:29:31 +00:00
Mathieu Lirzin
39ba0a716e
Improved: Use a predicate in ‘UtilHttp#getPathInfoOnlyParameterMap’
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863400 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:27:23 +00:00
Mathieu Lirzin
54d873a387
Improved: Refactor ‘UtilHttp#getParameterMap’
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863398 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:25:35 +00:00
Mathieu Lirzin
1d3d3bee78
Implemented: Add unit tests for ‘UtilHttp#getParameterMap’
...
(OFBIZ-11138)
Adapt slightly the implementation to make mocking easier.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863397 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:23:51 +00:00
Mathieu Lirzin
e576b5e549
Improved: Remove unused ‘UtilHttp#getParameterMap’ overload
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863396 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:22:34 +00:00
Mathieu Lirzin
caf4fe947d
Improved: Refactor ‘UtilHttp#getPathInfoOnlyParameterMap’
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863395 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:20:45 +00:00
Mathieu Lirzin
b1f0137d19
Implemented: Add unit tests for ‘UtilHttp#getPathInfoOnlyParameterMap’
...
(OFBIZ-11138)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863394 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:18:40 +00:00
Mathieu Lirzin
d972375949
Improved: Inline one ‘UtilHttp#getPathInfoOnlyParameterMap’ overload
...
(OFBIZ-11138)
‘getPathInfoOnlyParameterMap(HttpServletRequest, Set, Boolean)’ was
used only once and was not adding much to
‘getPathInfoOnlyParameterMap(String, Set, Boolean)’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863393 13f79535-47bb-0310-9956-ffa450edef68
2019-07-19 14:16:27 +00:00
Mathieu Lirzin
aa67827feb
Improved: Move ‘AdminServer’ inside a container
...
(OFBIZ-11136)
‘AdminServer’ provides a portable way to manage life-cycle of the OFBiz
process remotely by allowing administrator to check its running status
or shutting it down.
Previously the ‘AdminServer’ class was a special thread opening a
socket and launched at startup. However since this class is about
managing some run-time resources with a life-cycle, it matches perfectly
the container abstraction.
A benefit of making ‘AdminServer’ a container is that the startup
process is now simpler and more uniform.
Administrators can now prevent remote shutdown of OFBiz for security
reasons by removing the container declaration. Additionally They can
delegate the process management job to the init process (PID 0) of the
hosting system like Systemd [1] by replacing this container with
another one.
[1] https://www.freedesktop.org/software/systemd/man/systemd-notify.html
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863024 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 22:27:04 +00:00
Mathieu Lirzin
978ad322c6
Improved: Pass directly the loaders to ‘loadContainersFromConfigurations’
...
(OFBIZ-11100)
Since only the loaders are used from the configuration, it is better
to pass those directly as a parameter to the
‘loadContainersFromConfigurations’ method instead of the full
configuration object.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863023 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:42:19 +00:00
Mathieu Lirzin
5a7b0e6947
Improved: Access configurations inside ‘loadContainersFromConfigurations’
...
(OFBIZ-11100)
This avoids passing an extra argument to
‘loadContainersFromConfigurations’.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863022 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:40:57 +00:00
Mathieu Lirzin
a4fe69626b
Improved: Inline ‘filterContainersHavingMatchingLoaders’
...
(OFBIZ-11100)
The filtering of matching loaders is now done directly inside the
‘loadContainersFromConfigurations’ method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863021 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:40:02 +00:00
Mathieu Lirzin
16ee111ec3
Improved: Deprecate ‘ContainerConfig#getConfiguration(String, String)’
...
(OFBIZ-11100)
Since there is no global container configuration file anymore this
method should not be used. It has been superseded by an overload
which do not require to pass the file name of the configuration file.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863020 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:38:51 +00:00
Mathieu Lirzin
72aba3778c
Improved: Remove support for “ofbiz-containers.xml”
...
(OFBIZ-11100)
To extend the containers loaded on startup, it was possible too both
edit the “ofbiz-containers.xml” file or alternatively to define a
container in a component.
This redundancy adds extra complexity in the startup process for no
good extensibility reason. The component container loader is more
flexible since it allows developper to add new containers without
touching the framework so it is better to only rely on this option.
The component loader is now hard-coded directly in code.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1863019 13f79535-47bb-0310-9956-ffa450edef68
2019-07-13 21:37:40 +00:00
Mathieu Lirzin
c5ea5d85d3
Improved: Use try with resources in ‘readXmlDocument’
...
(OFBIZ-8202)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862320 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:08:20 +00:00
Mathieu Lirzin
21135cb104
Improved: Use ‘ServletRequest#getServletContext’ when possible
...
(OFBIZ-11129)
Avoid unecessary casts by using ‘ServletRequest#getServletContext’
instead of ‘ServletRequest#getAttribute’. This method is available
since Servlet specification 3.0.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862294 13f79535-47bb-0310-9956-ffa450edef68
2019-06-28 23:04:03 +00:00
Mathieu Lirzin
8c3c6cd438
Improved: Inline ‘StringUtil#toMap’
...
(OFBIZ-11014)
‘StringUtil#toMap’ was only used in the ‘CollectionConverters.StringToMap’
converter so in order to clean ‘StringUtil’ it seems better to inline it. The
corresponding tests has been adapted to check
‘CollectionConverters.StringToMap#convert’ behavior instead.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862228 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:40:25 +00:00
Mathieu Lirzin
ae9041285c
Improved: Add ‘ComponentConfig#components’ static method
...
(OFBIZ-11101)
This factorizes the construction of a stream for the collection of
components.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862226 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:34:10 +00:00
Mathieu Lirzin
0deec7b2a4
Improved: Add ‘ComponentConfig#matchingComponentName’ static method
...
(OFBIZ-11101)
This factorizes the construction of a predicate filtering components by
their names.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862225 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:33:11 +00:00
Mathieu Lirzin
84468dd604
Improved: Rewrite ‘ComponentConfig#getAllEntityResourceInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862224 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:32:15 +00:00
Mathieu Lirzin
c28820ebb8
Improved: Rewrite ‘ComponentConfig#getKeystoreInfo’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862223 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:31:14 +00:00
Mathieu Lirzin
99a0d56144
Improved: Inline ‘ComponentConfig#isFileResourceLoader’
...
(OFBIZ-11101)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862222 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:30:25 +00:00
Mathieu Lirzin
6e0432014f
Improved: Rewrite ‘ComponentConfig#getAllWebappResourceInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862220 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:26:12 +00:00
Mathieu Lirzin
ba54e32071
Improved: Rewrite ‘ComponentConfig#getAllTestSuiteInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862219 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:25:11 +00:00
Mathieu Lirzin
554cad0289
Improved: Rewrite ‘ComponentConfig#getAllServiceResourceInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862218 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:24:01 +00:00
Mathieu Lirzin
58ed9c5ce8
Improved: Rewrite ‘ComponentConfig#getAllKeystoreInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862217 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:23:18 +00:00
Mathieu Lirzin
2305408526
Improved: Rewrite ‘ComponentConfig#getAllConfigurations’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862216 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:22:03 +00:00
Mathieu Lirzin
ecadb1aac1
Improved: Rewrite ‘ComponentConfig#getAllClasspathInfos’
...
(OFBIZ-11101)
It now has a stream based implementation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862215 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:19:56 +00:00
Mathieu Lirzin
ddbc034d36
Improved: Extract ‘intersects’ predicate in a method
...
(OFBIZ-11099)
The lambda expression was a bit too long, so it is preferable to
extract it in a dedicated method.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860956 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 15:24:14 +00:00
Mathieu Lirzin
266e0d0a87
Improved: Use the ‘Deque’ interface in ‘ContainerLoader’
...
(OFBIZ-11099)
With a deque it is possible to iterate from the end of a list with
‘Deque#descendingIterator’ which is useful when unloading containers.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860954 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 15:22:10 +00:00
Mathieu Lirzin
ffe2e7ffdf
Improved: Add missing ‘static’ modifier for private methods
...
(OFBIZ-11098)
In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860937 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 12:27:40 +00:00
Deepak Dixit
ee60f84b65
Improved: Added Debug error statement for freemarker OFBIZ_DEFAULT_HANDLER, it will be helpful while debugging.
...
(OFBIZ-10817)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860696 13f79535-47bb-0310-9956-ffa450edef68
2019-06-06 05:42:30 +00:00
Jacques Le Roux
6447258bf3
Improved: no functional change
...
Adds missing ASL2 licenses
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860259 13f79535-47bb-0310-9956-ffa450edef68
2019-05-28 12:52:17 +00:00
Mathieu Lirzin
5ac6be8f19
Improved: Turn ‘TestJSONConverters’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860024 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:58:15 +00:00
Mathieu Lirzin
44188945a7
Improved: Turn ‘TestBooleanConverters’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860023 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:54:01 +00:00
Mathieu Lirzin
fb8705dbf0
Improved: Turn ‘BaseUnitTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860022 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:29:31 +00:00
Mathieu Lirzin
c43b99c812
Improved: Turn ‘AssertTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860021 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:28:23 +00:00
Mathieu Lirzin
c465e734ae
Improved: Turn ‘UtilMiscTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860020 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:27:30 +00:00
Mathieu Lirzin
e59a460525
Improved: Turn ‘UtilIOTests’ into a unit test class
...
(OFBIZ-11067)
Previously this test was disabled, however since it now seems to work
now we enable it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860019 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:24:02 +00:00
Mathieu Lirzin
2d5e81cc50
Improved: Remove empty ‘UtilHttpTests’ class
...
(OFBIZ-11067)
This test class was empty so no need to convert it in a unit test
class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860018 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:21:05 +00:00
Mathieu Lirzin
1d2d4ac50a
Improved: Turn ‘UtilCacheTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860017 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:19:54 +00:00
Mathieu Lirzin
409323020e
Improved: Turn ‘TimeDurationTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860016 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:15:04 +00:00
Mathieu Lirzin
aa874841ce
Improved: Turn ‘ReferenceCleanerTests’ into a unit test class
...
(OFBIZ-11067)
Keep it disabled since it is failing for obscure reasons.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860015 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 21:13:46 +00:00
Mathieu Lirzin
94c60ee977
Fixed: Remove entry for ‘StringUtilTests’ in “basetests.xml”
...
(OFBIZ-11014)
This XML element should have been removed in r1859937 when turning
this integration test class into a unit test class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860006 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 17:49:57 +00:00
Mathieu Lirzin
9587898bbe
Improved: Turn ‘ObjectTypeTests’ into a unit test class
...
(OFBIZ-11067)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859984 13f79535-47bb-0310-9956-ffa450edef68
2019-05-25 14:28:15 +00:00