'field-map' git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1786988 13f79535-47bb-0310-9956-ffa450edef68
89 lines
4.8 KiB
XML
89 lines
4.8 KiB
XML
<?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"
|
|
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
|
|
<simple-method method-name="testCancelFixedAssetStdCost" short-description="Test case for service cancelFixedAssetStdCost" login-required="false">
|
|
<set field="serviceCtx.fixedAssetId" value="1000"/>
|
|
<set field="serviceCtx.fixedAssetStdCostTypeId" value="SETUP_COST"/>
|
|
<set field="serviceCtx.fromDate" value="2016-11-03 00:00:00" type="Timestamp"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="cancelFixedAssetStdCost" in-map-name="serviceCtx"/>
|
|
<entity-one entity-name="FixedAssetStdCost" value-field="fixedAssetStdCost" >
|
|
<field-map field-name="fixedAssetId" value="1000"/>
|
|
<field-map field-name="fixedAssetStdCostTypeId" value="SETUP_COST"/>
|
|
<field-map field-name="fromDate" value="2016-11-03 00:00:00"/>
|
|
</entity-one>
|
|
<now-timestamp field="nowTimestamp"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetStdCost"/></not>
|
|
<if-compare-field field="fixedAssetStdCost.thruDate" operator="less-equals" to-field="nowTimestamp"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
<simple-method method-name="testCreateFixedAssetMaint" short-description="Test case for service createFixedAssetMaint" login-required="false">
|
|
<set field="serviceCtx.fixedAssetId" value="1000"/>
|
|
<set field="serviceCtx.statusId" value="FAM_CREATED"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="createFixedAssetMaint" in-map-name="serviceCtx">
|
|
<results-to-map map-name="serviceResult"/>
|
|
</call-service>
|
|
<entity-and list="fixedAssetMaintList" entity-name="FixedAssetMaint">
|
|
<field-map field-name="fixedAssetId" value="1000"/>
|
|
</entity-and>
|
|
<first-from-list entry="fixedAssetMaint" list="fixedAssetMaintList"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMaint"/></not>
|
|
<not><if-empty field="serviceResult.maintHistSeqId"/></not>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
<simple-method method-name="testCreateFixedAssetMeter" short-description="Test case for service createFixedAssetMeter" login-required="false">
|
|
<now-timestamp field="nowTimestamp"/>
|
|
<set field="serviceCtx.fixedAssetId" value="1000"/>
|
|
<set field="serviceCtx.productMeterTypeId" value="DISTANCE"/>
|
|
<set field="serviceCtx.readingDate" from-field="nowTimestamp"/>
|
|
<set field="serviceCtx.meterValue" value="10" type="BigDecimal"/>
|
|
<entity-one entity-name="UserLogin" value-field="userLogin">
|
|
<field-map field-name="userLoginId" value="system"/>
|
|
</entity-one>
|
|
<set field="serviceCtx.userLogin" from-field="userLogin"/>
|
|
<call-service service-name="createFixedAssetMeter" in-map-name="serviceCtx">
|
|
<results-to-map map-name="serviceResult"/>
|
|
</call-service>
|
|
<entity-and list="fixedAssetMeterList" entity-name="FixedAssetMeter">
|
|
<field-map field-name="fixedAssetId" value="1000"/>
|
|
<field-map field-name="productMeterTypeId" value="DISTANCE"/>
|
|
</entity-and>
|
|
<first-from-list entry="fixedAssetMeter" list="fixedAssetMeterList"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMeter"/></not>
|
|
<if-compare operator="equals" value="10" field="fixedAssetMeter.meterValue"></if-compare>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
</simple-methods> |