CommandLineProcessor implements Closeable { protected static void printHelp() { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp( Messages.getInstance().getString( "CommandLineProcessor.INFO_PRINTHELP_CMDLINE" ), Messages .getInstance().getString( "CommandLineProcessor.INFO_PRINTHELP_HEADER" ), options, Messages.getInstance() .getString( "CommandLineProcessor.INFO_PRINTHELP_FOOTER" ) ); } protected  CommandLineProcessor( String[] args ); static void main( String[] args ); static Exception getException(); @Override void close(); synchronized void setRepository( final IUnifiedRepository repository ); static String getErrorMessage();  }
@Test public void get002PrintHelpTest() throws IllegalAccessException { CommandLineProcessor.printHelp(); String help = CONSOLE_BUFFER.toString(); Options options = (Options) FieldUtils.readDeclaredStaticField( CommandLineProcessor.class, "options", true ); @SuppressWarnings( "unchecked" ) Collection<Option> optionCollection = options.getOptions(); for ( Option option : optionCollection ) { if ( !help.contains( "-" + option.getOpt() ) ) { fail(); } } }