@Test public void testLaunchClusterUsingDryRun() throws Exception { ClusterControllerFactory factory = new ClusterControllerFactory(); TestLaunchClusterCommand launchCluster = new TestLaunchClusterCommand(factory); Map<String, File> keys = KeyPair.generateTemporaryFiles(); int rc = launchCluster.run(null, out, err, Lists.<String>newArrayList( "--cluster-name", "test-cluster-launch", "--state-store", "none", "--instance-templates", "1 zookeeper+cassandra, 1 zookeeper+elasticsearch", "--provider", "stub", "--identity", "dummy", "--private-key-file", keys.get("private").getAbsolutePath() )); MatcherAssert.assertThat(rc, is(0)); assertExecutedPhases(launchCluster.dryRun, "bootstrap", "configure", "start"); }
@Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionSet optionSet = parser.parse(args.toArray(new String[args.size()])); if (!optionSet.nonOptionArguments().isEmpty()) { printUsage(err); return -1; } try { ClusterSpec clusterSpec = getClusterSpec(optionSet); printProviderInfo(out, err, clusterSpec, optionSet); return run(in, out, err, clusterSpec); } catch (IllegalArgumentException e) { printErrorAndHelpHint(err, e); return -1; } }
LaunchClusterCommand extends AbstractClusterCommand { @Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionSet optionSet = parser.parse(args.toArray(new String[args.size()])); if (!optionSet.nonOptionArguments().isEmpty()) { printUsage(err); return -1; } try { ClusterSpec clusterSpec = getClusterSpec(optionSet); printProviderInfo(out, err, clusterSpec, optionSet); return run(in, out, err, clusterSpec); } catch (IllegalArgumentException e) { printErrorAndHelpHint(err, e); return -1; } } }
LaunchClusterCommand extends AbstractClusterCommand { @Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionSet optionSet = parser.parse(args.toArray(new String[args.size()])); if (!optionSet.nonOptionArguments().isEmpty()) { printUsage(err); return -1; } try { ClusterSpec clusterSpec = getClusterSpec(optionSet); printProviderInfo(out, err, clusterSpec, optionSet); return run(in, out, err, clusterSpec); } catch (IllegalArgumentException e) { printErrorAndHelpHint(err, e); return -1; } } LaunchClusterCommand();  LaunchClusterCommand(ClusterControllerFactory factory); }
LaunchClusterCommand extends AbstractClusterCommand { @Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionSet optionSet = parser.parse(args.toArray(new String[args.size()])); if (!optionSet.nonOptionArguments().isEmpty()) { printUsage(err); return -1; } try { ClusterSpec clusterSpec = getClusterSpec(optionSet); printProviderInfo(out, err, clusterSpec, optionSet); return run(in, out, err, clusterSpec); } catch (IllegalArgumentException e) { printErrorAndHelpHint(err, e); return -1; } } LaunchClusterCommand();  LaunchClusterCommand(ClusterControllerFactory factory); @Override int run(InputStream in, PrintStream out, PrintStream err,
                 List<String> args); int run(InputStream in, PrintStream out, PrintStream err, ClusterSpec clusterSpec); }
LaunchClusterCommand extends AbstractClusterCommand { @Override public int run(InputStream in, PrintStream out, PrintStream err, List<String> args) throws Exception { OptionSet optionSet = parser.parse(args.toArray(new String[args.size()])); if (!optionSet.nonOptionArguments().isEmpty()) { printUsage(err); return -1; } try { ClusterSpec clusterSpec = getClusterSpec(optionSet); printProviderInfo(out, err, clusterSpec, optionSet); return run(in, out, err, clusterSpec); } catch (IllegalArgumentException e) { printErrorAndHelpHint(err, e); return -1; } } LaunchClusterCommand();  LaunchClusterCommand(ClusterControllerFactory factory); @Override int run(InputStream in, PrintStream out, PrintStream err,
                 List<String> args); int run(InputStream in, PrintStream out, PrintStream err, ClusterSpec clusterSpec);  }