Author: alessio.soldano(a)jboss.com
Date: 2013-05-24 05:04:33 -0400 (Fri, 24 May 2013)
New Revision: 17610
Modified:
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
Log:
[JBWS-3639] Improving Jim's fix:
- make the timeout value configurable
- default to very high timeout value on Windows env only
Modified:
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-05-24
08:17:16 UTC (rev 17609)
+++
stack/cxf/trunk/modules/testsuite/test-utils/src/main/java/org/jboss/wsf/test/JBossWSTest.java 2013-05-24
09:04:33 UTC (rev 17610)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -61,6 +61,8 @@
public abstract class JBossWSTest extends TestCase
{
protected static Logger log = Logger.getLogger(JBossWSTest.class.getName());
+ public static final String SYSPROP_COPY_JOB_TIMEOUT =
"test.copy.job.timeout";
+ private static final int COPY_JOB_TIMEOUT =
Integer.getInteger(SYSPROP_COPY_JOB_TIMEOUT, File.pathSeparatorChar == ':' ? 5000
: 60000); //60s on Windows, 5s on UNIX and Mac
public JBossWSTest()
{
@@ -171,16 +173,14 @@
CopyJob inputStreamJob = new CopyJob(p.getInputStream(), os == null ? System.out :
os);
CopyJob errorStreamJob = new CopyJob(p.getErrorStream(), System.err);
// unfortunately the following threads are needed because of Windows behavior
- System.out.println("Process input stream:");
- System.err.println("Process error stream:");
Thread inputJob = new Thread(inputStreamJob);
Thread outputJob = new Thread(errorStreamJob);
try
{
inputJob.start();
- inputJob.join(60000);
+ inputJob.join(COPY_JOB_TIMEOUT);
outputJob.start();
- outputJob.join(60000);
+ outputJob.join(COPY_JOB_TIMEOUT);
int statusCode = p.waitFor();
String fallbackMessage = "Process did exit with status " + statusCode;
assertTrue(message != null ? message : fallbackMessage, statusCode == 0);
Show replies by date