-
Notifications
You must be signed in to change notification settings - Fork 338
Expand file tree
/
Copy pathNoOpTestEventsHandler.java
More file actions
130 lines (114 loc) · 3.83 KB
/
NoOpTestEventsHandler.java
File metadata and controls
130 lines (114 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package datadog.trace.civisibility.events;
import datadog.trace.api.civisibility.DDTest;
import datadog.trace.api.civisibility.DDTestSuite;
import datadog.trace.api.civisibility.config.LibraryCapability;
import datadog.trace.api.civisibility.config.TestIdentifier;
import datadog.trace.api.civisibility.config.TestSourceData;
import datadog.trace.api.civisibility.events.TestEventsHandler;
import datadog.trace.api.civisibility.execution.TestExecutionHistory;
import datadog.trace.api.civisibility.execution.TestExecutionPolicy;
import datadog.trace.api.civisibility.telemetry.tag.SkipReason;
import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation;
import datadog.trace.bootstrap.ContextStore;
import datadog.trace.civisibility.execution.Regular;
import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public class NoOpTestEventsHandler<SuiteKey, TestKey>
implements TestEventsHandler<SuiteKey, TestKey> {
@Override
public void onTestSuiteStart(
SuiteKey descriptor,
String testSuiteName,
@Nullable String testFramework,
@Nullable String testFrameworkVersion,
@Nullable Class<?> testClass,
@Nullable Collection<String> categories,
boolean parallelized,
TestFrameworkInstrumentation instrumentation,
@Nullable Long startTime) {
// do nothing
}
@Override
public void onTestSuiteSkip(SuiteKey descriptor, @Nullable String reason) {
// do nothing
}
@Override
public void onTestSuiteFailure(SuiteKey descriptor, @Nullable Throwable throwable) {
// do nothing
}
@Override
public void onTestSuiteFinish(SuiteKey descriptor, @Nullable Long endTime) {
// do nothing
}
@Override
public void onTestStart(
SuiteKey suiteDescriptor,
TestKey descriptor,
String testName,
@Nullable String testFramework,
@Nullable String testFrameworkVersion,
@Nullable String testParameters,
@Nullable Collection<String> categories,
@Nonnull TestSourceData testSourceData,
@Nullable Long startTime,
@Nullable TestExecutionHistory testExecutionHistory) {
// do nothing
}
@Override
public void onTestSkip(TestKey descriptor, @Nullable String reason) {
// do nothing
}
@Override
public void onTestFailure(TestKey descriptor, @Nullable Throwable throwable) {
// do nothing
}
@Override
public void onTestFinish(
TestKey descriptor, @Nullable Long endTime, @Nullable TestExecutionHistory executionHistory) {
// do nothing
}
@Override
public void onTestIgnore(
SuiteKey suiteDescriptor,
TestKey testDescriptor,
String testName,
@Nullable String testFramework,
@Nullable String testFrameworkVersion,
@Nullable String testParameters,
@Nullable Collection<String> categories,
@Nonnull TestSourceData testSourceData,
@Nullable String reason,
@Nullable TestExecutionHistory testExecutionHistory) {
// do nothing
}
@Override
public SkipReason skipReason(TestIdentifier test) {
return null;
}
@Nonnull
@Override
public TestExecutionPolicy executionPolicy(
TestIdentifier test, TestSourceData source, Collection<String> testTags) {
return Regular.INSTANCE;
}
@Override
public int executionPriority(
@Nullable TestIdentifier test, @Nonnull TestSourceData testSourceData) {
return 0;
}
@Override
public void close() {
// do nothing
}
public static final class Factory implements TestEventsHandler.Factory {
@Override
public <SuiteKey, TestKey> TestEventsHandler<SuiteKey, TestKey> create(
String component,
@Nullable ContextStore<SuiteKey, DDTestSuite> suiteStore,
@Nullable ContextStore<TestKey, DDTest> testStore,
Collection<LibraryCapability> capabilities) {
return new NoOpTestEventsHandler<>();
}
}
}