@Test public void testAreCommandLineOptionsCorrect() throws FileNotFoundException, JSAPException, PMDException, URISyntaxException { assertFalse(FlexCPD.areCommandLineOptionsCorrect(new String[] {})); assertFalse( FlexCPD.areCommandLineOptionsCorrect( new String[] {"-y", "sourceDirectory", "-p", "outPutDirectory"})); assertTrue( FlexCPD.areCommandLineOptionsCorrect( new String[] {"-s", "sourceDirectory", "-o", "target", "-m", "50"})); assertTrue( FlexCPD.areCommandLineOptionsCorrect( new String[] {"-s", "sourceDirectory", "-o", "target"})); }
@Test public void testGetCommandLineValue() throws JSAPException { FlexCPD.areCommandLineOptionsCorrect( new String[] {"-s", "sourceDirectory", "-o", "target", "-m", "25"}); assertEquals("sourceDirectory", FlexCPD.getParameterValue(CommandLineOptions.SOURCE_DIRECTORY)); assertEquals("target", FlexCPD.getParameterValue(CpdCommandLineOptions.OUTPUT_FILE)); assertEquals("25", FlexCPD.getParameterValue(CpdCommandLineOptions.MINIMUM_TOKENS)); }