View Javadoc
1   package org.apache.maven.surefire.its;
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.ArrayList;
23  
24  import static org.junit.runners.Parameterized.Parameters;
25  
26  /**
27   * Test class for SUREFIRE-580, configuration parameter {@code skipAfterFailureCount}.
28   *
29   * @author <a href="mailto:tibordigana@apache.org">Tibor Digana (tibor17)</a>
30   * @since 2.19
31   */
32  public class FailFastJUnitIT
33      extends AbstractFailFastIT
34  {
35  
36      @Parameters(name = "{0}")
37      public static Iterable<Object[]> data()
38      {
39          /**
40           * reuseForks=false is not used because of race conditions and unpredictable commands received by
41           * MasterProcessReader, this feature has significant limitation.
42           */
43          ArrayList<Object[]> args = new ArrayList<Object[]>();
44          //                        description
45          //                                             profile
46          //                                                         forkCount,
47          //                                                         fail-fast-count,
48          //                                                         reuseForks
49          //                                                                               total
50          //                                                                                    failures
51          //                                                                                            errors
52          //                                                                                                  skipped
53          args.add( new Object[] { "junit4-oneFork-ff1", "junit4",   props( 1, 1, true ),  5,   0,      1,    4 } );
54          args.add( new Object[] { "junit47-oneFork-ff1", "junit47", props( 1, 1, true ),  5,   0,      1,    4 } );
55          args.add( new Object[] { "junit4-oneFork-ff2", "junit4",   props( 1, 2, true ),  5,   0,      2,    3 } );
56          args.add( new Object[] { "junit47-oneFork-ff2", "junit47", props( 1, 2, true ),  5,   0,      2,    3 } );
57          args.add( new Object[] { "junit4-twoForks-ff1", "junit4",  props( 2, 1, true ),  5,   0,      2,    3 } );
58          args.add( new Object[] { "junit47-twoForks-ff1", "junit47",props( 2, 1, true ),  5,   0,      2,    3 } );
59          args.add( new Object[] { "junit4-twoForks-ff2", "junit4",  props( 2, 2, true ),  5,   0,      2,    2 } );
60          args.add( new Object[] { "junit47-twoForks-ff2", "junit47",props( 2, 2, true ),  5,   0,      2,    2 } );
61          args.add( new Object[] { "junit4-oneFork-ff3", "junit4",   props( 1, 3, true ),  5,   0,      2,    0 } );
62          args.add( new Object[] { "junit47-oneFork-ff3", "junit47", props( 1, 3, true ),  5,   0,      2,    0 } );
63          args.add( new Object[] { "junit4-twoForks-ff3", "junit4",  props( 2, 3, true ),  5,   0,      2,    0 } );
64          args.add( new Object[] { "junit47-twoForks-ff3", "junit47",props( 2, 3, true ),  5,   0,      2,    0 } );
65          /*args.add( new Object[] { "junit4-twoForks-ff1x","junit4",  props( 2, 1, false ), 5,   0,      2,    3 } );
66          args.add( new Object[] { "junit47-twoForks-ff1x","junit47",props( 2, 1, false ), 5,   0,      2,    3 } );
67          args.add( new Object[] { "junit4-twoForks-ff2x","junit4",  props( 2, 2, false ), 5,   0,      2,    2 } );
68          args.add( new Object[] { "junit47-twoForks-ff2x","junit47",props( 2, 2, false ), 5,   0,      2,    2 } );*/
69          return args;
70      }
71  
72      @Override
73      protected String withProvider()
74      {
75          return "junit";
76      }
77  }