Package org.jboss.metadata.spi.scope

Examples of org.jboss.metadata.spi.scope.ScopeKey


      assertEquals(testScope5.getScopeLevel(), key.getMaxScopeLevel());
   }

   public void testAddScopeLevelChange() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testLevel1, testQualifier1, null);
      Scope[] expected = new Scope[] { testScope1 };
      assertScopeKey(expected, key);
      assertEquals(testScope1.getScopeLevel(), key.getMaxScopeLevel());

      assertAddScope(key, testLevel1, testQualifier1Different, testScope1);
      expected = new Scope[] { testScope1Different };
      assertScopeKey(expected, key);
      assertEquals(testScope1Different.getScopeLevel(), key.getMaxScopeLevel());
}
View Full Code Here


      assertEquals(testScope1Different.getScopeLevel(), key.getMaxScopeLevel());
}

   public void testAddScopeLevelChangeSorts() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testLevel1, testQualifier1, null);
      assertAddScope(key, testLevel2, testQualifier2, null);
      assertAddScope(key, testLevel3, testQualifier3, null);
      assertAddScope(key, testLevel4, testQualifier4, null);
      assertAddScope(key, testLevel5, testQualifier5, null);
      Scope[] expected = new Scope[] { testScope1, testScope2, testScope3, testScope4, testScope5 };
      assertScopeKey(expected, key);
      assertEquals(testScope5.getScopeLevel(), key.getMaxScopeLevel());

      assertAddScope(key, testLevel3, testQualifier3Different, testScope3);
      expected = new Scope[] { testScope1, testScope2, testScope3Different, testScope4, testScope5 };
      assertScopeKey(expected, key);
      assertEquals(testScope5.getScopeLevel(), key.getMaxScopeLevel());
   }
View Full Code Here

      assertEquals(testScope5.getScopeLevel(), key.getMaxScopeLevel());
   }

   public void testRemoveScope() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testScope1, null);
      Scope[] expected = new Scope[] { testScope1 };
      assertScopeKey(expected, key);
      assertEquals(testScope1.getScopeLevel(), key.getMaxScopeLevel());

      assertRemoveScope(key, testScope1, testScope1);
      expected = new Scope[0];
      assertScopeKey(expected, key);
      assertNull(key.getMaxScopeLevel());
   }
View Full Code Here

      assertNull(key.getMaxScopeLevel());
   }
  
   public void testRemoveScopeSorts() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testScope1, null);
      assertAddScope(key, testScope2, null);
      assertAddScope(key, testScope3, null);
      Scope[] expected = new Scope[] { testScope1, testScope2, testScope3 };
      assertScopeKey(expected, key);
      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());

      assertRemoveScope(key, testScope2, testScope2);
      expected = new Scope[] { testScope1, testScope3 };
      assertScopeKey(expected, key);
      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());
   }
View Full Code Here

      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());
   }

   public void testRemoveScopeLevel() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testLevel1, testQualifier1, null);
      Scope[] expected = new Scope[] { testScope1 };
      assertScopeKey(expected, key);
      assertEquals(testScope1.getScopeLevel(), key.getMaxScopeLevel());

      assertRemoveScope(key, testLevel1, testScope1);
      expected = new Scope[0];
      assertScopeKey(expected, key);
      assertNull(key.getMaxScopeLevel());
   }
View Full Code Here

      assertNull(key.getMaxScopeLevel());
   }

   public void testRemoveScopeLevelSorts() throws Exception
   {
      ScopeKey key = new ScopeKey();
      assertAddScope(key, testLevel1, testQualifier1, null);
      assertAddScope(key, testLevel2, testQualifier2, null);
      assertAddScope(key, testLevel3, testQualifier3, null);
      Scope[] expected = new Scope[] { testScope1, testScope2, testScope3 };
      assertScopeKey(expected, key);
      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());

      assertRemoveScope(key, testLevel2, testScope2);
      expected = new Scope[] { testScope1, testScope3 };
      assertScopeKey(expected, key);
      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());
   }
View Full Code Here

      assertEquals(testScope3.getScopeLevel(), key.getMaxScopeLevel());
   }

   public void testFreeze() throws Exception
   {
      ScopeKey key = new ScopeKey(testScope1);
      key.freeze();
      try
      {
         key.addScope(testScope1);
         fail("Should not be here!");
      }
      catch (IllegalStateException expected)
      {
      }
      try
      {
         key.addScope(testLevel1, testQualifier1);
         fail("Should not be here!");
      }
      catch (IllegalStateException expected)
      {
      }
      try
      {
         key.removeScope(testScope1);
         fail("Should not be here!");
      }
      catch (IllegalStateException expected)
      {
      }
      try
      {
         key.removeScopeLevel(testLevel1);
         fail("Should not be here!");
      }
      catch (IllegalStateException expected)
      {
      }
View Full Code Here

      }
   }

   public void testNoParentEmpty() throws Exception
   {
      ScopeKey key = new ScopeKey();
      ScopeKey parent = key.getParent();
      assertNull(parent);
   }
View Full Code Here

      assertNull(parent);
   }

   public void testNoParentSingleScope() throws Exception
   {
      ScopeKey key = new ScopeKey();
      key.addScope(testScope1);
      ScopeKey parent = key.getParent();
      assertNull(parent);
   }
View Full Code Here

      assertNull(parent);
   }

   public void testSimpleParent() throws Exception
   {
      ScopeKey key = new ScopeKey();
      key.addScope(testScope1);
      key.addScope(testScope2);
      ScopeKey parent = key.getParent();
      assertNotNull(parent);
     
      ScopeKey expected = new ScopeKey();
      expected.addScope(testScope1);
      assertEquals(expected, parent);
      assertEquals(testScope1.getScopeLevel(), parent.getMaxScopeLevel());
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.scope.ScopeKey

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.