1 package org.apache.maven.surefire.its.jiras;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
30
31
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 }