river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sijs...@apache.org
Subject svn commit: r1029786 - in /incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness: HeartOfTheMachine.java MasterTest.java
Date Mon, 01 Nov 2010 18:34:11 GMT
Author: sijskes
Date: Mon Nov  1 18:34:10 2010
New Revision: 1029786

URL: http://svn.apache.org/viewvc?rev=1029786&view=rev
Log:
a new heart for our tinman

Added:
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
Modified:
    incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java

Added: incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java?rev=1029786&view=auto
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java (added)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/HeartOfTheMachine.java Mon Nov
 1 18:34:10 2010
@@ -0,0 +1,61 @@
+/*
+ *  HeartOfTheMachine.java
+ * 
+ *  Created on Nov 1, 2010 7:03:57 PM by sim
+ * 
+ */
+
+package com.sun.jini.qa.harness;
+
+import java.io.File;
+import java.util.concurrent.TimeUnit;
+
+/**
+ *
+ * @author sim
+ */
+public class HeartOfTheMachine
+{
+    private static String soulfile = System.getProperty("soul");
+
+    public HeartOfTheMachine()
+    {
+    }
+
+    private boolean hasReasonToLive()
+    {
+        File f = new File(soulfile);
+        return f.exists();
+    }
+
+    private void ticktack()
+    {
+        try {
+            while( hasReasonToLive() ) {
+                Thread.sleep( TimeUnit.SECONDS.toMillis(30) );
+            }
+            Runtime.getRuntime().halt(999);
+        } catch( InterruptedException e ) {
+            //Runtime.getRuntime().halt(999);
+        } finally {
+        }
+    }
+
+    public static void start()
+    {
+        if( soulfile == null ) {
+            return ;
+        }
+        
+        Thread t = new Thread( new Runnable() {
+
+            public void run()
+            {
+                new HeartOfTheMachine().ticktack();
+            }
+
+        }, "no heart without soul");
+        t.setDaemon(true);
+        t.start();
+    }
+}

Modified: incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java?rev=1029786&r1=1029785&r2=1029786&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java (original)
+++ incubator/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterTest.java Mon Nov  1 18:34:10
2010
@@ -97,6 +97,9 @@ class MasterTest {
 	    e.printStackTrace();
 	    exit(false, Test.ENV, "Could not read config from System.in");
 	}
+
+        HeartOfTheMachine.start();
+
 	// used to be handled by config.readObject, but this broke SlaveHarness
 	try {
 	    config.loadTestConfiguration();



Mime
View raw message