Examples of ContainerRegistry


Examples of org.jboss.arquillian.container.spi.ContainerRegistry

      }
   }

   private void verifyRegistry(String... containerNames)
   {
      ContainerRegistry registry = regInst.get();

      Assert.assertNotNull(
            "Verify Containers registered",
            registry.getContainers());
      Assert.assertEquals(
            "Verify " + containerNames.length + " Container(s) registrered",
            containerNames.length, registry.getContainers().size());

      for(int i = 0; i < containerNames.length; i++)
      {
         String containerName = containerNames[i];
         Assert.assertEquals(
               "Verify correct Container registrered",
               containerName, registry.getContainers().get(i).getName());
      }
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   @Test
   public void shouldBeAbleToDefaultTargetToOnlyRegisteredContainer() throws Exception
   {
      String name = "some-name";
     
      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name), serviceLoader);
     
      Container container = registry.getContainer(TargetDescription.DEFAULT);
     
      Assert.assertEquals(
            "Verify that the only registered container is returned as default",
            name, container.getName());
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   @Test
   public void shouldBeAbleToDefaultTargetToDefaultRegisteredContainer() throws Exception
   {
      String name = "some-name";
     
      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName("some-other-name"), serviceLoader);
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name).setDefault(), serviceLoader);
     
      Container container = registry.getContainer(TargetDescription.DEFAULT);
     
      Assert.assertEquals(
            "Verify that the default registered container is returned as default",
            name, container.getName());
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   public void shouldBeAbleToCreateContainerConfiguration() throws Exception
   {
      String name = "some-name";
      String prop = "prop-value";

      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name)
                           .property("property", prop), serviceLoader);

      Container container = registry.getContainer(new TargetDescription(name));

      Assert.assertEquals(
            "Verify that the only registered container is returned as default",
            name, container.getName());
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

      Mockito.when(deployableContainer.getConfigurationClass()).thenReturn(PrivateDummyContainerConfiguration.class);

      String name = "some-name";
      String prop = "prop-value";

      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name)
                           .property("property", prop), serviceLoader);

      Container container = registry.getContainer(new TargetDescription(name));

      Assert.assertEquals(
            "Verify that the only registered container is returned as default",
            name, container.getName());
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   @Test
   public void shouldBeAbleToSpecifyTarget() throws Exception
   {
      String name = "some-name";
     
      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName("other-name"), serviceLoader);
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name), serviceLoader);
     
      Container container = registry.getContainer(new TargetDescription(name));
     
      Assert.assertEquals(
            "Verify that the specific registered container is returned",
            name, container.getName());
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   @Test
   public void shouldBeAbleToGetContainerByName() throws Exception
   {
      String name = "some-name";

      ContainerRegistry registry = new LocalContainerRegistry(injector.get());
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName("other-name"), serviceLoader);
      registry.create(new ContainerDefImpl(ARQUILLIAN_XML).setContainerName(name), serviceLoader);
     
      Container container = registry.getContainer(name);

      Assert.assertEquals(
            "Verify that the specific registered container is returned",
            name, container.getName());
     
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   // Validate DeploymentScenario --------------------------------------------------------||
   //-------------------------------------------------------------------------------------||

   protected void validate(DeploymentScenario scenario)
   {
      ContainerRegistry conReg = containerRegistry.get();
      for(TargetDescription target : scenario.targets())
      {
         Container container = conReg.getContainer(target);
         if(container == null)
         {
            throw new ValidationException(
                  DeploymentScenario.class.getSimpleName() + " contains targets not maching any defined Container in the registry. " + target.getName() +
                  ". Possible causes are: No Deployable Container found on ClassPath or " +
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   private void lookup(Method method, ResultCallback callback)
   {
      DeploymentTargetDescription deploymentTarget = locateDeployment(method);
     
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      DeploymentScenario deploymentScenario = this.deploymentScenario.get();
     
      Deployment deployment = deploymentScenario.deployment(deploymentTarget);
     
      Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
     
      callback.call(container, deployment);
   }
View Full Code Here

Examples of org.jboss.arquillian.container.spi.ContainerRegistry

   private void lookup(Method method, ResultCallback callback)
   {
      DeploymentTargetDescription deploymentTarget = locateDeployment(method);
     
      ContainerRegistry containerRegistry = this.containerRegistry.get();
      DeploymentScenario deploymentScenario = this.deploymentScenario.get();
     
      Deployment deployment = deploymentScenario.deployment(deploymentTarget);
      if(deployment != null)
      {
         Container container = containerRegistry.getContainer(deployment.getDescription().getTarget());
         callback.call(container, deployment);
      }
   }
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.