Author: ashish
Date: Tue Jul 7 16:02:01 2009
New Revision: 791888
URL: http://svn.apache.org/viewvc?rev=791888&view=rev
Log:
Applied patch from jira issue OFBIZ-2708 - Junit tests for the AR Batch Payments
Thanks Awdesh, Rishi & Sumit for your contribution.
I appreciate your efforts in this area. :-)
Added:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
(with props)
ofbiz/trunk/applications/accounting/testdef/paymenttests.xml (with props)
Modified:
ofbiz/trunk/applications/accounting/ofbiz-component.xml
Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/ofbiz-component.xml?rev=791888&r1=791887&r2=791888&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/accounting/ofbiz-component.xml Tue Jul 7 16:02:01
2009
@@ -79,6 +79,7 @@
<service-resource type="eca" loader="main"
location="servicedef/secas_olap.xml"/>
<test-suite loader="main" location="testdef/accountingtests.xml"/>
+ <test-suite loader="main" location="testdef/paymenttests.xml"/>
<webapp name="accounting"
title="Accounting"
Added:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml?rev=791888&view=auto
==============================================================================
---
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
(added)
+++
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
Tue Jul 7 16:02:01 2009
@@ -0,0 +1,57 @@
+<?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"
+
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+ <simple-method method-name="testCreateBatchForPayments"
short-description="auto test batching process" login-required="false">
+ <set field="paymentIds[]" value="demo10001"/>
+ <set field="paymentIds[]" value="demo10010"/>
+ <set field="paymentGroupName" value="Payment Batch"/>
+ <entity-one entity-name="UserLogin" value-field="userLogin">
+ <field-map field-name="userLoginId" value="system"/>
+ </entity-one>
+ <set field="serviceInMap.paymentIds" from-field="paymentIds"/>
+ <set field="serviceInMap.paymentGroupName"
from-field="paymentGroupName"/>
+ <set field="serviceInMap.userLogin" from-field="userLogin"/>
+ <call-service service-name="createPaymentBatch"
in-map-name="serviceInMap">
+ <result-to-field result-name="paymentGroupId"/>
+ </call-service>
+ <entity-one entity-name="PaymentGroup" value-field="paymentGroup"/>
+ <entity-and entity-name="PaymentGroupMember"
list="paymentGroupMemberList">
+ <field-map field-name="paymentGroupId"/>
+ </entity-and>
+ <assert>
+ <not><if-empty field="paymentGroupMemberList"/></not>
+ <if-compare-field field="paymentGroupName" operator="equals"
to-field="paymentGroup.paymentGroupName"/>
+ </assert>
+ <check-errors/>
+ <iterate list="paymentGroupMemberList" entry="paymentGroupMember">
+ <assert>
+ <or>
+ <if-compare-field field="paymentGroupMember.paymentId"
operator="equals" to-field="paymentIds[0]"/>
+ <if-compare-field field="paymentGroupMember.paymentId"
operator="equals" to-field="paymentIds[1]"/>
+ </or>
+ </assert>
+ <check-errors/>
+ </iterate>
+ <log level="info" message="Batch ${paymentGroupId} is created
successfully for payments"/>
+ </simple-method>
+</simple-methods>
\ No newline at end of file
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/testdef/paymenttests.xml?rev=791888&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/testdef/paymenttests.xml (added)
+++ ofbiz/trunk/applications/accounting/testdef/paymenttests.xml Tue Jul 7
16:02:01 2009
@@ -0,0 +1,28 @@
+<!--
+ 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.
+ -->
+
+<test-suite suite-name="accountingtests"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
+
+ <!-- Test case for Batching Payments process-->
+ <test-case case-name="auto-create-batch-for-payments">
+ <simple-method-test
location="component://accounting/script/org/ofbiz/accounting/test/AutoPaymentTests.xml"
name="testCreateBatchForPayments"/>
+ </test-case>
+</test-suite>
\ No newline at end of file
Propchange: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml
------------------------------------------------------------------------------
svn:keywords = Date Rev Author URL Id
Propchange: ofbiz/trunk/applications/accounting/testdef/paymenttests.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml