1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.plugin.surefire.booterclient;
20
21 import java.io.File;
22
23 import org.apache.maven.plugin.surefire.StartupReportConfiguration;
24 import org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter;
25 import org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter;
26 import org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter;
27 import org.apache.maven.plugin.surefire.log.api.NullConsoleLogger;
28 import org.apache.maven.plugin.surefire.report.DefaultReporterFactory;
29 import org.apache.maven.surefire.api.report.TestOutputReportEntry;
30 import org.apache.maven.surefire.api.report.TestReportListener;
31
32
33
34
35
36
37 public class TestSetMockReporterFactory extends DefaultReporterFactory {
38 public TestSetMockReporterFactory() {
39 super(defaultValue(), new NullConsoleLogger());
40 }
41
42 @Override
43 public TestReportListener<TestOutputReportEntry> createTestReportListener() {
44 return new MockReporter();
45 }
46
47
48
49
50
51
52 private static StartupReportConfiguration defaultValue() {
53 File target = new File("./target");
54 File statisticsFile = new File(target, "TESTHASH");
55 return new StartupReportConfiguration(
56 true,
57 true,
58 "PLAIN",
59 false,
60 target,
61 false,
62 null,
63 statisticsFile,
64 false,
65 0,
66 null,
67 null,
68 true,
69 new SurefireStatelessReporter(),
70 new SurefireConsoleOutputReporter(),
71 new SurefireStatelessTestsetInfoReporter());
72 }
73 }