svn commit: r1768181 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgFixedAssetTests.xml minilang/test/AutoAcctgInvoiceTests.xml testdef/accountingtests.xml testdef/data/AccountingTestsData.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1768181 - in /ofbiz/trunk/applications/accounting: minilang/test/AutoAcctgFixedAssetTests.xml minilang/test/AutoAcctgInvoiceTests.xml testdef/accountingtests.xml testdef/data/AccountingTestsData.xml

Deepak Dixit-5
Author: deepak
Date: Sat Nov  5 10:19:55 2016
New Revision: 1768181

URL: http://svn.apache.org/viewvc?rev=1768181&view=rev
Log:
Improved: Added test cases for following accounting related servicse.
- cancelFixedAssetStdCost
- createFixedAssetMaint
- createFixedAssetMeter
- createInvoice
-  copyInvoice
- getInvoice
- setInvoiceStatus
-  copyInvoiceToTemplate
(OFBIZ-8840)(OFBIZ-8841)(OFBIZ-8844)(OFBIZ-8877)(OFBIZ-8878)(OFBIZ-8879)(OFBIZ-8880)(OFBIZ-8882)

Thanks Deepak Nigam for your contribution

Added:
    ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml   (with props)
    ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
    ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml

Added: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml?rev=1768181&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml (added)
+++ ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml Sat Nov  5 10:19:55 2016
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
+    <simple-method method-name="testCancelFixedAssetStdCost" short-description="Test case for service cancelFixedAssetStdCost" login-required="false">
+        <set field="serviceCtx.fixedAssetId" value="1000"/>
+        <set field="serviceCtx.fixedAssetStdCostTypeId" value="SETUP_COST"/>
+        <set field="serviceCtx.fromDate" value="2016-11-03 00:00:00" type="Timestamp"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="cancelFixedAssetStdCost" in-map-name="serviceCtx"/>
+        <entity-one entity-name="FixedAssetStdCost" value-field="fixedAssetStdCost" >
+            <field-map field-name="fixedAssetId" value="1000"/>
+            <field-map field-name="fixedAssetStdCostTypeId" value="SETUP_COST"/>
+            <field-map field-name="fromDate" value="2016-11-03 00:00:00" type="Timestamp"/>
+        </entity-one>
+        <now-timestamp field="nowTimestamp"/>
+        <assert>
+            <not><if-empty field="fixedAssetStdCost"/></not>
+            <if-compare-field field="fixedAssetStdCost.thruDate" operator="less-equals" to-field="nowTimestamp"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateFixedAssetMaint" short-description="Test case for service createFixedAssetMaint" login-required="false">
+        <set field="serviceCtx.fixedAssetId" value="1000"/>
+        <set field="serviceCtx.statusId" value="FAM_CREATED"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createFixedAssetMaint" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <entity-and list="fixedAssetMaintList" entity-name="FixedAssetMaint">
+            <field-map field-name="fixedAssetId" value="1000"/>
+        </entity-and>
+        <first-from-list entry="fixedAssetMaint" list="fixedAssetMaintList"/>
+        <assert>
+            <not><if-empty field="fixedAssetMaint"/></not>
+            <not><if-empty field="serviceResult.maintHistSeqId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCreateFixedAssetMeter" short-description="Test case for service createFixedAssetMeter" login-required="false">
+        <now-timestamp field="nowTimestamp"/>
+        <set field="serviceCtx.fixedAssetId" value="1000"/>
+        <set field="serviceCtx.productMeterTypeId" value="DISTANCE"/>
+        <set field="serviceCtx.readingDate" from-field="nowTimestamp"/>
+        <set field="serviceCtx.meterValue" value="10" type="BigDecimal"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createFixedAssetMeter" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <entity-and list="fixedAssetMeterList" entity-name="FixedAssetMeter">
+            <field-map field-name="fixedAssetId" value="1000"/>
+            <field-map field-name="productMeterTypeId" value="DISTANCE"/>
+        </entity-and>
+        <first-from-list entry="fixedAssetMeter" list="fixedAssetMeterList"/>
+        <assert>
+            <not><if-empty field="fixedAssetMeter"/></not>
+            <if-compare operator="equals" value="10" field="fixedAssetMeter.meterValue"></if-compare>
+        </assert>
+        <check-errors/>
+    </simple-method>
+
+</simple-methods>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgFixedAssetTests.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml?rev=1768181&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml (added)
+++ ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml Sat Nov  5 10:19:55 2016
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
+    <simple-method method-name="testCopyInvoice" short-description="Test case for service copyInvoice" login-required="false">
+        <set field="serviceCtx.invoiceIdToCopyFrom" value="1000"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="copyInvoice" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <not><if-empty field="serviceResult.invoiceId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+
+    <simple-method method-name="testCreateInvoice" short-description="Test case for service createInvoice" login-required="false">
+        <now-timestamp field="nowTimestamp"/>
+        <set field="serviceCtx.invoiceTypeId" value="PURCHASE_INVOICE"/>
+        <set field="serviceCtx.partyIdFrom" value="DEMO_COMPANY"/>
+        <set field="serviceCtx.partyId" value="DEMO_COMPANY1"/>
+        <set field="serviceCtx.invoiceDate"  from-field="nowTimestamp" />
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="createInvoice" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <not><if-empty field="serviceResult.invoiceId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testGetInvoice" short-description="Test case for service getInvoice" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1001"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="getInvoice" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult.invoice"/></not>
+            <not><if-empty field="serviceResult.invoiceItems"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testSetInvoiceStatus" short-description="Test case for service setInvoiceStatus" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1002"/>
+        <set field="serviceCtx.statusId" value="INVOICE_APPROVED"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="setInvoiceStatus" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <entity-one  entity-name="Invoice" value-field="invoice">
+            <field-map field-name="invoiceId" value="1002"/>
+        </entity-one>
+        <assert>
+            <not><if-empty field="invoice"/></not>
+            <if-compare operator="equals" value="INVOICE_APPROVED" field="invoice.statusId"></if-compare>
+        </assert>
+        <check-errors/>
+    </simple-method>
+    <simple-method method-name="testCopyInvoiceToTemplate" short-description="Test case for service copyInvoiceToTemplate" login-required="false">
+        <set field="serviceCtx.invoiceId" value="1002"/>
+        <set field="serviceCtx.invoiceTypeId" value="PURCHASE_INVOICE"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <call-service service-name="copyInvoiceToTemplate" in-map-name="serviceCtx">
+            <results-to-map map-name="serviceResult"/>
+        </call-service>
+        <assert>
+            <not><if-empty field="serviceResult"/></not>
+            <not><if-empty field="serviceResult.invoiceId"/></not>
+        </assert>
+        <check-errors/>
+    </simple-method>
+</simple-methods>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgInvoiceTests.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/accounting/testdef/accountingtests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/accountingtests.xml?rev=1768181&r1=1768180&r2=1768181&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/accountingtests.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/accountingtests.xml Sat Nov  5 10:19:55 2016
@@ -52,4 +52,10 @@
     <test-case case-name="auto-accounting-finaccount-tests">
         <simple-method-test location="component://accounting/minilang/test/AutoAcctgFinAccountTests.xml"/>
     </test-case>
+    <test-case case-name="auto-accounting-fixedasset-tests">
+        <simple-method-test location="component://accounting/minilang/test/AutoAcctgFixedAssetTests.xml"/>
+    </test-case>
+    <test-case case-name="auto-accounting-invoice-tests">
+        <simple-method-test location="component://accounting/minilang/test/AutoAcctgInvoiceTests.xml"/>
+    </test-case>
 </test-suite>

Modified: ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml?rev=1768181&r1=1768180&r2=1768181&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (original)
+++ ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Sat Nov  5 10:19:55 2016
@@ -80,4 +80,15 @@ under the License.
     <!-- For Testing service setFinAccountTransStatus -->
     <FinAccount finAccountId="1005" finAccountTypeId="DEPOSIT_ACCOUNT" finAccountName="Deposit Account" finAccountCode="1001" currencyUomId="USD" organizationPartyId="DEMO_COMPANY" fromDate="2016-11-03 00:00:00" actualBalance="2000.00" availableBalance="1500.00"/>
     <FinAccountTransType finAccountTransId="1010" finAccountTransTypeId="ADJUSTMENT" finAccountId="1005" statusId="FINACT_TRNS_CREATED" />
+    !-- For Testing service cancelFixedAssetStdCost -->
+    <FixedAsset fixedAssetId="1000" fixedAssetTypeId="REAL_ESTATE" partyId="DEMO_COMPANY" roleTypeId="INTERNAL_ORGANIZATIO"/>
+    <FixedAssetStdCost fixedAssetId="1000" fixedAssetStdCostTypeId="SETUP_COST" fromDate="2016-11-03 00:00:00" amountUomId="USD" amount="1000.00"/>
+    <!-- For Testing service copyInvoice -->
+    <Invoice invoiceId="1000" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <Invoice invoiceId="1001" invoiceTypeId="PURCHASE_INVOICE" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <InvoiceItem invoiceId="1001" invoiceItemSeqId="00001" invoiceItemTypeId="PINV_FXASTPRD_ITEM"/>
+    <Invoice invoiceId="1002" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+    <!-- For Testing service setInvoiceStatus -->
+    <Invoice invoiceId="1002" invoiceTypeId="PURCHASE_INVOICE" statusId="INVOICE_IN_PROCESS" partyIdFrom="DEMO_COMPANY" partyId="DEMO_COMPANY1" invoiceDate="2016-11-03 00:00:00"/>
+
 </entity-engine-xml>