View Javadoc

1   /*
2    * Copyright 2010-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package de.smartics.testdoc.maven.export.sink;
17  
18  import org.apache.maven.doxia.sink.Sink;
19  
20  import de.smartics.maven.util.report.MessageHelper;
21  import de.smartics.testdoc.core.doc.ScenarioTestDoc;
22  import de.smartics.testdoc.core.doc.TestMethodDoc;
23  import de.smartics.testdoc.core.doc.Type;
24  
25  /**
26   * Helper to render links to other reports for scenario information.
27   *
28   * @author <a href="mailto:robert.reiner@smartics.de">Robert Reiner</a>
29   * @version $Revision:591 $
30   */
31  class ScenarioLinkRenderer extends AbstractLinkRenderer
32  {
33    // ********************************* Fields *********************************
34  
35    // --- constants ------------------------------------------------------------
36  
37    // --- members --------------------------------------------------------------
38  
39    /**
40     * The scenario to link to.
41     */
42    private final ScenarioTestDoc scenario;
43  
44    // ****************************** Initializer *******************************
45  
46    // ****************************** Constructors ******************************
47  
48    /**
49     * Default constructor.
50     *
51     * @param sink the sink to write to.
52     * @param messages the resource bundles with messages to display as labels in
53     *          the generated report.
54     * @param scenario the scenario to link to.
55     * @see de.smartics.testdoc.maven.export.sink.AbstractLinkRenderer#AbstractLinkRenderer(org.apache.maven.doxia.sink.Sink,
56     *      de.smartics.maven.util.report.MessageHelper)
57     */
58    ScenarioLinkRenderer(final Sink sink, final MessageHelper messages,
59        final ScenarioTestDoc scenario)
60    {
61      super(sink, messages);
62      this.scenario = scenario;
63    }
64  
65    // ****************************** Inner Classes *****************************
66  
67    // ********************************* Methods ********************************
68  
69    // --- init -----------------------------------------------------------------
70  
71    // --- get&set --------------------------------------------------------------
72  
73    // --- business -------------------------------------------------------------
74  
75    Type getType()
76    {
77      final Type testCase = scenario.getTestCaseType();
78      return testCase;
79    }
80  
81    TestMethodDoc getTestMethod()
82    {
83      return scenario.getTestMethod();
84    }
85  
86    // --- object basics --------------------------------------------------------
87  
88  }