Search in sources :

Example 11 with ViewGenerator

use of org.jbehave.core.reporters.ViewGenerator in project jbehave-core by jbehave.

the class Embedder method generateReportsView.

public void generateReportsView(File outputDirectory, List<String> formats, Properties viewResources) {
    if (embedderControls().skip()) {
        embedderMonitor.reportsViewNotGenerated();
        return;
    }
    ViewGenerator viewGenerator = configuration().viewGenerator();
    try {
        embedderMonitor.generatingReportsView(outputDirectory, formats, viewResources);
        viewGenerator.generateReportsView(outputDirectory, formats, viewResources);
    } catch (RuntimeException e) {
        embedderMonitor.reportsViewGenerationFailed(outputDirectory, formats, viewResources, e);
        throw new ViewGenerationFailed(outputDirectory, formats, viewResources, e);
    }
    ReportsCount count = viewGenerator.getReportsCount();
    embedderMonitor.reportsViewGenerated(count);
    handleFailures(count);
}
Also used : ViewGenerator(org.jbehave.core.reporters.ViewGenerator) ReportsCount(org.jbehave.core.reporters.ReportsCount)

Aggregations

ViewGenerator (org.jbehave.core.reporters.ViewGenerator)11 File (java.io.File)10 Properties (java.util.Properties)10 ByteArrayOutputStream (java.io.ByteArrayOutputStream)9 OutputStream (java.io.OutputStream)9 PrintStream (java.io.PrintStream)9 Matchers.containsString (org.hamcrest.Matchers.containsString)9 InjectableEmbedder (org.jbehave.core.InjectableEmbedder)9 UsingEmbedder (org.jbehave.core.annotations.UsingEmbedder)9 Test (org.junit.Test)9 ReportsCount (org.jbehave.core.reporters.ReportsCount)8 StoryReporterBuilder (org.jbehave.core.reporters.StoryReporterBuilder)2 Configuration (org.jbehave.core.configuration.Configuration)1 MostUsefulConfiguration (org.jbehave.core.configuration.MostUsefulConfiguration)1 EmbedderFailureStrategy (org.jbehave.core.embedder.Embedder.EmbedderFailureStrategy)1 FailingUponPendingStep (org.jbehave.core.failures.FailingUponPendingStep)1