I have uploaded a patch for the simple methods schema. In general, the top level attributes are converted to simpleType, and attributeGroups to complexType. Changed the following attribute name 1. ‘field’ to ‘fieldType’ 2. ‘level’ to ‘levelType' Denormalize the following attributeGroups 1. attlist.compare 2. attlist.compare-field Left attributeGroup ‘typeDefaultString’ unchanged, cos it doesn’t matter. Not in use, it seem. jleroux: we also fixed an issue with <xs:element name="field" type="fieldType"/> to <xs:element ref="field"/> In the patch And I found a small issue (not minilang related) in ExampleCompoundWidgets.xml - <sm:log message="CompoundWidgetsFunc runs" sm:level="info"/> + <sm:log message="CompoundWidgetsFunc runs" level="info"/> git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750647 13f79535-47bb-0310-9956-ffa450edef68
177 lines
9.8 KiB
XML
177 lines
9.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="testCreateFixedAssetRegistration" short-description="Test case for service createFixedAssetRegistration" login-required="false">
|
|
<set field="serviceCtx.fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="serviceCtx.licenseNumber" value="123456"/>
|
|
<set field="serviceCtx.registrationNumber" value="123456"/>
|
|
<set field="serviceCtx.registrationDate" value="2009-12-24 12:33:23.703" type="Timestamp"/>
|
|
<set field="serviceCtx.fromDate" value="2009-12-24 12:33:08.247" type="Timestamp"/>
|
|
<set field="serviceCtx.thruDate" value="2010-12-25 12:33:18.365" 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="createFixedAssetRegistration" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetRegistration" value-field="fixedAssetRegistration">
|
|
<field-map field-name="fixedAssetId" from-field="serviceCtx.fixedAssetId"/>
|
|
<field-map field-name="fromDate" from-field="serviceCtx.fromDate"/>
|
|
</entity-one>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetRegistration"/></not>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testUpdateFixedAssetRegistration" short-description="Test case for service updateFixedAssetRegistration" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="registrationDate" value="2010-12-24 12:33:23.703" type="Timestamp"/>
|
|
<set field="fromDate" value="2009-12-24 12:33:08.247" type="Timestamp"/>
|
|
<set field="thruDate" value="2033-12-25 12:33:18.365" 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"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.registrationDate" from-field="registrationDate"/>
|
|
<set field="serviceCtx.fromDate" from-field="fromDate"/>
|
|
<set field="serviceCtx.thruDate" from-field="thruDate"/>
|
|
<call-service service-name="updateFixedAssetRegistration" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetRegistration" value-field="fixedAssetRegistration"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetRegistration"/></not>
|
|
<if-compare-field field="fixedAssetRegistration.thruDate" operator="equals" to-field="thruDate"/>
|
|
<if-compare-field field="fixedAssetRegistration.registrationDate" operator="equals" to-field="registrationDate"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testDeleteFixedAssetRegistration" short-description="Test case for service deleteFixedAssetRegistration" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="fromDate" value="2009-12-24 12:33:08.247" 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"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.fromDate" from-field="fromDate"/>
|
|
<call-service service-name="deleteFixedAssetRegistration" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetRegistration" value-field="fixedAssetRegistration"/>
|
|
<assert>
|
|
<if-empty field="fixedAssetRegistration"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testCreateFixedAssetMeter" short-description="Test case for service createFixedAssetMeter" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="productMeterTypeId" value="ODOMETER"/>
|
|
<set field="readingDate" value="2009-12-24 00:00:00.000" type="Timestamp"/>
|
|
<set field="meterValue" value="65" 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"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.productMeterTypeId" from-field="productMeterTypeId"/>
|
|
<set field="serviceCtx.readingDate" from-field="readingDate"/>
|
|
<set field="serviceCtx.meterValue" from-field="meterValue"/>
|
|
<call-service service-name="createFixedAssetMeter" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetMeter" value-field="fixedAssetMeter"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMeter"/></not>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testUpdateFixedAssetMeter" short-description="Test case for service updateFixedAssetMeter" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="productMeterTypeId" value="ODOMETER"/>
|
|
<set field="readingDate" value="2009-12-24 00:00:00.000" type="Timestamp"/>
|
|
<set field="meterValue" value="85" 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"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.productMeterTypeId" from-field="productMeterTypeId"/>
|
|
<set field="serviceCtx.readingDate" from-field="readingDate"/>
|
|
<set field="serviceCtx.meterValue" from-field="meterValue"/>
|
|
<call-service service-name="updateFixedAssetMeter" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetMeter" value-field="fixedAssetMeter"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetMeter"/></not>
|
|
<if-compare-field field="fixedAssetMeter.meterValue" operator="equals" to-field="meterValue"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testDeleteFixedAssetMeter" short-description="Test case for service deleteFixedAssetMeter" login-required="false">
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<set field="productMeterTypeId" value="ODOMETER"/>
|
|
<set field="readingDate" value="2009-12-24 00:00:00.000" 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"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<set field="serviceCtx.productMeterTypeId" from-field="productMeterTypeId"/>
|
|
<set field="serviceCtx.readingDate" from-field="readingDate"/>
|
|
<call-service service-name="deleteFixedAssetMeter" in-map-name="serviceCtx"/>
|
|
|
|
<entity-one entity-name="FixedAssetMeter" value-field="fixedAssetMeter"/>
|
|
<assert>
|
|
<if-empty field="fixedAssetMeter"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
|
|
<simple-method method-name="testCreateFixedAssetGeoPoint" short-description="Test case for service createFixedAssetGeoPoint" login-required="false">
|
|
<set field="geoPointId" value="9000"/>
|
|
<set field="fixedAssetId" value="DEMO_VEHICLE_01"/>
|
|
<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.geoPointId" from-field="geoPointId"/>
|
|
<set field="serviceCtx.fixedAssetId" from-field="fixedAssetId"/>
|
|
<call-service service-name="createFixedAssetGeoPoint" in-map-name="serviceCtx"/>
|
|
<entity-and entity-name="FixedAssetGeoPoint" list="fixedAssetGeoPoints" filter-by-date="true">
|
|
<field-map field-name="geoPointId"/>
|
|
<field-map field-name="fixedAssetId"/>
|
|
</entity-and>
|
|
<first-from-list list="fixedAssetGeoPoints" entry="fixedAssetGeoPoint"/>
|
|
<assert>
|
|
<not><if-empty field="fixedAssetGeoPoint"/></not>
|
|
<if-compare-field field="fixedAssetGeoPoint.geoPointId" operator="equals" to-field="geoPointId"/>
|
|
<if-compare-field field="fixedAssetGeoPoint.fixedAssetId" operator="equals" to-field="fixedAssetId"/>
|
|
</assert>
|
|
<check-errors/>
|
|
</simple-method>
|
|
</simple-methods>
|