Author: lektran
Date: Thu Nov 12 21:11:04 2009
New Revision: 835546
URL:
http://svn.apache.org/viewvc?rev=835546&view=revLog:
Allow the duration of the blocking service test to be specified by the caller
Modified:
ofbiz/trunk/framework/common/servicedef/services_test.xml
ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
Modified: ofbiz/trunk/framework/common/servicedef/services_test.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services_test.xml?rev=835546&r1=835545&r2=835546&view=diff==============================================================================
--- ofbiz/trunk/framework/common/servicedef/services_test.xml (original)
+++ ofbiz/trunk/framework/common/servicedef/services_test.xml Thu Nov 12 21:11:04 2009
@@ -34,13 +34,14 @@
<service name="blockingTestScv" engine="java" export="true" 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 serviceengin.xml to configure the rmi location alias -->
+ <!-- see serviceengine.xml to configure the rmi location alias -->
<service name="testRmi" engine="rmi" validate="false"
location="main-rmi" invoke="testScv">
<implements service="testScv"/>
Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=835546&r1=835545&r2=835546&view=diff==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java (original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java Thu Nov 12 21:11:04 2009
@@ -86,9 +86,13 @@
}
public static Map<String, Object> blockingTestService(DispatchContext dctx, Map<String, ?> context) {
- System.out.println("-----SERVICE BLOCKING----- : 30 seconds");
+ Long duration = (Long) context.get("duration");
+ if (duration == null) {
+ duration = 30000l;
+ }
+ System.out.println("-----SERVICE BLOCKING----- : " + duration/1000d +" seconds");
try {
- Thread.sleep(30000);
+ Thread.sleep(duration);
} catch (InterruptedException e) {
}
return CommonServices.testService(dctx, context);