View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.plugins.surefire.report;
20  
21  import java.util.ResourceBundle;
22  
23  /**
24   * Surefire Resource Bundle.
25   *
26   * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
27   */
28  public abstract class LocalizedProperties {
29      private final ResourceBundle bundle;
30  
31      protected LocalizedProperties(ResourceBundle bundle) {
32          this.bundle = bundle;
33      }
34  
35      public abstract String getReportName();
36  
37      public abstract String getReportDescription();
38  
39      public abstract String getReportHeader();
40  
41      protected final String toLocalizedValue(String key) {
42          return bundle.getString(key);
43      }
44  
45      public String getReportLabelSummary() {
46          return toLocalizedValue("report.surefire.label.summary");
47      }
48  
49      public String getReportLabelTests() {
50          return toLocalizedValue("report.surefire.label.tests");
51      }
52  
53      public String getReportLabelErrors() {
54          return toLocalizedValue("report.surefire.label.errors");
55      }
56  
57      public String getReportLabelFailures() {
58          return toLocalizedValue("report.surefire.label.failures");
59      }
60  
61      public String getReportLabelSkipped() {
62          return toLocalizedValue("report.surefire.label.skipped");
63      }
64  
65      public String getReportLabelSuccessRate() {
66          return toLocalizedValue("report.surefire.label.successrate");
67      }
68  
69      public String getReportLabelTime() {
70          return toLocalizedValue("report.surefire.label.time");
71      }
72  
73      public String getReportLabelPackageList() {
74          return toLocalizedValue("report.surefire.label.packagelist");
75      }
76  
77      public String getReportLabelPackage() {
78          return toLocalizedValue("report.surefire.label.package");
79      }
80  
81      public String getReportLabelClass() {
82          return toLocalizedValue("report.surefire.label.class");
83      }
84  
85      public String getReportLabelTestCases() {
86          return toLocalizedValue("report.surefire.label.testcases");
87      }
88  
89      public String getReportLabelFailureDetails() {
90          return toLocalizedValue("report.surefire.label.failuredetails");
91      }
92  
93      public String getReportTextNode1() {
94          return toLocalizedValue("report.surefire.text.note1");
95      }
96  
97      public String getReportTextNode2() {
98          return toLocalizedValue("report.surefire.text.note2");
99      }
100 }