66
66
@ API (status = STABLE , since = "1.0" )
67
67
public class LauncherFactory {
68
68
69
- private static final ServiceLoaderRegistry SERVICE_LOADER_REGISTRY = new ServiceLoaderRegistry ();
70
-
71
69
private LauncherFactory () {
72
70
/* no-op */
73
71
}
@@ -151,7 +149,7 @@ private static List<LauncherInterceptor> collectLauncherInterceptors(
151
149
LauncherConfigurationParameters configurationParameters ) {
152
150
if (configurationParameters .getBoolean (ENABLE_LAUNCHER_INTERCEPTORS ).orElse (false )) {
153
151
List <LauncherInterceptor > interceptors = new ArrayList <>();
154
- SERVICE_LOADER_REGISTRY .load (LauncherInterceptor .class ).forEach (interceptors ::add );
152
+ ServiceLoaderRegistry .load (LauncherInterceptor .class ).forEach (interceptors ::add );
155
153
return interceptors ;
156
154
}
157
155
return emptyList ();
@@ -169,7 +167,7 @@ private static Set<TestEngine> collectTestEngines(LauncherConfig config) {
169
167
private static LauncherSessionListener createLauncherSessionListener (LauncherConfig config ) {
170
168
ListenerRegistry <LauncherSessionListener > listenerRegistry = ListenerRegistry .forLauncherSessionListeners ();
171
169
if (config .isLauncherSessionListenerAutoRegistrationEnabled ()) {
172
- SERVICE_LOADER_REGISTRY .load (LauncherSessionListener .class ).forEach (listenerRegistry ::add );
170
+ ServiceLoaderRegistry .load (LauncherSessionListener .class ).forEach (listenerRegistry ::add );
173
171
}
174
172
config .getAdditionalLauncherSessionListeners ().forEach (listenerRegistry ::add );
175
173
return listenerRegistry .getCompositeListener ();
@@ -178,15 +176,15 @@ private static LauncherSessionListener createLauncherSessionListener(LauncherCon
178
176
private static List <PostDiscoveryFilter > collectPostDiscoveryFilters (LauncherConfig config ) {
179
177
List <PostDiscoveryFilter > filters = new ArrayList <>();
180
178
if (config .isPostDiscoveryFilterAutoRegistrationEnabled ()) {
181
- SERVICE_LOADER_REGISTRY .load (PostDiscoveryFilter .class ).forEach (filters ::add );
179
+ ServiceLoaderRegistry .load (PostDiscoveryFilter .class ).forEach (filters ::add );
182
180
}
183
181
filters .addAll (config .getAdditionalPostDiscoveryFilters ());
184
182
return filters ;
185
183
}
186
184
187
185
private static void registerLauncherDiscoveryListeners (LauncherConfig config , Launcher launcher ) {
188
186
if (config .isLauncherDiscoveryListenerAutoRegistrationEnabled ()) {
189
- SERVICE_LOADER_REGISTRY .load (LauncherDiscoveryListener .class ).forEach (
187
+ ServiceLoaderRegistry .load (LauncherDiscoveryListener .class ).forEach (
190
188
launcher ::registerLauncherDiscoveryListeners );
191
189
}
192
190
config .getAdditionalLauncherDiscoveryListeners ().forEach (launcher ::registerLauncherDiscoveryListeners );
@@ -203,7 +201,7 @@ private static void registerTestExecutionListeners(LauncherConfig config, Launch
203
201
204
202
private static Stream <TestExecutionListener > loadAndFilterTestExecutionListeners (
205
203
ConfigurationParameters configurationParameters ) {
206
- Iterable <TestExecutionListener > listeners = SERVICE_LOADER_REGISTRY .load (TestExecutionListener .class );
204
+ Iterable <TestExecutionListener > listeners = ServiceLoaderRegistry .load (TestExecutionListener .class );
207
205
String deactivatedListenersPattern = configurationParameters .get (
208
206
DEACTIVATE_LISTENERS_PATTERN_PROPERTY_NAME ).orElse (null );
209
207
// @formatter:off
0 commit comments