Author: richard.opalka(a)jboss.com
Date: 2012-06-04 05:40:04 -0400 (Mon, 04 Jun 2012)
New Revision: 16346
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java
Log:
[JBWS-3490] fixing test - using appropriate sync. techniques, implementing 30 second
timeout
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java 2012-06-04
09:08:58 UTC (rev 16345)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl.java 2012-06-04
09:40:04 UTC (rev 16346)
@@ -38,8 +38,8 @@
public class EndpointImpl
{
- static String value;
- static RuntimeException ex;
+ static volatile String value;
+ static volatile RuntimeException ex;
@Oneway
public void doit()
Modified:
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java
===================================================================
---
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java 2012-06-04
09:08:58 UTC (rev 16345)
+++
shared-testsuite/trunk/testsuite/src/test/java/org/jboss/test/ws/jaxws/as3581/EndpointImpl2.java 2012-06-04
09:40:04 UTC (rev 16346)
@@ -40,8 +40,20 @@
public String getString()
{
- if (EndpointImpl.ex != null) throw EndpointImpl.ex;
- return EndpointImpl.value;
+ for (int i = 0; i < 30; i++)
+ {
+ if (EndpointImpl.ex != null) throw EndpointImpl.ex;
+ if (EndpointImpl.value != null) return EndpointImpl.value;
+ try
+ {
+ Thread.sleep(1000);
+ }
+ catch (InterruptedException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ throw new RuntimeException("Timeout: Cannot get injected value");
}
}
Show replies by date