You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by su...@apache.org on 2019/03/09 05:07:52 UTC

svn commit: r1855077 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: groovyScripts/test/AutoAcctgLedgerTests.groovy testdef/accountingtests.xml

Author: surajk
Date: Sat Mar  9 05:07:52 2019
New Revision: 1855077

URL: http://svn.apache.org/viewvc?rev=1855077&view=rev
Log:
Added: Unit test case for service - createAcctgTrans.
(OFBIZ-1463)
Thanks Deepak Nigam for reporting and Yogesh Naroliya for providing the updated patch.

Added:
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy   (with props)
Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml

Added: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy?rev=1855077&view=auto
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy (added)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy Sat Mar  9 05:07:52 2019
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+
+
+import org.apache.ofbiz.base.util.UtilDateTime
+import org.apache.ofbiz.entity.GenericValue
+import org.apache.ofbiz.entity.util.EntityQuery
+import org.apache.ofbiz.service.ServiceUtil
+import org.apache.ofbiz.testtools.GroovyScriptTestCase
+
+class AutoAcctgLedgerTests extends GroovyScriptTestCase {
+    void testCreateAcctgTrans() {
+        Map serviceCtx = [:]
+        serviceCtx.acctgTransTypeId = 'CREDIT_MEMO'
+        serviceCtx.description = 'Test Credit Memo Transaction'
+        serviceCtx.transactionDate = UtilDateTime.nowTimestamp()
+        serviceCtx.glFiscalTypeId = 'BUDGET'
+        serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        Map serviceResult = dispatcher.runSync('createAcctgTrans', serviceCtx)
+        assert ServiceUtil.isSuccess(serviceResult)
+
+        GenericValue acctgTrans = EntityQuery.use(delegator).from('AcctgTrans').where('acctgTransId', serviceResult.acctgTransId).queryOne()
+        assert acctgTrans.acctgTransId == serviceResult.acctgTransId
+        assert acctgTrans.acctgTransTypeId == 'CREDIT_MEMO'
+    }
+}

Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml?rev=1855077&r1=1855076&r2=1855077&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml Sat Mar  9 05:07:52 2019
@@ -63,4 +63,7 @@
     <test-case case-name="auto-accounting-paymentgateway-tests">
         <groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy"/>
     </test-case>
+    <test-case case-name="auto-accounting-ledger-tests">
+        <groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgLedgerTests.groovy"/>
+    </test-case>
 </test-suite>