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.List;
22
23 import org.apache.maven.plugins.surefire.report.ReportTestSuite;
24 import org.apache.maven.surefire.its.fixture.OutputValidator;
25 import org.apache.maven.surefire.its.fixture.SurefireJUnit4IntegrationTestCase;
26 import org.junit.Test;
27
28 import static org.apache.maven.surefire.its.fixture.HelperAssertions.extractReports;
29 import static org.hamcrest.MatcherAssert.assertThat;
30 import static org.hamcrest.Matchers.greaterThanOrEqualTo;
31 import static org.hamcrest.Matchers.hasSize;
32 import static org.hamcrest.Matchers.is;
33
34
35
36
37
38
39 @SuppressWarnings("checkstyle:magicnumber")
40 public class Surefire1144XmlRunTimeIT extends SurefireJUnit4IntegrationTestCase {
41 @Test
42 public void testXmlRunTime() {
43 OutputValidator outputValidator =
44 unpack("/surefire-1144-xml-runtime").forkOnce().executeTest();
45
46 List<ReportTestSuite> reports = extractReports(outputValidator.getBaseDir());
47 assertThat(reports, hasSize(1));
48
49 ReportTestSuite report = reports.get(0);
50 float xmlTime = report.getTimeElapsed();
51
52 assertThat(xmlTime, is(greaterThanOrEqualTo(1.6f)));
53 outputValidator.verifyTextInLog(Float.toString(xmlTime));
54 }
55 }