public ServiceLoader<AutomaticDeployment> find() { return ServiceLoader.load(AutomaticDeployment.class); } };
public ServiceLoader<AutomaticDeployment> find() { return ServiceLoader.load(AutomaticDeployment.class); } };
/** * Creates a new service loader for the given service type, using the current * thread's context class loader. * <p> * An invocation of this convenience method of the form * <p> * {@code ServiceLoader.load(service)</code>} * <p> * is equivalent to * <p> * <code>ServiceLoader.load(service, * Thread.currentThread().getContextClassLoader())</code> * * @param service * The interface or abstract class representing the service * * @return A new service loader */ public static <S> ServiceLoader<S> load(Class<S> service) { return load(service, Thread.currentThread().getContextClassLoader()); }
/** * Creates a new service loader for the given service type, using the current * thread's context class loader. * <p> * An invocation of this convenience method of the form * <p> * {@code ServiceLoader.load(service)</code>} * <p> * is equivalent to * <p> * <code>ServiceLoader.load(service, * Thread.currentThread().getContextClassLoader())</code> * * @param service * The interface or abstract class representing the service * * @return A new service loader */ public static <S> ServiceLoader<S> load(Class<S> service) { return load(service, Thread.currentThread().getContextClassLoader()); }
ArquillianConfig(Set<String> testClasses, String deploymentUnitName) { this.serviceName = getServiceName(deploymentUnitName); this.testClasses.addAll(testClasses); for(ArquillianConfigServiceCustomizer customizer : ServiceLoader.load(ArquillianConfigServiceCustomizer.class)) { serviceCustomizers.add(customizer); } }
ArquillianConfig(Set<String> testClasses, String deploymentUnitName) { this.serviceName = getServiceName(deploymentUnitName); this.testClasses.addAll(testClasses); for(ArquillianConfigServiceCustomizer customizer : ServiceLoader.load(ArquillianConfigServiceCustomizer.class)) { serviceCustomizers.add(customizer); } }
/** * Dynamically loads an instance of a test runner. * * @return A Initialized TestRunner * * @throws IllegalStateException * if multiple TestRunners found in classpath. */ public static TestRunner getTestRunner(ClassLoader classLoader) { ServiceLoader<TestRunner> serviceLoader = ServiceLoader.load(TestRunner.class, classLoader); if (serviceLoader.getProviders().size() > 1) { throw new IllegalStateException("Multiple TestRunners found, only one allowed. Check your classpath"); } return serviceLoader.iterator().next(); } }
/** * Dynamically loads an instance of a test runner. * * @return A Initialized TestRunner * * @throws IllegalStateException * if multiple TestRunners found in classpath. */ public static TestRunner getTestRunner(ClassLoader classLoader) { ServiceLoader<TestRunner> serviceLoader = ServiceLoader.load(TestRunner.class, classLoader); if (serviceLoader.getProviders().size() > 1) { throw new IllegalStateException("Multiple TestRunners found, only one allowed. Check your classpath"); } return serviceLoader.iterator().next(); } }