Class MultiNodeCoordinator

java.lang.Object
com.tibco.ep.testing.framework.MultiNodeCoordinator

public final class MultiNodeCoordinator extends Object

Tools to allow tests to run in-step on multiple nodes

Tests are launched on all nodes and use waitForState() to ensure each node is kept in-sync with each other as the test cases progress :

     enum Steps {
       STARTED,
       CONFIGURED,
       RUNNING,
       TESTS,
       FINISHED
     };
 
      // create coordinator for this test
      //
      MultiNodeCoordinator coordinator = new MultiNodeCoordinator();

      // Wait for all nodes to get here
      //
      coordinator.waitForState(Steps.STARTED);

      // load configuration
      //

      // wait for all nodes to complete loading configuration
      //
      coordinator.waitForState(Steps.CONFIGURED);

      // start embedded server
      //

      // wait for all nodes to complete starting application
      //
      coordinator.waitForState(Steps.RUNNING);

      // run tests
      //

      // wait for all nodes to complete tests
      //
      coordinator.waitForState(Steps.TESTS);

      // wait for all nodes to finish this test
      //
      coordinator.waitForState(Steps.FINISHED);
 

Strings can also be used to specify states :

      MultiNodeCoordinator coordinator = new MultiNodeCoordinator();
      coordinator.waitForState("One");
      coordinator.waitForState("Two");
      coordinator.waitForState("Three");