View Javadoc

1   package org.apache.maven.surefire.its.jiras;
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 org.apache.maven.it.VerificationException;
23  import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
24  
25  import org.junit.BeforeClass;
26  import org.junit.Test;
27  
28  /**
29   * SUREFIRE-613 Asserts proper test counts when running in parallel
30   *
31   * @author Kristian Rosenvold
32   */
33  public class Surefire141PluggableProvidersIT
34      extends SurefireJUnit4IntegrationTestCase
35  {
36      @BeforeClass
37      public static void installProvider()
38          throws VerificationException
39      {
40          unpack( Surefire141PluggableProvidersIT.class, "surefire-141-pluggableproviders-provider", "prov" ).executeInstall();
41      }
42  
43      @Test
44      public void pluggableProviderPresent()
45          throws Exception
46      {
47          unpack( "surefire-141-pluggableproviders" ).maven().showExceptionMessages().executeTest().verifyTextInLog(
48              "Using configured provider org.apache.maven.surefire.testprovider.TestProvider" ).verifyTextInLog(
49              "Using configured provider org.apache.maven.surefire.junit.JUnit3Provider" ).verifyErrorFreeLog();
50      }
51  
52      @Test
53      public void invokeRuntimeException()
54          throws Exception
55      {
56          unpack( "surefire-141-pluggableproviders" ).sysProp( "invokeCrash",
57                                                               "runtimeException" ).maven().withFailure().executeTest().verifyTextInLog(
58              "Let's fail with a runtimeException" );
59      }
60  
61      @Test
62      public void invokeReporterException()
63          throws Exception
64      {
65          unpack( "surefire-141-pluggableproviders" ).sysProp( "invokeCrash",
66                                                               "reporterException" ).maven().withFailure().executeTest().verifyTextInLog(
67              "Let's fail with a reporterexception" );
68      }
69  
70      @Test
71      public void constructorReuntimeException()
72          throws Exception
73      {
74          unpack( "surefire-141-pluggableproviders" ).sysProp( "constructorCrash",
75                                                               "runtimeException" ).maven().withFailure().executeTest().verifyTextInLog(
76              "Let's fail with a runtimeException" );
77      }
78  
79  }