blob: c13250c16e7ebf8eeee2440bbebc95b44730ea9c [file] [log] [blame]
<?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-v2.xsd">
<!-- Test case for create and update contact list -->
<simple-method method-name="testCreateAndUpdateContactList" short-description="Test case to check create and update contact list services" login-required="false">
<!-- Precondition:
Create contact list
1. Go to the Marketing Manager
2. Select the Contact List menu item
3. Click Create New Contact List
4. Enter fields in contact list form
Edit contact list
1. Go to edit contact list screen
2. Add / modify fields
3. Click on save
-->
<!-- process tested by test case:
1. This test the process for create and update contact list
-->
<!-- Post condition:
Contact list should be created and updated successfully
-->
<!-- create contact list -->
<set field="contactListTypeId" value="ANNOUNCEMENT"/>
<set field="contactListName" value="Announcement List" type="String"/>
<set field="contactMechTypeId" value="EMAIL_ADDRESS"/>
<entity-one entity-name="UserLogin" value-field="userLogin" auto-field-map="false">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="createServiceCtx.userLogin" from-field="userLogin"/>
<set field="createServiceCtx.contactListTypeId" from-field="contactListTypeId"/>
<set field="createServiceCtx.contactListName" from-field="contactListName"/>
<set field="createServiceCtx.contactMechTypeId" from-field="contactMechTypeId"/>
<call-service service-name="createContactList" in-map-name="createServiceCtx">
<result-to-field result-name="contactListId"/>
</call-service>
<log level="info" message="======== Created contactListId [${contactListId}] ======="/>
<entity-one entity-name="ContactList" value-field="contactList"/>
<assert>
<not><if-empty field="contactList"/></not>
<if-compare-field field="contactList.contactListTypeId" to-field="contactListTypeId" operator="equals"/>
<if-compare-field field="contactList.contactListName" to-field="contactListName" operator="equals"/>
<if-compare-field field="contactList.contactMechTypeId" to-field="contactMechTypeId" operator="equals"/>
</assert>
<check-errors/>
<!-- update contact list -->
<set field="contactListTypeId" value="ANNOUNCEMENT"/>
<set field="contactListName" value="Announcement Records" type="String"/>
<set field="contactMechTypeId" value="POSTAL_ADDRESS"/>
<!-- preparing new map for updateContactList service -->
<set field="updateServiceCtx.userLogin" from-field="userLogin"/>
<set field="updateServiceCtx.contactListTypeId" from-field="contactListTypeId"/>
<set field="updateServiceCtx.contactListName" from-field="contactListName"/>
<set field="updateServiceCtx.contactMechTypeId" from-field="contactMechTypeId"/>
<set field="updateServiceCtx.contactListId" from-field="contactListId"/>
<call-service service-name="updateContactList" in-map-name="updateServiceCtx"/>
<entity-one entity-name="ContactList" value-field="contactList"/>
<assert>
<not><if-empty field="contactList"/></not>
<if-compare-field field="contactList.contactListTypeId" to-field="contactListTypeId" operator="equals"/>
<if-compare-field field="contactList.contactListName" to-field="contactListName" operator="equals"/>
<if-compare-field field="contactList.contactMechTypeId" to-field="contactMechTypeId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>