コード例 #1
0
  @Override
  protected void setUp() throws Exception {
    configBuilder = new TcConfigBuilder("/com/tc/active-passive-fail-over-test.xml");
    configBuilder.randomizePorts();

    jmxPort_1 = configBuilder.getJmxPort(0);
    jmxPort_2 = configBuilder.getJmxPort(1);

    tsaPort_1 = configBuilder.getTsaPort(0);
    tsaPort_2 = configBuilder.getTsaPort(1);

    server_1 = createServer("server-1");
    server_2 = createServer("server-2");

    server_1.start();
    System.out.println("server1 started");
    waitTillBecomeActive(jmxPort_1);
    System.out.println("server1 became active");
    server_2.start();
    System.out.println("server2 started");
    waitTillBecomePassiveStandBy(jmxPort_2);
    System.out.println("server2 became passive");
  }
コード例 #2
0
 private ExternalDsoServer createServer(final String serverName) throws IOException {
   ExternalDsoServer server =
       new ExternalDsoServer(getWorkDir(serverName), configBuilder.newInputStream(), serverName);
   return server;
 }