##### Coverage Report - org.jbehave.core.reporters.FreemarkerViewGenerator

Classes in this File | Line Coverage | Branch Coverage | Complexity
FreemarkerViewGenerator |
100% | 15/15
N/A | N/A
| 1.0;1

1 |  |
     package org.jbehave.core.reporters;
2 |  |
3 |  |
     import java.util.Properties;
4 |  |
5 |  |
     import org.jbehave.core.io.StoryNameResolver;
6 |  |
     import org.jbehave.core.io.UnderscoredToCapitalized;
7 |  |
8 |  |
     /**
9 |  |
      * <p>
10 |  |
      * Freemarker-based {@link ViewGenerator}, which uses the configured FTL
11 |  |
      * templates for the views. The default view properties are overridable via the
12 |  |
      * method {@link Properties} parameter. To override, specify the path to the new
13 |  |
      * template under the appropriate key:
14 |  |
      * <p>
15 |  |
      * The view generator provides the following default properties:
16 |  |
      *
17 |  |
      * <pre>
18 |  |
      * &quot;views&quot;: &quot;ftl/jbehave-views.ftl&quot;
19 |  |
      * &quot;maps&quot;: &quot;ftl/jbehave-maps.ftl&quot;
20 |  |
      * &quot;navigator&quot;: &quot;ftl/jbehave-navigator.ftl&quot;
21 |  |
      * &quot;reports&quot;: &quot;ftl/jbehave-reports-with-totals.ftl&quot;
22 |  |
      * &quot;decorated&quot;: &quot;ftl/jbehave-report-decorated.ftl&quot;
23 |  |
      * &quot;nonDecorated&quot;: &quot;ftl/jbehave-report-non-decorated.ftl&quot;
24 |  |
      * &quot;decorateNonHtml&quot;: &quot;true&quot;
25 |  |
      * &quot;defaultFormats&quot;: &quot;stats&quot;
26 |  |
      * &quot;viewDirectory&quot;: &quot;view&quot;
27 |  |
      * </pre>
28 |  |
      *
29 |  |
      * </p>
30 |  |
      *
31 |  |
      * @author Mauro Talevi
32 |  |
      */
33 |  |
     public class FreemarkerViewGenerator extends TemplateableViewGenerator {
34 |  |
35 |  |
         public FreemarkerViewGenerator() {
36 | 1005 |
             this(new UnderscoredToCapitalized());
37 | 1005 |
         }
38 |  |
39 |  |
         public FreemarkerViewGenerator(StoryNameResolver nameResolver) {
40 | 1005 |
             super(nameResolver, new FreemarkerProcessor());
41 | 1005 |
         }
42 |  |
43 |  |
         public Properties defaultViewProperties() {
44 | 364 |
             Properties properties = new Properties();
45 | 364 |
             properties.setProperty("views", "ftl/jbehave-views.ftl");
46 | 364 |
             properties.setProperty("maps", "ftl/jbehave-maps.ftl");
47 | 364 |
             properties.setProperty("navigator", "ftl/jbehave-navigator.ftl");
48 | 364 |
             properties.setProperty("reports", "ftl/jbehave-reports-with-totals.ftl");
49 | 364 |
             properties.setProperty("decorated", "ftl/jbehave-report-decorated.ftl");
50 | 364 |
             properties.setProperty("nonDecorated", "ftl/jbehave-report-non-decorated.ftl");
51 | 364 |
             properties.setProperty("decorateNonHtml", "true");
52 | 364 |
             properties.setProperty("defaultFormats", "stats");
53 | 364 |
             properties.setProperty("viewDirectory", "view");
54 | 364 |
             return properties;
55 |  |
         }
56 |  |
57 |  |
     }