@Test public void testGetScript() throws Exception { final List<String> source = Collections.singletonList("whoooooo test data!"); final String filename = "you have FAILED ME for the last time.prg"; final CclScript script = mock(CclScript.class); when(textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), source)) .thenReturn(script); assertThat(mojo.getScript(filename, source)).isEqualTo(script); }
CclScript getScript(final String filename, final List<String> sourceCode) throws MavenReportException { try { return textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), sourceCode); } catch (final CDocParsingException e) { throw new MavenReportException("Failed to parse script " + filename, e); } }
CDocReportMojo extends AbstractMavenReport { CclScript getScript(final String filename, final List<String> sourceCode) throws MavenReportException { try { return textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), sourceCode); } catch (final CDocParsingException e) { throw new MavenReportException("Failed to parse script " + filename, e); } } }
CDocReportMojo extends AbstractMavenReport { CclScript getScript(final String filename, final List<String> sourceCode) throws MavenReportException { try { return textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), sourceCode); } catch (final CDocParsingException e) { throw new MavenReportException("Failed to parse script " + filename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); }
CDocReportMojo extends AbstractMavenReport { CclScript getScript(final String filename, final List<String> sourceCode) throws MavenReportException { try { return textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), sourceCode); } catch (final CDocParsingException e) { throw new MavenReportException("Failed to parse script " + filename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); @Override boolean canGenerateReport(); @Override String getDescription(final Locale locale); @Override String getName(final Locale locale); @Override String getOutputName(); @Override boolean isExternalReport(); }
CDocReportMojo extends AbstractMavenReport { CclScript getScript(final String filename, final List<String> sourceCode) throws MavenReportException { try { return textParser.parseCclScript(filename.substring(0, filename.lastIndexOf('.')).toLowerCase(Locale.US), sourceCode); } catch (final CDocParsingException e) { throw new MavenReportException("Failed to parse script " + filename, e); } } CDocReportMojo();  CDocReportMojo(final TextParser textParser, final ScriptExecutionDetailsParser detailsParser); @Override boolean canGenerateReport(); @Override String getDescription(final Locale locale); @Override String getName(final Locale locale); @Override String getOutputName(); @Override boolean isExternalReport();  }