Author: mor
Date: Thu Feb 4 13:32:44 2010
New Revision: 906481
URL: http://svn.apache.org/viewvc?rev=906481&view=rev
Log:
Added few more test case for service used on one page checkout.
Added:
ofbiz/trunk/applications/party/testdef/data/
ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
(with props)
Modified:
ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyContactMechTests.xml
ofbiz/trunk/applications/party/testdef/PartyContactMechTests.xml
Modified:
ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyContactMechTests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyContactMechTests.xml?rev=906481&r1=906480&r2=906481&view=diff
==============================================================================
---
ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyContactMechTests.xml
(original)
+++
ofbiz/trunk/applications/party/script/org/ofbiz/party/test/PartyContactMechTests.xml
Thu Feb 4 13:32:44 2010
@@ -282,4 +282,163 @@
</assert>
<check-errors/>
</simple-method>
+
+ <simple-method method-name="testCreateUpdatePartyTelecomNumberWithCreate"
short-description="Test the service for create telecom number"
login-required="false">
+ <set field="serviceCtx.partyId" value="DemoCustomer"/>
+ <set field="serviceCtx.contactMechPurposeTypeId" value="PHONE_WORK"/>
+ <set field="serviceCtx.areaCode" value="801"/>
+ <set field="serviceCtx.contactNumber" value="888-8888"/>
+ <set field="serviceCtx.extension" value="444"/>
+ <entity-one entity-name="UserLogin" value-field="userLogin">
+ <field-map field-name="userLoginId" value="DemoCustomer"/>
+ </entity-one>
+ <set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <call-service service-name="createUpdatePartyTelecomNumber"
in-map-name="serviceCtx">
+ <result-to-field result-name="contactMechId"/>
+ </call-service>
+ <entity-one entity-name="ContactMech" value-field="contactMech"/>
+ <entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
+ <entity-and entity-name="PartyContactMech" list="pcmList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmList" entry="pcm"/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmpList" entry="pcmp"/>
+ <assert>
+ <not><if-empty field="contactMech"/></not>
+ <not><if-empty field="telecomNumber"/></not>
+ <if-compare field="telecomNumber.areaCode" operator="equals"
value="801"/>
+ <if-compare field="telecomNumber.contactNumber" operator="equals"
value="888-8888"/>
+ <if-compare field="pcm.extension" operator="equals" value="444"/>
+ <not><if-empty field="pcm"/></not>
+ <not><if-empty field="pcmp"/></not>
+ </assert>
+ <check-errors/>
+ </simple-method>
+
+ <simple-method method-name="testCreateUpdatePartyTelecomNumberWithUpdate"
short-description="Test the service for update telecom number"
login-required="false">
+ <set field="serviceCtx.partyId" value="DemoCustomer"/>
+ <set field="serviceCtx.contactMechId" value="9125"/>
+ <set field="serviceCtx.contactMechPurposeTypeId" value="PHONE_HOME"/>
+ <set field="serviceCtx.areaCode" value="802"/>
+ <set field="serviceCtx.contactNumber" value="555-5555"/>
+ <entity-one entity-name="UserLogin" value-field="userLogin">
+ <field-map field-name="userLoginId" value="DemoCustomer"/>
+ </entity-one>
+ <set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <call-service service-name="createUpdatePartyTelecomNumber"
in-map-name="serviceCtx">
+ <result-to-field result-name="contactMechId"/>
+ </call-service>
+ <assert>
+ <if-compare field="contactMechId" operator="not-equals"
value="9125"/>
+ </assert>
+ <check-errors/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpListOld">
+ <field-map field-name="contactMechId" value="9125"/>
+ </entity-and>
+ <first-from-list list="pcmpListOld" entry="pcmpOld"/>
+ <assert>
+ <not><if-empty field="pcmpOld.thruDate"/></not>
+ </assert>
+ <check-errors/>
+ <entity-one entity-name="ContactMech" value-field="contactMech"/>
+ <entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
+ <entity-and entity-name="PartyContactMech" list="pcmList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmList" entry="pcm"/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmpList" entry="pcmp"/>
+ <assert>
+ <not><if-empty field="contactMech"/></not>
+ <not><if-empty field="telecomNumber"/></not>
+ <if-compare field="telecomNumber.areaCode" operator="equals"
value="802"/>
+ <if-compare field="telecomNumber.contactNumber" operator="equals"
value="555-5555"/>
+ <not><if-empty field="pcm"/></not>
+ <not><if-empty field="pcmp"/></not>
+ </assert>
+ <check-errors/>
+ </simple-method>
+
+ <simple-method method-name="testCreateUpdatePartyEmailAddressWithCreate"
short-description="Test the service for create email address"
login-required="false">
+ <set field="serviceCtx.partyId" value="DemoCustomer"/>
+ <set field="serviceCtx.contactMechPurposeTypeId"
value="PRIMARY_EMAIL"/>
+ <set field="serviceCtx.emailAddress" value="[email protected]"/>
+ <entity-one entity-name="UserLogin" value-field="userLogin">
+ <field-map field-name="userLoginId" value="DemoCustomer"/>
+ </entity-one>
+ <set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <call-service service-name="createUpdatePartyEmailAddress"
in-map-name="serviceCtx">
+ <result-to-field result-name="contactMechId"/>
+ <result-to-field result-name="emailAddress"/>
+ </call-service>
+ <assert>
+ <if-compare field="emailAddress" operator="equals"
value="[email protected]"/>
+ </assert>
+ <check-errors/>
+ <entity-one entity-name="ContactMech" value-field="contactMech"/>
+ <entity-and entity-name="PartyContactMech" list="pcmList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmList" entry="pcm"/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmpList" entry="pcmp"/>
+ <assert>
+ <not><if-empty field="contactMech"/></not>
+ <if-compare field="contactMech.infoString" operator="equals"
value="[email protected]"/>
+ <not><if-empty field="pcm"/></not>
+ <not><if-empty field="pcmp"/></not>
+ </assert>
+ <check-errors/>
+ </simple-method>
+
+ <simple-method method-name="testCreateUpdatePartyEmailAddressWithUpdate"
short-description="Test the service for update email address"
login-required="false">
+ <set field="serviceCtx.partyId" value="DemoCustomer"/>
+ <set field="serviceCtx.contactMechId" value="9126"/>
+ <set field="serviceCtx.contactMechPurposeTypeId"
value="PRIMARY_EMAIL"/>
+ <set field="serviceCtx.emailAddress" value="[email protected]"/>
+ <entity-one entity-name="UserLogin" value-field="userLogin">
+ <field-map field-name="userLoginId" value="DemoCustomer"/>
+ </entity-one>
+ <set field="serviceCtx.userLogin" from-field="userLogin"/>
+ <call-service service-name="createUpdatePartyEmailAddress"
in-map-name="serviceCtx">
+ <result-to-field result-name="contactMechId"/>
+ <result-to-field result-name="emailAddress"/>
+ </call-service>
+ <assert>
+ <if-compare field="contactMechId" operator="not-equals"
value="9126"/>
+ <if-compare field="emailAddress" operator="equals"
value="[email protected]"/>
+ </assert>
+ <check-errors/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpListOld">
+ <field-map field-name="contactMechId" value="9126"/>
+ </entity-and>
+ <first-from-list list="pcmpListOld" entry="pcmpOld"/>
+ <assert>
+ <not><if-empty field="pcmpOld.thruDate"/></not>
+ </assert>
+ <check-errors/>
+ <entity-one entity-name="ContactMech" value-field="contactMech"/>
+ <entity-and entity-name="PartyContactMech" list="pcmList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmList" entry="pcm"/>
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpList"
filter-by-date="true">
+ <field-map field-name="contactMechId"/>
+ </entity-and>
+ <first-from-list list="pcmpList" entry="pcmp"/>
+ <assert>
+ <not><if-empty field="contactMech"/></not>
+ <if-compare field="contactMech.infoString" operator="equals"
value="[email protected]"/>
+ <not><if-empty field="pcm"/></not>
+ <not><if-empty field="pcmp"/></not>
+ </assert>
+ <check-errors/>
+ </simple-method>
</simple-methods>
\ No newline at end of file
Modified: ofbiz/trunk/applications/party/testdef/PartyContactMechTests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/testdef/PartyContactMechTests.xml?rev=906481&r1=906480&r2=906481&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/testdef/PartyContactMechTests.xml (original)
+++ ofbiz/trunk/applications/party/testdef/PartyContactMechTests.xml Thu Feb 4
13:32:44 2010
@@ -21,6 +21,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
+ <test-case case-name="loadPartyContactMechData">
+ <entity-xml action="load"
entity-xml-url="component://party/testdef/data/PartyContactMechTestData.xml"/>
+ </test-case>
+
<test-case case-name="partyContactMech-tests">
<simple-method-test
location="component://party/script/org/ofbiz/party/test/PartyContactMechTests.xml"/>
</test-case>
Added: ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml?rev=906481&view=auto
==============================================================================
--- ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
(added)
+++ ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
Thu Feb 4 13:32:44 2010
@@ -0,0 +1,30 @@
+<?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.
+-->
+
+<entity-engine-xml>
+ <ContactMech contactMechId="9125" contactMechTypeId="TELECOM_NUMBER"/>
+ <TelecomNumber contactMechId="9125" countryCode="1" areaCode="801"
contactNumber="555-5555"/>
+ <PartyContactMech partyId="DemoCustomer" contactMechId="9125"
fromDate="2001-05-13 00:00:00.000" allowSolicitation="Y"/>
+ <PartyContactMechPurpose partyId="DemoCustomer" contactMechId="9125"
contactMechPurposeTypeId="PHONE_HOME" fromDate="2001-05-13 00:00:00.000"/>
+
+ <ContactMech contactMechId="9126" contactMechTypeId="EMAIL_ADDRESS"
infoString="[email protected]"/>
+ <PartyContactMech partyId="DemoCustomer" contactMechId="9126"
fromDate="2001-05-13 00:00:00.000" allowSolicitation="Y"/>
+ <PartyContactMechPurpose partyId="DemoCustomer" contactMechId="9126"
contactMechPurposeTypeId="PRIMARY_EMAIL" fromDate="2001-05-13 00:00:00.000"/>
+</entity-engine-xml>
\ No newline at end of file
Propchange:
ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
------------------------------------------------------------------------------
svn:keywords = "Date Rev Author URL Id"
Propchange:
ofbiz/trunk/applications/party/testdef/data/PartyContactMechTestData.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml