1   package org.apache.maven.plugins.surefire.report;
2   
3   /*
4    * Copyright 2001-2005 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * 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, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import junit.framework.TestCase;
20  
21  import java.util.ArrayList;
22  import java.util.List;
23  
24  public class ReportTestSuiteTest
25      extends TestCase
26  {
27      private ReportTestSuite tSuite;
28  
29      protected void setUp()
30          throws Exception
31      {
32          super.setUp();
33  
34          tSuite = new ReportTestSuite();
35      }
36  
37      public void testSetTestCases()
38      {
39          ReportTestCase tCase = new ReportTestCase();
40  
41          List tCaseList = new ArrayList();
42  
43          tCaseList.add( tCase );
44  
45          tSuite.setTestCases( tCaseList );
46  
47          assertEquals( tCase, tSuite.getTestCases().get( 0 ) );
48      }
49  
50      public void testSetNumberdOfErrors()
51      {
52          tSuite.setNumberOfErrors( 9 );
53  
54          assertEquals( 9, tSuite.getNumberOfErrors() );
55      }
56  
57      public void testSetNumberOfFailures()
58      {
59          tSuite.setNumberOfFailures( 10 );
60  
61          assertEquals( 10, tSuite.getNumberOfFailures() );
62      }
63  
64      public void testSetNumberOfSkipped()
65      {
66          tSuite.setNumberOfSkipped( 5 );
67  
68          assertEquals( 5, tSuite.getNumberOfSkipped() );
69      }
70      
71      public void testSetNumberOfTests()
72      {
73          tSuite.setNumberOfTests( 11 );
74  
75          assertEquals( 11, tSuite.getNumberOfTests() );
76      }
77  
78      public void testSetName()
79      {
80          tSuite.setName( "Suite Name" );
81  
82          assertEquals( "Suite Name", tSuite.getName() );
83      }
84  
85      public void testSetPackageName()
86      {
87          tSuite.setPackageName( "Suite Package Name" );
88  
89          assertEquals( "Suite Package Name", tSuite.getPackageName() );
90      }
91  
92      public void testSetTimeElapsed()
93      {
94          tSuite.setTimeElapsed( .06f );
95  
96          assertEquals( .06f, tSuite.getTimeElapsed(), 0.0 );
97      }
98  }