Examples of ServiceLoader


Examples of java.util.ServiceLoader

public class ServicePathFunctionDescriptorTest {

  @Test
  public void testServiceLoader() throws Exception {
    ServiceLoader loader = ServiceLoader.load( UrlRewriteFunctionDescriptor.class );
    Iterator iterator = loader.iterator();
    assertThat( "Service iterator empty.", iterator.hasNext() );
    while( iterator.hasNext() ) {
      Object object = iterator.next();
      if( object instanceof ServicePathFunctionDescriptor ) {
        return;
View Full Code Here

Examples of org.apache.tika.config.ServiceLoader

* @see ExternalParsersConfigReader
*/
public class ExternalParsersFactory {
  
   public static List<ExternalParser> create() throws IOException, TikaException {
      return create(new ServiceLoader());
   }
View Full Code Here

Examples of org.apache.tuscany.core.loader.ServiceLoader

        registerLoader(loaderRegistry, new IncludeLoader(loaderRegistry));
        registerLoader(loaderRegistry,
            new InterfaceJavaLoader(loaderRegistry, new JavaInterfaceProcessorRegistryImpl()));
        registerLoader(loaderRegistry, new PropertyLoader(loaderRegistry));
        registerLoader(loaderRegistry, new ReferenceLoader(loaderRegistry));
        registerLoader(loaderRegistry, new ServiceLoader(loaderRegistry));
        registerLoader(loaderRegistry, new SystemImplementationLoader(loaderRegistry));
        registerLoader(loaderRegistry, new SystemBindingLoader(loaderRegistry));
        return loaderRegistry;
    }
View Full Code Here

Examples of org.auraframework.util.ServiceLoader

    @Override
    public void setUp() throws Exception {
       super.setUp();
       mci = Mockito.mock(ConfigAdapter.class);
       Mockito.when(mci.isPrivilegedNamespace((String)Mockito.any())).thenReturn(true);
       ServiceLoader msl = ServiceLocatorMocker.mockServiceLocator();
       Mockito.when(msl.get(ConfigAdapter.class)).thenReturn(mci);      
    }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

        List<RemoteApplicationContextProducer> producers = new ArrayList<RemoteApplicationContextProducer>();
        producers.add(notSupportedApplicationContextProducer);
        producers.add(supportedApplicationContextProducer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(RemoteApplicationContextProducer.class)).thenReturn(producers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

        List<RemoteApplicationContextProducer> producers = new ArrayList<RemoteApplicationContextProducer>();
        producers.add(notSupportedApplicationContextProducer);
        producers.add(supportedApplicationContextProducer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(RemoteApplicationContextProducer.class)).thenReturn(producers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

        List<RemoteApplicationContextProducer> producers = new ArrayList<RemoteApplicationContextProducer>();
        producers.add(notSupportedApplicationContextProducer);
        producers.add(supportedApplicationContextProducer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(RemoteApplicationContextProducer.class)).thenReturn(producers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

    public void testInitApplicationContextNotSupported() throws Exception {

        List<RemoteApplicationContextProducer> producers = new ArrayList<RemoteApplicationContextProducer>();
        producers.add(notSupportedApplicationContextProducer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(RemoteApplicationContextProducer.class)).thenReturn(producers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

    public void testDestroyApplicationContextNoApplicationContext() throws Exception {

        List<ApplicationContextDestroyer> destroyers = new ArrayList<ApplicationContextDestroyer>();
        destroyers.add(applicationContextDestroyer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(ApplicationContextDestroyer.class)).thenReturn(destroyers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader

    public void testDestroyApplicationContextForTestCase() throws Exception {

        List<ApplicationContextDestroyer> destroyers = new ArrayList<ApplicationContextDestroyer>();
        destroyers.add(applicationContextDestroyer);

        ServiceLoader serviceLoader = mock(ServiceLoader.class);
        when(serviceLoader.all(ApplicationContextDestroyer.class)).thenReturn(destroyers);

        Instance<ServiceLoader> mockServiceLoader = mock(Instance.class);
        when(mockServiceLoader.get()).thenReturn(serviceLoader);
        TestReflectionHelper.setFieldValue(instance, "serviceLoaderInstance", mockServiceLoader);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.