Author: alessio.soldano(a)jboss.com
Date: 2013-05-29 04:02:50 -0400 (Wed, 29 May 2013)
New Revision: 17616
Modified:
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/AppclientHelper.java
Log:
Prevent concorrency issue in AppclientHelper + increase frequence of appclient termination
check a bit
Modified:
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/AppclientHelper.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/AppclientHelper.java 2013-05-28
17:23:05 UTC (rev 17615)
+++
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/AppclientHelper.java 2013-05-29
08:02:50 UTC (rev 17616)
@@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
+import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -53,7 +54,7 @@
private static final String EXT = ":".equals(PS) ? ".sh" :
".bat";
private static final String appclientScript = JBOSS_HOME + FS + "bin" + FS +
"appclient" + EXT;
private static final Semaphore s = new Semaphore(1, true); //one appclient only can be
running at the same time ATM
- private static Map<String, AppclientProcess> appclients = new HashMap<String,
AppclientProcess>(1);
+ private static Map<String, AppclientProcess> appclients =
Collections.synchronizedMap(new HashMap<String, AppclientProcess>(2));
private static ExecutorService executors =
Executors.newCachedThreadPool(AppclientDaemonFactory.INSTANCE);
private static String appclientOutputDir;
@@ -198,10 +199,10 @@
private static void awaitOutput(final OutputStream os, final String patternToMatch,
final String errorMessage) throws InterruptedException {
int countOfAttempts = 0;
- final int maxCountOfAttempts = 120; // max wait time: 2 minutes
+ final int maxCountOfAttempts = 240; // max wait time: 2 minutes
while (!os.toString().contains(patternToMatch))
{
- Thread.sleep(1000);
+ Thread.sleep(500);
if (countOfAttempts++ == maxCountOfAttempts)
{
throw new RuntimeException(errorMessage);
Show replies by date