Package org.jboss.deployers.spi.structure

Examples of org.jboss.deployers.spi.structure.StructureMetaData


      assertNotSame(one.hashCode(), two.hashCode());
   }
  
   public void testSerialization() throws Exception
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());

      structure = serializeDeserialize(structure, StructureMetaData.class);
      assertEmpty(structure.getContexts());

      ContextInfo one = createContext("one");
      ContextInfo two = createContext("two");
      structure.addContext(one);
      structure.addContext(two);
      assertEquals(getExpected(one, two), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
      assertEquals(two, structure.getContext("two"));
     
      structure = serializeDeserialize(structure, StructureMetaData.class);
      assertEquals(getExpected(one, two), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
      assertEquals(two, structure.getContext("two"));
   }
View Full Code Here


      super(name);
   }
  
   protected DeploymentContext build(Deployment deployment) throws DeploymentException
   {
      StructureMetaData structure = deployment.getPredeterminedManagedObjects().getAttachment(StructureMetaData.class);
      return getStructureBuilder().populateContext(deployment, structure);
   }
View Full Code Here

      return result;
   }
  
   public void testConstructorDefault()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
   }
View Full Code Here

      assertEmpty(structure.getContexts());
   }
  
   public void testAddContext()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      ContextInfo one = createContext("one");
      structure.addContext(one);
      assertEquals(getExpected(one), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
   }
View Full Code Here

      assertEquals(one, structure.getContext("one"));
   }
  
   public void testAddContexts()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      ContextInfo one = createContext("one");
      ContextInfo two = createContext("two");
      ContextInfo three = createContext("three");
      structure.addContext(one);
      structure.addContext(two);
      structure.addContext(three);
      assertEquals(getExpected(one, two, three), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
      assertEquals(two, structure.getContext("two"));
      assertEquals(three, structure.getContext("three"));
   }
View Full Code Here

      assertEquals(three, structure.getContext("three"));
   }
  
   public void testAddContextsErrors()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      try
      {
         structure.addContext(null);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
      }
     
      ContextInfo one = createContext("one");
      structure.addContext(one);
      try
      {
         structure.addContext(one);
         fail("Should not be here");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
      }

      ContextInfo another = createContext("one");
      try
      {
         structure.addContext(another);
         fail("Should not be here");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalStateException.class, e);
View Full Code Here

      }
   }
  
   public void testRemoveContext()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      ContextInfo one = createContext("one");
      structure.addContext(one);
      assertEquals(getExpected(one), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
     
      structure.removeContext(one);
      assertEquals(getExpected(), structure.getContexts());
      assertNull(structure.getContext("one"));

      structure.addContext(one);
      assertEquals(getExpected(one), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
   }
View Full Code Here

      assertEquals(one, structure.getContext("one"));
   }
  
   public void testRemoveContexts()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      ContextInfo one = createContext("one");
      ContextInfo two = createContext("two");
      ContextInfo three = createContext("three");
      structure.addContext(one);
      structure.addContext(two);
      structure.addContext(three);
      assertEquals(getExpected(one, two, three), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
      assertEquals(two, structure.getContext("two"));
      assertEquals(three, structure.getContext("three"));
     
      structure.removeContext(one);
      assertEquals(getExpected(two, three), structure.getContexts());
      assertNull(structure.getContext("one"));
      assertEquals(two, structure.getContext("two"));
      assertEquals(three, structure.getContext("three"));
     
      structure.removeContext(two);
      assertEquals(getExpected(three), structure.getContexts());
      assertNull(structure.getContext("one"));
      assertNull(structure.getContext("two"));
      assertEquals(three, structure.getContext("three"));
     
      structure.removeContext(three);
      assertEquals(getExpected(), structure.getContexts());
      assertNull(structure.getContext("one"));
      assertNull(structure.getContext("two"));
      assertNull(structure.getContext("three"));

      structure.addContext(one);
      assertEquals(getExpected(one), structure.getContexts());
      assertEquals(one, structure.getContext("one"));
     
      // Removing a context not present is ok
      structure.removeContext(two);
   }
View Full Code Here

      structure.removeContext(two);
   }
  
   public void testRemoveContextErrors()
   {
      StructureMetaData structure = createDefault();
      assertEmpty(structure.getContexts());
     
      try
      {
         ContextInfo context = null;
         structure.removeContext(context);
         fail("Should not be here!");
      }
      catch (Exception e)
      {
         checkThrowable(IllegalArgumentException.class, e);
View Full Code Here

   }

   protected Deployment createSimple() throws Exception
   {
      Deployment deployment = createDeployment();
      StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
      MutableAttachments attachments = (MutableAttachments) deployment.getPredeterminedManagedObjects();
      attachments.addAttachment(StructureMetaData.class, structure);

      DeploymentFactory factory = getDeploymentFactory();
      factory.addContext(deployment, "");
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.structure.StructureMetaData

Copyright © 2018 www.massapicom. 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.