Author: deepak
Date: Tue Nov 1 20:19:17 2016
New Revision: 1767559
URL: http://svn.apache.org/viewvc?rev=1767559&view=rev
Log:
Improved: Added Unit test case for following services
- createGlAccountTypeDefault
- removeGlAccountTypeDefault
- addInvoiceItemTypeGlAssignment
- removeInvoiceItemTypeGlAssignment
- addPaymentTypeGlAssignment
(OFBIZ-8530)(OFBIZ-8532)(OFBIZ-8533)(OFBIZ-8534)(OFBIZ-8535)
Thanks Deepak Nigam for your contribution.
Modified:
ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgAdminTests.xml
ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
Modified:
ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgAdminTests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgAdminTests.xml?rev=1767559&r1=1767558&r2=1767559&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgAdminTests.xml
(original)
+++ ofbiz/trunk/applications/accounting/minilang/test/AutoAcctgAdminTests.xml
Tue Nov 1 20:19:17 2016
@@ -108,5 +108,96 @@ under the License.
</assert>
<check-errors/>
</simple-method>
-
+ <simple-method method-name="testCreateGlAccountTypeDefault"
short-description="Test case for service createGlAccountTypeDefault"
login-required="false">
+ <set field="serviceCtx.glAccountTypeId" value="BALANCE_ACCOUNT"/>
+ <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
+ <set field="serviceCtx.glAccountId" value="999999"/>
+ <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="createGlAccountTypeDefault"
in-map-name="serviceCtx"/>
+ <entity-one value-field="glAccountTypeDefault"
entity-name="GlAccountTypeDefault">
+ <field-map field-name="glAccountTypeId" value="BALANCE_ACCOUNT"/>
+ <field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
+ </entity-one>
+ <assert>
+ <not><if-empty field="glAccountTypeDefault"/></not>
+ <if-compare operator="equals" value="999999"
field="glAccountTypeDefault.glAccountId"></if-compare>
+ </assert>
+ <check-errors/>
+ </simple-method>
+ <simple-method method-name="testRemoveGlAccountTypeDefault"
short-description="Test case for service removeGlAccountTypeDefault"
login-required="false">
+ <set field="serviceCtx.glAccountTypeId" value="ACCOUNTS_PAYABLE"/>
+ <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
+ <set field="serviceCtx.glAccountId" value="999999"/>
+ <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="removeGlAccountTypeDefault"
in-map-name="serviceCtx"/>
+ <entity-one value-field="glAccountTypeDefault"
entity-name="GlAccountTypeDefault">
+ <field-map field-name="glAccountTypeId" value="ACCOUNTS_PAYABLE"/>
+ <field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
+ </entity-one>
+ <assert>
+ <if-empty field="glAccountTypeDefault"/>
+ </assert>
+ <check-errors/>
+ </simple-method>
+ <simple-method method-name="testAddInvoiceItemTypeGlAssignment"
short-description="Test case for service addInvoiceItemTypeGlAssignment"
login-required="false">
+ <set field="serviceCtx.invoiceItemTypeId" value="PINV_FPROD_ITEM"/>
+ <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
+ <set field="serviceCtx.glAccountId" value="999999"/>
+ <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="addInvoiceItemTypeGlAssignment"
in-map-name="serviceCtx"/>
+ <entity-one value-field="invoiceItemTypeGlAccount"
entity-name="InvoiceItemTypeGlAccount">
+ <field-map field-name="invoiceItemTypeId" value="PINV_FPROD_ITEM"/>
+ <field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
+ </entity-one>
+ <assert>
+ <not><if-empty field="invoiceItemTypeGlAccount"/></not>
+ <if-compare operator="equals" value="999999"
field="invoiceItemTypeGlAccount.glAccountId"></if-compare>
+ </assert>
+ <check-errors/>
+ </simple-method>
+ <simple-method method-name="testRemoveInvoiceItemTypeGlAssignment"
short-description="Test case for service removeInvoiceItemTypeGlAssignment"
login-required="false">
+ <set field="serviceCtx.invoiceItemTypeId" value="PINV_SALES_TAX"/>
+ <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
+ <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="removeInvoiceItemTypeGlAssignment"
in-map-name="serviceCtx"/>
+ <entity-one value-field="invoiceItemTypeGlAccount"
entity-name="InvoiceItemTypeGlAccount">
+ <field-map field-name="invoiceItemTypeId" value="PINV_SALES_TAX"/>
+ <field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
+ </entity-one>
+ <assert>
+ <if-empty field="invoiceItemTypeGlAccount"/>
+ </assert>
+ <check-errors/>
+ </simple-method>
+ <simple-method method-name="testAddPaymentTypeGlAssignment"
short-description="Test case for service addPaymentTypeGlAssignment"
login-required="false">
+ <set field="serviceCtx.paymentTypeId" value="TAX_PAYMENT"/>
+ <set field="serviceCtx.organizationPartyId" value="DEMO_COMPANY1"/>
+ <set field="serviceCtx.glAccountTypeId" value="TAX_ACCOUNT"/>
+ <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="addPaymentTypeGlAssignment"
in-map-name="serviceCtx"/>
+ <entity-one value-field="paymentGlAccountTypeMap"
entity-name="PaymentGlAccountTypeMap">
+ <field-map field-name="paymentTypeId" value="TAX_PAYMENT"/>
+ <field-map field-name="organizationPartyId" value="DEMO_COMPANY1"/>
+ </entity-one>
+ <assert>
+ <not><if-empty field="paymentGlAccountTypeMap"/></not>
+ <if-compare operator="equals" value="TAX_ACCOUNT"
field="paymentGlAccountTypeMap.glAccountTypeId"></if-compare>
+ </assert>
+ <check-errors/>
+ </simple-method>
</simple-methods>
\ No newline at end of file
Modified:
ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml?rev=1767559&r1=1767558&r2=1767559&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
(original)
+++ ofbiz/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
Tue Nov 1 20:19:17 2016
@@ -36,4 +36,11 @@ under the License.
<PartyAcctgPreference partyId="DEMO_COMPANY1"/>
<!-- For Testing service updateFXConversion-->
<UomConversionDated uomId="EUR" uomIdTo="USD" fromDate="2001-01-01
00:00:00.0" conversionFactor="1.5"/>
+ <!-- For Testing service createGlAccountTypeDefault /
addInvoiceItemTypeGlAssignment-->
+ <GlAccount glAccountId="999999"/>
+ <!-- For Testing service removeGlAccountTypeDefault-->
+ <GlAccountTypeDefault glAccountId="999999"
glAccountTypeId="ACCOUNTS_PAYABLE" organizationPartyId="DEMO_COMPANY1"/>
+ <!-- For Testing service removeInvoiceItemTypeGlAssignment-->
+ <InvoiceItemTypeGlAccount glAccountId="999999"
invoiceItemTypeId="PINV_SALES_TAX" organizationPartyId="DEMO_COMPANY1"/>
+
</entity-engine-xml>