@Test public void testGenerateNullCssDirectory() throws Exception { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { generator.generate(project, documentation, null, writer); }); assertThat(e.getMessage()).isEqualTo("CSS directory cannot be null."); }
public void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory, final Writer destination) throws MavenReportException { if (project == null) { throw new IllegalArgumentException("Maven project cannot be null."); } if (documentation == null) { throw new IllegalArgumentException("Documentation cannot be null."); } if (cssDirectory == null) { throw new IllegalArgumentException("CSS directory cannot be null."); } if (destination == null) { throw new IllegalArgumentException("Destination writer cannot be null."); } final VelocityContext context = new VelocityContext(); context.put("projectName", project.getName()); context.put("projectVersion", project.getVersion()); context.put("docs", documentation); try { context.put("cssDirectory", cssDirectory.toURI().toURL().toExternalForm()); } catch (final MalformedURLException e) { throw new MavenReportException("Failed to convert CSS directory to URL.", e); } final VelocityEngine engine = getEngine(); try { final Template template = engine.getTemplate("/velocity/script-doc-summary.vm", "utf-8"); template.merge(context, destination); } catch (final Exception e) { throw new MavenReportException("Failed to initialize and merge template.", e); } }
SummaryGenerator extends AbstractVelocityGenerator { public void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory, final Writer destination) throws MavenReportException { if (project == null) { throw new IllegalArgumentException("Maven project cannot be null."); } if (documentation == null) { throw new IllegalArgumentException("Documentation cannot be null."); } if (cssDirectory == null) { throw new IllegalArgumentException("CSS directory cannot be null."); } if (destination == null) { throw new IllegalArgumentException("Destination writer cannot be null."); } final VelocityContext context = new VelocityContext(); context.put("projectName", project.getName()); context.put("projectVersion", project.getVersion()); context.put("docs", documentation); try { context.put("cssDirectory", cssDirectory.toURI().toURL().toExternalForm()); } catch (final MalformedURLException e) { throw new MavenReportException("Failed to convert CSS directory to URL.", e); } final VelocityEngine engine = getEngine(); try { final Template template = engine.getTemplate("/velocity/script-doc-summary.vm", "utf-8"); template.merge(context, destination); } catch (final Exception e) { throw new MavenReportException("Failed to initialize and merge template.", e); } } }
SummaryGenerator extends AbstractVelocityGenerator { public void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory, final Writer destination) throws MavenReportException { if (project == null) { throw new IllegalArgumentException("Maven project cannot be null."); } if (documentation == null) { throw new IllegalArgumentException("Documentation cannot be null."); } if (cssDirectory == null) { throw new IllegalArgumentException("CSS directory cannot be null."); } if (destination == null) { throw new IllegalArgumentException("Destination writer cannot be null."); } final VelocityContext context = new VelocityContext(); context.put("projectName", project.getName()); context.put("projectVersion", project.getVersion()); context.put("docs", documentation); try { context.put("cssDirectory", cssDirectory.toURI().toURL().toExternalForm()); } catch (final MalformedURLException e) { throw new MavenReportException("Failed to convert CSS directory to URL.", e); } final VelocityEngine engine = getEngine(); try { final Template template = engine.getTemplate("/velocity/script-doc-summary.vm", "utf-8"); template.merge(context, destination); } catch (final Exception e) { throw new MavenReportException("Failed to initialize and merge template.", e); } }  }
SummaryGenerator extends AbstractVelocityGenerator { public void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory, final Writer destination) throws MavenReportException { if (project == null) { throw new IllegalArgumentException("Maven project cannot be null."); } if (documentation == null) { throw new IllegalArgumentException("Documentation cannot be null."); } if (cssDirectory == null) { throw new IllegalArgumentException("CSS directory cannot be null."); } if (destination == null) { throw new IllegalArgumentException("Destination writer cannot be null."); } final VelocityContext context = new VelocityContext(); context.put("projectName", project.getName()); context.put("projectVersion", project.getVersion()); context.put("docs", documentation); try { context.put("cssDirectory", cssDirectory.toURI().toURL().toExternalForm()); } catch (final MalformedURLException e) { throw new MavenReportException("Failed to convert CSS directory to URL.", e); } final VelocityEngine engine = getEngine(); try { final Template template = engine.getTemplate("/velocity/script-doc-summary.vm", "utf-8"); template.merge(context, destination); } catch (final Exception e) { throw new MavenReportException("Failed to initialize and merge template.", e); } }  void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory,
            final Writer destination); }
SummaryGenerator extends AbstractVelocityGenerator { public void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory, final Writer destination) throws MavenReportException { if (project == null) { throw new IllegalArgumentException("Maven project cannot be null."); } if (documentation == null) { throw new IllegalArgumentException("Documentation cannot be null."); } if (cssDirectory == null) { throw new IllegalArgumentException("CSS directory cannot be null."); } if (destination == null) { throw new IllegalArgumentException("Destination writer cannot be null."); } final VelocityContext context = new VelocityContext(); context.put("projectName", project.getName()); context.put("projectVersion", project.getVersion()); context.put("docs", documentation); try { context.put("cssDirectory", cssDirectory.toURI().toURL().toExternalForm()); } catch (final MalformedURLException e) { throw new MavenReportException("Failed to convert CSS directory to URL.", e); } final VelocityEngine engine = getEngine(); try { final Template template = engine.getTemplate("/velocity/script-doc-summary.vm", "utf-8"); template.merge(context, destination); } catch (final Exception e) { throw new MavenReportException("Failed to initialize and merge template.", e); } }  void generate(final MavenProject project, final List<Documentation> documentation, final File cssDirectory,
            final Writer destination);  }