This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
The following commit(s) were added to refs/heads/trunk by this push: new 21860f719 Fixed: Integration tests fail with Postgres DB (OFBIZ-12666) 21860f719 is described below commit 21860f719206dd91c6869fac6dcfb03572a9216a Author: Jacques Le Roux <jacques.le.r...@les7arts.com> AuthorDate: Mon Jul 18 08:36:31 2022 +0200 Fixed: Integration tests fail with Postgres DB (OFBIZ-12666) This fixes testUpdateFixedAssetMaintAndWorkEffort. It works in both Derby and Postgres Thanks: Johannes Schreiber for report --- .../ofbiz/assetmaint/test/FixedAssetMaintTests.groovy | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/assetmaint/src/main/groovy/org/apache/ofbiz/assetmaint/test/FixedAssetMaintTests.groovy b/assetmaint/src/main/groovy/org/apache/ofbiz/assetmaint/test/FixedAssetMaintTests.groovy index c9af5b781..fcaae974d 100644 --- a/assetmaint/src/main/groovy/org/apache/ofbiz/assetmaint/test/FixedAssetMaintTests.groovy +++ b/assetmaint/src/main/groovy/org/apache/ofbiz/assetmaint/test/FixedAssetMaintTests.groovy @@ -20,6 +20,7 @@ package org.apache.ofbiz.assetmaint.test import java.sql.Timestamp import java.text.SimpleDateFormat + import org.apache.ofbiz.base.util.UtilDateTime import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.service.testtools.OFBizTestCase @@ -38,9 +39,9 @@ class FixedAssetMaintTests extends OFBizTestCase { serviceCtx.productMaintSeqId = "seq03" // product maintenance serviceCtx.intervalMeterTypeId = "ODOMETER" - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS") String estimatedStartDate = "2009-12-18 00:00:00.000" - serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime()); + serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime()) String estimatedCompletionDate = "2009-12-18 01:00:00.000" serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime()) @@ -71,9 +72,9 @@ class FixedAssetMaintTests extends OFBizTestCase { serviceCtx.productMaintTypeId = "OIL_CHANGE" serviceCtx.intervalMeterTypeId = "ODOMETER" - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS") String estimatedStartDate = "2009-12-18 00:00:00.000" - serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime()); + serviceCtx.estimatedStartDate = new Timestamp(sdf.parse(estimatedStartDate).getTime()) String estimatedCompletionDate = "2009-12-18 01:00:00.000" serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime()) @@ -107,7 +108,7 @@ class FixedAssetMaintTests extends OFBizTestCase { serviceCtx.productMaintTypeId = "OIL_CHANGE" serviceCtx.intervalMeterTypeId = "ODOMETER" - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS") String estimatedCompletionDate = "2009-12-22 01:00:00.000" // Changed estimatedCompletionDate to test update service serviceCtx.estimatedCompletionDate = new Timestamp(sdf.parse(estimatedCompletionDate).getTime()) @@ -117,8 +118,6 @@ class FixedAssetMaintTests extends OFBizTestCase { serviceCtx.userLogin = userLogin Map serviceResult = dispatcher.runSync('updateFixedAssetMaintAndWorkEffort', serviceCtx) - fixedAssetMaint.clear() - fixedAssetMaint = from("FixedAssetMaint").where("fixedAssetId", fixedAssetId).queryFirst() GenericValue workEffort = from("WorkEffort").where("workEffortId", fixedAssetMaint.scheduleWorkEffortId).queryOne() assert fixedAssetMaint @@ -145,4 +144,4 @@ class FixedAssetMaintTests extends OFBizTestCase { assert workEffort.currentStatusId == "CAL_COMPLETED" assert workEffort.actualCompletionDate == serviceCtx.actualCompletionDate } -} \ No newline at end of file +}