Ejemplo n.º 1
0
  private static void stopGateways() throws IOException, InterruptedException {
    javaProcessLauncher.stopBySendingNewLineIntoProcess(cacheServerA);
    javaProcessLauncher.stopBySendingNewLineIntoProcess(cacheServerB);
    javaProcessLauncher.stopBySendingNewLineIntoProcess(cacheServerC);

    javaProcessLauncher.stopBySendingNewLineIntoProcess(gatewayA);
    javaProcessLauncher.stopBySendingNewLineIntoProcess(gatewayB);
    javaProcessLauncher.stopBySendingNewLineIntoProcess(gatewayC);
  }
Ejemplo n.º 2
0
  @Test
  public void testMainPositive() throws Exception {
    System.out.println("testMainPositive");

    PropertiesHelper propertiesHelper =
        new PropertiesHelper("/checkReplicationToolGatewayA.properties");

    String[] vmArguments =
        new String[] {
          "-Dgemfire.license-file=" + propertiesHelper.getStringProperty("license-file"),
          "-Dgemfire.license-type=" + propertiesHelper.getStringProperty("license-type"),
          "-Dgemfire.log-level=none"
        };

    int exitCode =
        javaProcessLauncher.runAndWaitProcessExitCode(
            "",
            Launcher.class,
            vmArguments,
            new String[] {
              "-d",
              "-q",
              "check-replication",
              "-c",
              "clusterA=localhost[18081]",
              "-c",
              "clusterB=localhost[18082]",
              "-c",
              "clusterC=localhost[18083]",
              "-t",
              "30000"
            });

    assertEquals(exitCode, 0);
  }
Ejemplo n.º 3
0
  @Test
  public void testMainNegativeEmptyParameters() throws Exception {
    System.out.println("testMainNegativeEmptyParameters");

    int exitCode =
        javaProcessLauncher.runAndWaitProcessExitCode(
            "", Launcher.class, null, new String[] {"check-replication"});

    assertEquals(exitCode, 1);
  }
Ejemplo n.º 4
0
  @Test
  public void testMainPositiveDefaultLicense() throws Exception {
    System.out.println("testMainPositiveDefaultLicense");

    int exitCode =
        javaProcessLauncher.runAndWaitProcessExitCode(
            "",
            Launcher.class,
            null,
            new String[] {
              "check-replication",
              "-c",
              "clusterA=localhost[18081]",
              "-c",
              "clusterB=localhost[18082]",
              "-c",
              "clusterC=localhost[18083]",
              "-t",
              "10000"
            });

    assertEquals(exitCode, 0);
  }
Ejemplo n.º 5
0
  private static void startGateways() throws IOException, InterruptedException {
    gatewayA =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolGatewayA.properties"},
            new String[] {User.class.getName()});
    gatewayB =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolGatewayB.properties"},
            new String[] {User.class.getName()});
    gatewayC =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolGatewayC.properties"},
            new String[] {User.class.getName()});

    cacheServerA =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolCacheServerA.properties"},
            new String[] {User.class.getName()});
    cacheServerB =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolCacheServerB.properties"},
            new String[] {User.class.getName()});
    cacheServerC =
        javaProcessLauncher.runWithConfirmation(
            "",
            ServerTemplate.class,
            new String[] {"-DgemfirePropertyFile=checkReplicationToolCacheServerC.properties"},
            new String[] {User.class.getName()});
  }