Examples of onlyOne()


Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      }
      if(activeConfiguration == null && reg.getContainers().size() == 0)
      {
         try
         {
            DeployableContainer<?> deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
            if(deployableContainer != null)
            {
               reg.create(new ContainerDefImpl("arquillian.xml").setContainerName("default"), serviceLoader);
            }
         }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      {
         DeployableContainer<?> deployableContainer = null;
         try
         {
            // 'check' if there are any DeployableContainers on CP
            deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
         }
         catch (IllegalStateException e)
         {
            throw new IllegalStateException(
                  "Could not add a default container to registry because multipe " +
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      {
         DeployableContainer<?> deployableContainer = null;
         try
         {
            // 'check' if there are any DeployableContainers on CP
            deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
         }
         catch (IllegalStateException e)
         {
            throw new IllegalStateException(
                  "Could not add a default container to registry because multipe " +
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      ServiceLoader loader = serviceLoader.get();
      if(loader == null)
      {
         throw new IllegalStateException("No " + ServiceLoader.class.getName() + " found in context");
      }
      CommandService service = loader.onlyOne(CommandService.class);
      if(service == null)
      {
         throw new IllegalStateException("No " + CommandService.class.getName() + " found in context");
      }
      return service;
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

   {
      // Override default configured class
      ServiceLoader serviceLoader = Mockito.mock(ServiceLoader.class);
      DeployableContainer<PrivateDummyContainerConfiguration> deployableContainer = Mockito.mock(DeployableContainer.class);

      Mockito.when(serviceLoader.onlyOne(Mockito.same(DeployableContainer.class))).thenReturn(deployableContainer);
      Mockito.when(deployableContainer.getConfigurationClass()).thenReturn(PrivateDummyContainerConfiguration.class);

      String name = "some-name";
      String prop = "prop-value";
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

       ServiceLoader loader = serviceLoader.get();
       if(loader == null)
       {
          throw new IllegalStateException("No " + ServiceLoader.class.getName() + " found in context");
       }
       CommandService service = loader.onlyOne(CommandService.class);
       if(service == null)
       {
          throw new IllegalStateException("No " + CommandService.class.getName() + " found in context");
       }
       return service;
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

       ServiceLoader loader = serviceLoader.get();
       if(loader == null)
       {
          throw new IllegalStateException("No " + ServiceLoader.class.getName() + " found in context");
       }
       CommandService service = loader.onlyOne(CommandService.class);
       if(service == null)
       {
          throw new IllegalStateException("No " + CommandService.class.getName() + " found in context");
       }
       return service;
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      if (serviceLoader == null)
      {
         throw new IllegalStateException("No " + ServiceLoader.class.getName() + " found in context");
      }

      final CommandService commandService = serviceLoader.onlyOne(CommandService.class);
      if (commandService == null)
      {
         throw new IllegalStateException("No " + CommandService.class.getName() + " found in context");
      }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

    private TransactionProvider getTransactionProvider() {

        try {
            ServiceLoader serviceLoader = serviceLoaderInstance.get();

            TransactionProvider transactionProvider = serviceLoader.onlyOne(TransactionProvider.class);

            if (transactionProvider == null) {
                throw new TransactionProviderNotFoundException(
                        "Transaction provider for given test case has not been found.");
            }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.ServiceLoader.onlyOne()

      {
         DeployableContainer<?> deployableContainer = null;
         try
         {
            // 'check' if there are any DeployableContainers on CP
            deployableContainer = serviceLoader.onlyOne(DeployableContainer.class);
         }
         catch (IllegalStateException e)
         {
            StringBuilder stringBuilder = new StringBuilder()
               .append("Could not add a default container to registry because multiple instances of ")
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.