changes to realizations and tp for testing

jg253 [2002-04-22 22:16:08]
changes to realizations and tp for testing
Filename
ProcessorMain.java
demo.txt
test/svr1/tp3.xml
test/svr1/tp4.xml
test/svr1/workflows/svr1/end/Realization.class
test/svr1/workflows/svr1/end/Realization.java
test/svr1/workflows/svr1/middle/Realization.class
test/svr1/workflows/svr1/middle/Realization.java
test/svr1/workflows/svr1/start/Realization.class
test/svr1/workflows/svr1/start/Realization.java
diff --git a/ProcessorMain.java b/ProcessorMain.java
index d8517c3..7bc94eb 100644
--- a/ProcessorMain.java
+++ b/ProcessorMain.java
@@ -65,7 +65,7 @@ public class ProcessorMain {
 	String hostname = null;
 	int port = -1;
         int lPort = -1;
-	for (int i = 0; i+1 < args.length; i+=2) {
+	for (int i = 0; i + 1 < args.length; i+=2) {
 	    if (args[i].equals("-f")) {
 		xmlPath = args[i+1];
 	    }
diff --git a/demo.txt b/demo.txt
new file mode 100644
index 0000000..4b36046
--- /dev/null
+++ b/demo.txt
@@ -0,0 +1,76 @@
+All of the following workflows exhibit survivabilty scenarios on the
+following workflow:
+
+START -> start -> middle -> end -> END
+
+Test 1 - workflow execution
+node A: psl.survivor.ProcessorMain with test\svrt\tp1.xml
+node B: psl.survivor.ProcessorMain with test\svrt\tp2.xml
+node C: psl.survivor.ProcessorMain with test\svrt\tp4.xml
+
+start workflow on node A using the listener port
+workflow runs to completion
+
+
+Test 2 - workflow execution, kill needed node before the workflow gets
+there.  By providing an alternate node with the needed capabilities,
+the workflow will keep execution.
+
+node A: psl.survivor.ProcessorMain with test\svrt\tp1.xml
+node B: psl.survivor.ProcessorMain with test\svrt\tp2.xml
+node C: psl.survivor.ProcessorMain with test\svrt\tp3.xml
+node D: psl.survivor.ProcessorMain with test\svrt\tp4.xml
+
+start workflow on node A using the listener port
+kill node B before the workflow gets there
+workflow will go to alternate node and run to completion
+
+
+Test 3 - workflow execution, kill a node while the workflow is running
+there.  Replicator nodes will notice that the workflow's execution was
+compromised and will restart execution at the latest version.
+
+node A: psl.survivor.ProcessorMain with test\svrt\tp1.xml
+node B: psl.survivor.ProcessorMain with test\svrt\tp2.xml
+node C: psl.survivor.ProcessorMain with test\svrt\tp3.xml
+node D: psl.survivor.ProcessorMain with test\svrt\tp4.xml
+
+start workflow on node A using the listener port
+kill node B while the workflow is executing there
+workflow node B crash will be detected
+workflow will go to alternate node and run to completion.
+
+
+Test 4 - workflow execution, kill a node while the workflow is running
+there. Kill a replicator for that node. Another replicator will notice
+that the workflow's execution was compromised and will restart
+execution at the latest version.
+
+node A: psl.survivor.ProcessorMain with test\svrt\tp1.xml
+node B: psl.survivor.ProcessorMain with test\svrt\tp2.xml
+node C: psl.survivor.ProcessorMain with test\svrt\tp3.xml
+node D: psl.survivor.ProcessorMain with test\svrt\tp4.xml
+
+start workflow on node A using the listener port
+kill node B and node A while the workflow is executing on node B
+workflow node B crash will be detected by a replicator other than A.
+workflow will go to alternate node and run to completion.
+
+
+Test 5 - workflow partial execution. provide a node to finish
+execution dynamically. workflow will tun to completion.
+
+node A: psl.survivor.ProcessorMain with test\svrt\tp1.xml
+node B: psl.survivor.ProcessorMain with test\svrt\tp2.xml
+
+start workflow on node A.
+workflow will execute until node B.
+
+dynamically provide
+node C: psl.survivor.ProcessorMain with test\svrt\tp4.xml
+
+workflow will detect node with enough capabilities and will run to
+completion.
+
+
+
diff --git a/test/svr1/tp3.xml b/test/svr1/tp3.xml
index 059d6d3..9cb801e 100644
--- a/test/svr1/tp3.xml
+++ b/test/svr1/tp3.xml
@@ -1,3 +1,4 @@
 <TaskProcessor name="tp3" RMIName="tp3" TCPPort="8012" WorkflowDefinitionPath="test/svr1" proctype="psl.survivor.proc.nrl.NRLProcessor">
+<Capability name="middle" value="true"/>
 <Capability name="end" value="true"/>
 </TaskProcessor>
diff --git a/test/svr1/tp4.xml b/test/svr1/tp4.xml
index 669a1ce..1822a82 100644
--- a/test/svr1/tp4.xml
+++ b/test/svr1/tp4.xml
@@ -1,4 +1,3 @@
 <TaskProcessor name="tp4" RMIName="tp4" TCPPort="8014" WorkflowDefinitionPath="test/svr1" proctype="psl.survivor.proc.nrl.NRLProcessor">
-<Capability name="start" value="true"/>
-<Capability name="START" value="true"/>
+<Capability name="end" value="true"/>
 </TaskProcessor>
diff --git a/test/svr1/workflows/svr1/end/Realization.class b/test/svr1/workflows/svr1/end/Realization.class
index afde800..6934127 100644
Binary files a/test/svr1/workflows/svr1/end/Realization.class and b/test/svr1/workflows/svr1/end/Realization.class differ
diff --git a/test/svr1/workflows/svr1/end/Realization.java b/test/svr1/workflows/svr1/end/Realization.java
index d9af212..72841f3 100644
--- a/test/svr1/workflows/svr1/end/Realization.java
+++ b/test/svr1/workflows/svr1/end/Realization.java
@@ -34,7 +34,8 @@ public class Realization extends AbstractRealization{
   	public void run(){
     try{

-      System.out.println("Running the END task");
+      System.out.println("RUNNING END TASK");
+      System.out.println("DONE RUNNING END TASK");
       taskMgr().endTask(null);
     }
     catch(Exception e){
diff --git a/test/svr1/workflows/svr1/middle/Realization.class b/test/svr1/workflows/svr1/middle/Realization.class
index b147853..24c47a0 100644
Binary files a/test/svr1/workflows/svr1/middle/Realization.class and b/test/svr1/workflows/svr1/middle/Realization.class differ
diff --git a/test/svr1/workflows/svr1/middle/Realization.java b/test/svr1/workflows/svr1/middle/Realization.java
index 1e86023..6bef86d 100644
--- a/test/svr1/workflows/svr1/middle/Realization.java
+++ b/test/svr1/workflows/svr1/middle/Realization.java
@@ -34,11 +34,11 @@ public class Realization extends AbstractRealization{
   	public void run(){
     try{

-      System.out.println("Running the MIDDLE task");
-      try {
-	  Thread.sleep(2000);
+	System.out.println("RUNNING MIDDLE TASK");
+	try {
+	  Thread.sleep(1000);
       } catch (Exception e) {;}
-
+	
System.out.println("DONE RUNNING MIDDLE TASK");
       psl.survivor.demo.Input.display("" + psl.survivor.proc.nrl.NRLProcessor.getObject("key"));

       taskMgr().endTask(null);
diff --git a/test/svr1/workflows/svr1/start/Realization.class b/test/svr1/workflows/svr1/start/Realization.class
index fab38d1..20ca4d8 100644
Binary files a/test/svr1/workflows/svr1/start/Realization.class and b/test/svr1/workflows/svr1/start/Realization.class differ
diff --git a/test/svr1/workflows/svr1/start/Realization.java b/test/svr1/workflows/svr1/start/Realization.java
index bfaa289..a7cd6a6 100644
--- a/test/svr1/workflows/svr1/start/Realization.java
+++ b/test/svr1/workflows/svr1/start/Realization.java
@@ -31,24 +31,23 @@ The following permissions are granted:

 public class Realization extends AbstractRealization{

-  	public void run(){
-    try{
-
-      System.out.println("Running the START task");
-      try {
-      Thread.sleep(1000);
-      } catch (Exception e) {
-      }
-
-      psl.survivor.proc.nrl.NRLProcessor.setObject("key", psl.survivor.demo.Input.getInput("say what?"));
-
-      System.out.println("DONE");
-      taskMgr().endTask(null);
-    }
-    catch(Exception e){
-
-      taskMgr().endTask(e);
-    }
-  }
-
+    public void run(){
+	try{
+
+	    System.out.println("RUNNING START TASK");
+	    try {
+		Thread.sleep(1000);
+	    } catch (Exception e) {
+	    }
+	    System.out.println("DONE RUNNING START TASK");
+
+	    psl.survivor.proc.nrl.NRLProcessor.setObject
+		("key", psl.survivor.demo.Input.getInput("say what?"));
+
+	    taskMgr().endTask(null);
+	}
+	catch(Exception e){
+	    taskMgr().endTask(e);
+	}
+    }
 }