View Javadoc

1   package org.apache.maven.surefire.suite;
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 junit.framework.TestCase;
23  
24  /**
25   * @author Kristian Rosenvold
26   */
27  public class RunResultTest
28      extends TestCase
29  {
30      public void testGetAsString()
31          throws Exception
32      {
33  
34      }
35  
36      public void testFromString()
37          throws Exception
38      {
39        RunResult original = new RunResult( 4,3,2,1, true,false);
40          final String asString = original.getAsString();
41          final RunResult runResult = RunResult.fromString( asString );
42          verifySame( original, runResult );
43      }
44      public void testFromString2()
45          throws Exception
46      {
47        RunResult original = new RunResult( 5,6,7,8, false,true );
48          final String asString = original.getAsString();
49          final RunResult runResult = RunResult.fromString( asString );
50          verifySame( original, runResult );
51      }
52  
53      private void verifySame( RunResult original, RunResult runResult )
54      {
55          assertEquals( original.getCompletedCount(), runResult.getCompletedCount());
56          assertEquals( original.getErrors(), runResult.getErrors() );
57          assertEquals( original.getFailures(), runResult.getFailures());
58          assertEquals( original.getSkipped(), runResult.getSkipped());
59          assertEquals( original.isFailure(), runResult.isFailure());
60          assertEquals( original.isTimeout(), runResult.isTimeout());
61      }
62  }