This is an automated email from the ASF dual-hosted git repository.
jacopoc 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 e9f86fcda0 Fixed: Add setup and teardown methods to manage
testBigDecimal property in ObjectTypeTests
e9f86fcda0 is described below
commit e9f86fcda04753075896da48d31e2668f9cac99f
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Thu May 28 09:47:30 2026 +0200
Fixed: Add setup and teardown methods to manage testBigDecimal property in
ObjectTypeTests
The testBigDecimal property introduced in commit d6993ec should be
considered a temporary workaround and should be revisited in the future. Tests
are now passing.
---
.../java/org/apache/ofbiz/base/util/ObjectTypeTests.java | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git
a/framework/base/src/test/java/org/apache/ofbiz/base/util/ObjectTypeTests.java
b/framework/base/src/test/java/org/apache/ofbiz/base/util/ObjectTypeTests.java
index bc7c41703d..e4a08b6341 100644
---
a/framework/base/src/test/java/org/apache/ofbiz/base/util/ObjectTypeTests.java
+++
b/framework/base/src/test/java/org/apache/ofbiz/base/util/ObjectTypeTests.java
@@ -37,6 +37,8 @@ import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
+import org.junit.After;
+import org.junit.Before;
import org.junit.Test;
import org.w3c.dom.Document;
@@ -94,6 +96,16 @@ public class ObjectTypeTests {
}
}
+ @Before
+ public void setUp() {
+ System.setProperty("testBigDecimal", "bypassLocaleChange");
+ }
+
+ @After
+ public void tearDown() {
+ System.clearProperty("testBigDecimal");
+ }
+
public static Object simpleTypeOrObjectConvert(Object obj, String type,
String format, TimeZone timeZone,
Locale locale, boolean noTypeFail) throws GeneralException {
return ObjectType.simpleTypeOrObjectConvert(obj, type, format,
timeZone, locale, noTypeFail);
@@ -493,10 +505,8 @@ public class ObjectTypeTests {
@Test
public void testBigDecimal() throws GeneralException {
- System.setProperty("testBigDecimal", "bypassLocaleChange");
simpleTypeOrObjectConvertTestSingleMulti("BigDecimal->String", new
BigDecimal("12345.67"),
new String[] {"String", "java.lang.String"}, null,
LOCALE_DATA, "12,345.67");
- System.clearProperty("testBigDecimal");
simpleTypeOrObjectConvertTestSingleMulti("BigDecimal->BigDecimal",
dcml,
new String[] {"BigDecimal", "java.math.BigDecimal"}, new
BigDecimal("781.25"));
simpleTypeOrObjectConvertTestSingleMulti("BigDecimal->Double", dcml,