void run() { try { cloudInfo.props.init(getPropertiesFile()); cloudInfo.locationId = options.valueOf(locationSpec); cloudInfo.verbose = options.has(verboseSpec); if (options.has(showLocationsSpec)) { cloudInfo.init(); cloudInfo.showLocations(); } else if (options.has(showHardwareSpec)) { cloudInfo.init(); cloudInfo.showHardware(); } else if (options.has(showImagesSpec)) { cloudInfo.init(); cloudInfo.showImages(); } else { CliUtils.printHelpAndExit(parser); } } finally { cloudInfo.shutdown(); } }
@Test(expected = CommandLineExitException.class) public void testPrintHelpAndExit_invalidOutputStream() { printHelpAndExit(parser, null); }
@Test(expected = ExitStatusZeroException.class) public void testPrintHelpAndExit() { printHelpAndExit(parser); }