@Test public void testValidateConnectivity() throws Exception { int numPartitions = 1; IntegrationTestHelper helper = getIntegrationTestHelper(numPartitions); Properties cfgProperties = createProperties(helper.getZkConnectString(), helper.getZnodePath(), helper.getSslSetup()); String cliConfigPath = IntegrationTestHelper.createYamlConfigFile(DIR_NAME, CONFIG_FILE_NAME, cfgProperties); helper.startZooKeeperServer(); WaltzStorageRunner storageRunner = helper.getWaltzStorageRunner(); storageRunner.startAsync(); storageRunner.awaitStart(); helper.startWaltzServer(true); Thread.sleep(1000); try { String[] validateArgs = { "validate", "--cli-config-path", cliConfigPath }; StorageCli.testMain(validateArgs); assertFalse(errContent.toString("UTF-8").contains("Invalid hostname or port")); int fakePort = 9999; addStorageNode(cliConfigPath, helper.getHost(), fakePort, helper.getStorageAdminPort(), 0); String[] validateArgs2 = { "validate", "--cli-config-path", cliConfigPath }; StorageCli.testMain(validateArgs2); assertTrue(errContent.toString("UTF-8").contains("Invalid hostname or port")); assertTrue(errContent.toString("UTF-8").contains(String.format("failed to connect: %s:%d", helper.getHost(), fakePort))); } finally { helper.closeAll(); } }
public static void testMain(String[] args) { new StorageCli(args, true).processCmd(); }
StorageCli extends SubcommandCli { public static void testMain(String[] args) { new StorageCli(args, true).processCmd(); } }
StorageCli extends SubcommandCli { public static void testMain(String[] args) { new StorageCli(args, true).processCmd(); } private  StorageCli(String[] args, boolean useByTest); }
StorageCli extends SubcommandCli { public static void testMain(String[] args) { new StorageCli(args, true).processCmd(); } private  StorageCli(String[] args, boolean useByTest); static void testMain(String[] args); static void main(String[] args); }
StorageCli extends SubcommandCli { public static void testMain(String[] args) { new StorageCli(args, true).processCmd(); } private  StorageCli(String[] args, boolean useByTest); static void testMain(String[] args); static void main(String[] args);  }