Author: mor
Date: Fri May 30 01:52:12 2008 New Revision: 661596 URL: http://svn.apache.org/viewvc?rev=661596&view=rev Log: Applied patch for testing process of create/update contact list from Jira issue OFBIZ-1681(https://issues.apache.org/jira/browse/OFBIZ-1681)\ Done few improvements - put the precondition - post condition comment at one place etc. \ Thanks Awdesh Parihar, Ratnesh Upadhyay for this patch. Added: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/ ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml (with props) ofbiz/trunk/applications/marketing/testdef/ ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml (with props) Modified: ofbiz/trunk/applications/marketing/ofbiz-component.xml Modified: ofbiz/trunk/applications/marketing/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/ofbiz-component.xml?rev=661596&r1=661595&r2=661596&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/marketing/ofbiz-component.xml Fri May 30 01:52:12 2008 @@ -33,6 +33,10 @@ <entity-resource type="data" reader-name="demo" loader="main" location="data/sfaDemoData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> + + <!-- test suite --> + <test-suite loader="main" location="testdef/MarketingTests.xml"/> + <webapp name="marketing" title="Marketing" server="default-server" Added: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml?rev=661596&view=auto ============================================================================== --- ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml (added) +++ ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml Fri May 30 01:52:12 2008 @@ -0,0 +1,92 @@ +<?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="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-name="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-name="contactList"/> + <assert> + <not><if-empty field-name="contactList"/></not> + <if-compare-field field-name="contactList.contactListTypeId" operator="equals" to-field-name="contactListTypeId"/> + <if-compare-field field-name="contactList.contactListName" operator="equals" to-field-name="contactListName"/> + <if-compare-field field-name="contactList.contactMechTypeId" operator="equals" to-field-name="contactMechTypeId"/> + </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-name="contactList"/> + <assert> + <not><if-empty field-name="contactList"/></not> + <if-compare-field field-name="contactList.contactListTypeId" operator="equals" to-field-name="contactListTypeId"/> + <if-compare-field field-name="contactList.contactListName" operator="equals" to-field-name="contactListName"/> + <if-compare-field field-name="contactList.contactMechTypeId" operator="equals" to-field-name="contactMechTypeId"/> + </assert> + <check-errors/> + </simple-method> +</simple-methods> \ No newline at end of file Propchange: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/marketing/script/org/ofbiz/marketing/test/TestServices.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml?rev=661596&view=auto ============================================================================== --- ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml (added) +++ ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml Fri May 30 01:52:12 2008 @@ -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="marketingtests" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd"> + + <!-- Test case for create and update contact list --> + <test-case case-name="createAndUpdateContactList-test"> + <simple-method-test location="component://marketing/script/org/ofbiz/marketing/test/TestServices.xml" name="testCreateAndUpdateContactList"/> + </test-case> +</test-suite> \ No newline at end of file Propchange: ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/marketing/testdef/MarketingTests.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml |
Free forum by Nabble | Edit this page |