Files
ofbiz-framework/framework/common/servicedef/services_test.xml
T
Jacques Le Roux c86a579cf8 Set different ports for testing in a CI environment (e.g. Jenkins) https://issues.apache.org/jira/browse/OFBIZ-4794
*What's for?*
OOTB the port offset is interesting in at least 3 cases:
# To simultaneously run tests on the same Buildbot machine. This is related to http://mail-archives.apache.org/mod_mbox/www-builds/201209.mbox/%3C002101cd991b$0a16de50$1e449af0$@16degrees.com.au%3E
# To simultaneously run the demos without having to change much things, just one parameter
# To eventually run Sonar on OFBiz sources https://issues.apache.org/jira/browse/INFRA-3590

*How it's done?*
Basically, I just added a portoffset integer parameter to some ant targets (of course this JVM param can also be used in a Java call from command line):
* in trunk and R13.07: start, start-batch, start-debug, start-pos, start-both, run-tests and run-test
* in R12.04 and R11.04: run-tests, run-test. I did not set start targets because anyway it would miss the admin port offset, withouh much changes. So can't be used to demonstrate. We will continue to use the current paches for those.

The portoffset parameter is set to zero by default in ClassLoaderContainer.java. 
If a value is passed, it's then grabed by Config.java and passed to ClassLoaderContainer.java, where it's set to this value.

 The portoffset is then used to change in one shoot all the default ports values defined (in config or hardcoded), and the admin port value in R13.07 and trunk.
This is done in following classes:
CatalinaContainer
NamingServiceContainer
ServiceEngine through ServiceLocation
RmiServiceContainer
XMLRPCClientEngine
XmlRpcTests

To avoid hardcoding locations in services definitions, I also had to create some service-locations: main-local-soap and main-remote-soap 

*What are the constraints?*
* For demos: the offset should not be applied to trunk because <service-location name="main-remote-soap" location="http://demo-trunk.ofbiz.apache.org:8080/webtools/control/SOAPService"/> is used for tests by trunk *and all releases*. It's useless to apply to trunk anyway,  offsetting port in releases is enough.
* I did not take into account the Ideal payment harcoded port values in IdealPaymentServiceTest.java. Weirdly I did not cross error during tests, though it seems there are tests using an harcoded port in url.

*What is the status?*
Locally (on Win XP)  I ran many tests combinations with <<ant load-demo run-tests>>.  
Applying the portoffset on a sole running test instance has no effects. I have still some fails (no errors) but those are not related to my changes, they appear also without.
But when I run a combination of any releases/trunk but with R11.04, I get a time out error with testSOAPSimpleService, that I can't explain so far. 
If I run the trunk alone with the portoffset no errors occur. Same if I run a release with portoffset and only testSOAPSimpleService in trunk (w/ or w/o portoffset)

*To summarize:* these changes will be used to run Buildot tests instances simultaneously . And, for coming releases, to run demos without having to create patches. Simply running ant start with a portoffset value which will take care of all ports values, including admin port. For running R12.04 demo as stable we will still need to create a patch for the last time.

*What I will to do for now:* commit the patches and test if I cross the same issue on Buildbot. If it's the same (99% chances it will) I will revert and will continue to locally try to find the reason . I believe this issue is unrelated to the changes I implemened.  And it's just because it's now possible to simultaneously run tests that it appears. 

BTW I just noticed that when you run R11.04 with R12.04, R12.04 takes almost all the CPU (XP is not very, while when running any combinations w/o R11.04 the CPU load is shared. 
Also there are far less tests in R11.04, which coul be the reason when I run it with another test run instance there are no issues.  Because R11.04 tests finish before the other instance gets to run testSOAPSimpleService.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1525909 13f79535-47bb-0310-9956-ffa450edef68
2013-09-24 14:47:30 +00:00

287 lines
15 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.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
<description>OFBIZ Test Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
<service name="testScv" engine="java" export="true" validate="false" require-new-transaction="true"
location="org.ofbiz.common.CommonServices" invoke="testService">
<description>Test service</description>
<attribute name="defaultValue" type="Double" mode="IN" default-value="999.9999"/>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<service name="testSOAPScv" engine="java" export="true" validate="false" require-new-transaction="true"
location="org.ofbiz.common.CommonServices" invoke="testSOAPService">
<description>Test SOAP service</description>
<attribute name="testing" type="org.ofbiz.entity.GenericValue" mode="IN" optional="false"/>
<attribute name="testingNodes" type="List" mode="OUT" optional="true"/>
</service>
<service name="blockingTestScv" engine="java" validate="false" require-new-transaction="true" transaction-timeout="20"
location="org.ofbiz.common.CommonServices" invoke="blockingTestService">
<description>Blocking Test service</description>
<attribute name="duration" mode="IN" type="Long" optional="true"/>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<service name="testError" engine="java" export="true" validate="false" require-new-transaction="true" max-retry="1"
location="org.ofbiz.common.CommonServices" invoke="returnErrorService">
</service>
<!-- see serviceengine.xml to configure the rmi location alias -->
<service name="testRmi" engine="rmi" validate="false"
location="main-rmi" invoke="testScv">
<implements service="testScv"/>
</service>
<service name="testRmiFail" engine="rmi" validate="false"
location="main-rmi" invoke="testBsh">
<implements service="testScv"/>
</service>
<service name="testRollback" engine="java" export="true" validate="false"
location="org.ofbiz.common.CommonServices" invoke="testRollbackListener">
<description>Test service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<service name="testCommit" engine="java" export="true" validate="false"
location="org.ofbiz.common.CommonServices" invoke="testCommitListener">
<description>Test service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<service name="groupTest" engine="group" location="testGroup" invoke=""/>
<service name="testHttp" engine="http" location="main-http" invoke="testScv">
<description>HTTP service wrapper around the test service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<service name="testSoap" engine="soap" export="true" location="main-local-soap" invoke="testSOAPScv">
<description>SOAP service; calls the OFBiz test SOAP service</description>
<implements service="testSOAPScv"/>
</service>
<service name="testSoapSimple" engine="soap" export="true" location="main-local-soap" invoke="testScv">
<description>simple SOAP service; calls the OFBiz test service</description>
<implements service="testScv"/>
</service>
<service name="testRemoteSoap" engine="soap" export="true" location="main-remote-soap" invoke="testSoapSimple">
<attribute name="defaultValue" type="Double" mode="IN" default-value="999.9999"/>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="resp" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, the 4 remote SOAP services below don't work -->
<!-- the location = endpoint = SOAP action -->
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListZipCode -->
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
<service name="testRemoteSoap1" engine="soap" export="true"
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
invoke="LatLonListZipCode">
<description>A service to invoke the NWS web service</description>
<namespace>
http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonListZipCode
</namespace>
<attribute name="ZipCode" type="String" mode="IN"/>
<attribute name="invoke" type="String" mode="IN" />
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- the location = endpoint = SOAP action -->
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListCityNames -->
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
<service name="testRemoteSoap2" engine="soap" export="true"
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
invoke="LatLonListCityNames">
<description>A service to invoke the NWS web service</description>
<namespace>
http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl#LatLonListCityNames
</namespace>
<attribute name="CityName" type="String" mode="IN"/>
<attribute name="invoke" type="String" mode="IN" />
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
<service name="testRemoteSoap3" engine="soap" export="true"
location="http://www.restfulwebservices.net/wcf/EmailValidationService.svc"
invoke="EmailValidationService">
<attribute name="ZipCode" type="String" mode="IN"/>
<attribute name="invoke" type="String" mode="IN" />
<attribute name="result" type="String" mode="OUT"/>
</service>
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
<service name="testRemoteSoap4" engine="soap" export="true"
location="http://www.webservicex.net/geoipservice.asmx"
invoke="GetGeoIPContext">
<attribute name="invoke" type="String" mode="IN" />
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testBsh" engine="bsh" location="component://common/script/org/ofbiz/common/BshServiceTest.bsh" invoke="">
<description>Test BeanShell Script Service</description>
<attribute name="message" type="String" mode="IN" optional="true" />
<attribute name="result" type="String" mode="OUT" />
</service>
<service name="testGroovy" engine="groovy" location="component://common/script/org/ofbiz/common/GroovyServiceTest.groovy" invoke="">
<description>Test Groovy Script Service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testGroovyMethod" engine="groovy" location="component://common/script/org/ofbiz/common/GroovyServiceTest.groovy" invoke="testMethod">
<description>Test Groovy Script Service Method Invocation</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testScriptEngineBsh" engine="script" location="component://common/script/org/ofbiz/common/BshServiceTest.bsh" invoke="">
<description>Test BeanShell Script Service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testScriptEngineGroovy" engine="script" location="component://common/script/org/ofbiz/common/GroovyServiceTest.groovy" invoke="">
<description>Test Script Engine With Groovy Script</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testScriptEngineGroovyMethod" engine="script" location="component://common/script/org/ofbiz/common/GroovyServiceTest.groovy" invoke="testMethod">
<description>Test Script Engine With Groovy Script Method Invocation</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testScriptEngineJavaScript" engine="script" location="component://common/script/org/ofbiz/common/JavaScriptTest.js" invoke="">
<description>Test Script Engine With JavaScript</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="exampleId" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testScriptEngineJavaScriptFunction" engine="script" location="component://common/script/org/ofbiz/common/JavaScriptTest.js" invoke="testFunction">
<description>Test Script Engine With JavaScript Function Invocation</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT"/>
</service>
<service name="testJMSQueue" engine="jms" location="serviceMessenger" invoke="testScv">
<description>Test JMS Queue service</description>
<attribute name="message" type="String" mode="IN"/>
</service>
<service name="testJMSTopic" engine="jms" location="serviceMessenger" invoke="testScv">
<description>Test JMS Topic service</description>
<attribute name="message" type="String" mode="IN"/>
</service>
<service name="testMca" engine="java"
location="org.ofbiz.common.CommonServices" invoke="mcaTest">
<description>Test Service MCA</description>
<implements service="mailProcessInterface"/>
</service>
<service name="testRoute" engine="route" location="" invoke="" auth="true">
<description>Test the Route engine</description>
</service>
<service name="simpleMapListTest" engine="java" auth="false" export="true"
location="org.ofbiz.common.CommonServices" invoke="simpleMapListTest">
<description>To test XML-RPC handling of Maps and Lists</description>
<attribute name="listOfStrings" type="List" mode="IN"/>
<attribute name="mapOfStrings" type="Map" mode="IN"/>
</service>
<service name="testJavaScript" engine="javascript" auth="false"
location="component://common/script/org/ofbiz/common/JavaScriptTest.js" invoke="">
<description>Test JavaScript Service</description>
<attribute name="message" type="String" mode="IN" optional="true"/>
<attribute name="result" type="String" mode="OUT" optional="true"/>
</service>
<service name="testEntityFailure" engine="java" auth="false" validate="false"
location="org.ofbiz.common.CommonServices" invoke="entityFailTest">
<description>Cause a Referential Integrity Error</description>
</service>
<service name="entitySortTest" engine="java" auth="false" validate="false"
location="org.ofbiz.common.CommonServices" invoke="entitySortTest">
<description>Test Entity Comparable</description>
</service>
<service name="makeALotOfVisits" engine="java" auth="true"
location="org.ofbiz.common.CommonServices" invoke="makeALotOfVisits">
<description>Test JavaScript Service</description>
<attribute name="count" type="Integer" mode="IN" optional="false"/>
<attribute name="rollback" type="Boolean" mode="IN" optional="true"/>
</service>
<service name="byteBufferTest" engine="java" auth="true"
location="org.ofbiz.common.CommonServices" invoke="byteBufferTest">
<description>Test Passing ByteBuffer To Service</description>
<attribute name="byteBuffer1" type="java.nio.ByteBuffer" mode="IN" optional="false"/>
<attribute name="saveAsFileName1" type="String" mode="IN" optional="false"/>
<attribute name="byteBuffer2" type="java.nio.ByteBuffer" mode="IN" optional="false"/>
<attribute name="saveAsFileName2" type="String" mode="IN" optional="false"/>
</service>
<service name="uploadContentTest" engine="java" auth="true"
location="org.ofbiz.common.CommonServices" invoke="uploadTest">
<description>Upload Content Test Service</description>
<attribute name="uploadFile" type="java.nio.ByteBuffer" mode="IN" optional="false"/>
<attribute name="_uploadFile_contentType" type="String" mode="IN" optional="false"/>
<attribute name="_uploadFile_fileName" type="String" mode="IN" optional="false"/>
</service>
<service name="conditionReturnTrue" engine="java"
location="org.ofbiz.common.CommonServices" invoke="conditionTrueService">
<description>ECA Condition Service - Return TRUE</description>
<implements service="serviceEcaConditionInterface"/>
</service>
<service name="conditionReturnFalse" engine="java"
location="org.ofbiz.common.CommonServices" invoke="conditionFalseService">
<description>ECA Condition Service - Return FALSE</description>
<implements service="serviceEcaConditionInterface"/>
</service>
<service name="serviceStreamTest" engine="java" auth="false"
location="org.ofbiz.common.CommonServices" invoke="streamTest">
<implements service="serviceStreamInterface"/>
</service>
<service name="ping" engine="java" export="true" require-new-transaction="true"
location="org.ofbiz.common.CommonServices" invoke="ping">
<description>Test Ping Service</description>
<attribute name="message" type="String" mode="INOUT" optional="true"/>
</service>
</services>