FlexPMD { static boolean areCommandLineOptionsCorrect( final String[] args ) throws JSAPException { final JSAP jsap = new JSAP(); config = parseCommandLineArguments( args, jsap ); if ( !config.success() ) { LOGGER.log( Level.SEVERE, "Usage: java " + FlexPMD.class.getName() + " " + jsap.getUsage() ); } return config.success(); } private  FlexPMD(); static void main( final String[] args );  }
@Test public void testAreCommandLineOptionsCorrect() throws FileNotFoundException, JSAPException, PMDException, URISyntaxException { assertFalse( FlexPMD.areCommandLineOptionsCorrect( new String[] {} ) ); assertFalse( FlexPMD.areCommandLineOptionsCorrect( new String[] { "-y", "sourceDirectory", "-p", "outPutDirectory" } ) ); assertTrue( FlexPMD.areCommandLineOptionsCorrect( new String[] { "-s", "sourceDirectory", "-o", "target", "-r", "valid.xml" } ) ); assertTrue( FlexPMD.areCommandLineOptionsCorrect( new String[] { "-s", "sourceDirectory", "-o", "target" } ) ); }