[jboss-svn-commits] JBL Code SVN: r30198 - in labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa: junit and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 18 11:31:48 EST 2009


Author: jhalliday
Date: 2009-11-18 11:31:47 -0500 (Wed, 18 Nov 2009)
New Revision: 30198

Modified:
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java
   labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java
Log:
Fix crash rec connection handling and task output logging. JBTM-390


Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java	2009-11-18 13:41:56 UTC (rev 30197)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Utils/CrashRecoveryDelays.java	2009-11-18 16:31:47 UTC (rev 30198)
@@ -82,6 +82,7 @@
     private static void doRecovery() throws InterruptedException
     {
         int port = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryPort();
+        String host = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryAddress();
 
         BufferedReader in = null;
         PrintStream out = null;
@@ -89,7 +90,7 @@
 
         try
         {
-            sckt = new Socket(InetAddress.getLocalHost(),port);
+            sckt = new Socket(host,port);
 
             in = new BufferedReader(new InputStreamReader(sckt.getInputStream()));
             out = new PrintStream(sckt.getOutputStream());

Modified: labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java
===================================================================
--- labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java	2009-11-18 13:41:56 UTC (rev 30197)
+++ labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/junit/TaskImpl.java	2009-11-18 16:31:47 UTC (rev 30198)
@@ -238,15 +238,17 @@
             String line;
             SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss,SSS");
             while((line = bufferedReader.readLine()) != null) {
+                // need to redirect to file
+                Date date = new Date();
+                out.println(simpleDateFormat.format(date)+" "+"out: " + line);
+                out.flush();
+
                 if("Passed".equals(line)) {
                     printedPassed = true;
                 }
                 if("Failed".equals(line)) {
                     printedFailed = true;
                 }
-                // need to redirect to file
-                Date date = new Date();
-                out.println(simpleDateFormat.format(date)+" "+"out: " + line);
             }
         } catch (Exception e) {
             // if we fail here then the reaper task will clean up the thread
@@ -504,6 +506,7 @@
             }
 
             out.println("!!!TASK TIME OUT!!!");
+            out.flush();
             // we timed out before the process managed to complete so kill it now
             // n.b. since this closes the process stdout we can be sure that the task
             // reader thread will exit.
@@ -592,6 +595,7 @@
             out.print(" ");
         }
         out.println();
+        out.flush();
     }
 
     /**



More information about the jboss-svn-commits mailing list