1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.surefire.its.jiras;
20
21 import java.util.Collection;
22
23 import org.apache.maven.surefire.its.fixture.OutputValidator;
24 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
25 import org.apache.maven.surefire.its.fixture.SurefireLauncher;
26 import org.junit.Test;
27
28 import static org.junit.Assert.assertFalse;
29
30
31
32
33 public class Surefire1004RunTestFromDependencyJarsTypeAndClassifierIT extends SurefireJUnit4IntegrationTestCase {
34
35 @Test
36 public void shouldScanAndRunTestsInDependencyJars() throws Exception {
37 SurefireLauncher launcher = unpack("surefire-1004-RunTestFromDependencyJarsTypeAndClassifier");
38 launcher.addGoal("test").addGoal("install");
39 OutputValidator wholeExecValidator = launcher.executeCurrentGoals();
40 wholeExecValidator.verifyErrorFreeLog();
41
42 OutputValidator module1 = launcher.getSubProjectValidator("surefire-1004-module1");
43 module1.assertTestSuiteResults(3, 0, 0, 0);
44
45
46 wholeExecValidator.verifyTextInLog("Running org.acme.tests.TestA");
47 wholeExecValidator.verifyTextInLog("Running org.acme.classifiedtests.ClassifiedTestA");
48
49 wholeExecValidator.verifyTextInLog("Running org.acme.tests.ClasspathTest");
50
51 Collection<String> logLines = wholeExecValidator.loadLogLines();
52 assertFalse(logLines.contains("org.acme.othertests.OtherTestA"));
53 assertFalse(logLines.contains("org.acme.tests.TestB"));
54 }
55 }