svn commit: r905584 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml

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

svn commit: r905584 - /ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml

mor-2
Author: mor
Date: Tue Feb  2 11:24:54 2010
New Revision: 905584

URL: http://svn.apache.org/viewvc?rev=905584&view=rev
Log:
A test case for service createPartyEmailAddress.

Modified:
    ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml?rev=905584&r1=905583&r2=905584&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyTests.xml Tue Feb  2 11:24:54 2010
@@ -537,4 +537,41 @@
         </assert>
         <check-errors/>
     </simple-method>
-</simple-methods>
+
+    <simple-method method-name="testCreatePartyEmailAddress" short-description="Test case for service createPartyEmailAddress" login-required="false">
+        <set field="partyId" value="DemoEmployee"/>
+        <set field="emailAddress" value="[hidden email]"/>
+        <set field="contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+        <set field="serviceCtx.userLogin" from-field="userLogin"/>
+        <set field="serviceCtx.partyId" from-field="partyId"/>
+        <set field="serviceCtx.emailAddress" from-field="emailAddress"/>
+        <set field="serviceCtx.contactMechPurposeTypeId" from-field="contactMechPurposeTypeId"/>
+        <call-service service-name="createPartyEmailAddress" in-map-name="serviceCtx">
+            <result-to-field result-name="contactMechId"/>
+        </call-service>
+        <entity-one entity-name="ContactMech" value-field="contactMech"/>
+        <entity-condition entity-name="PartyContactMech" list="pcmList" filter-by-date="true">
+            <condition-expr field-name="contactMechId" from-field="contactMechId"/>
+            <order-by field-name="fromDate"/>
+        </entity-condition>
+        <first-from-list list="pcmList" entry="pcm"/>
+        <entity-condition entity-name="PartyContactMechPurpose" list="pcmpList" filter-by-date="true">
+            <condition-expr field-name="contactMechId" from-field="contactMechId"/>
+            <order-by field-name="fromDate"/>
+        </entity-condition>
+        <first-from-list list="pcmpList" entry="pcmp"/>
+        <assert>
+            <not><if-empty field="contactMech"/></not>
+            <if-compare-field field="contactMech.infoString" operator="equals" to-field="emailAddress"/>
+            <not><if-empty field="pcmList"/></not>
+            <if-compare-field field="pcm.partyId" operator="equals" to-field="partyId"/>
+            <not><if-empty field="pcmpList"/></not>
+            <if-compare-field field="pcmp.partyId" operator="equals" to-field="partyId"/>
+            <if-compare-field field="pcmp.contactMechPurposeTypeId" operator="equals" to-field="contactMechPurposeTypeId"/>
+        </assert>
+        <check-errors/>
+    </simple-method>
+</simple-methods>
\ No newline at end of file