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