Package org.jboss.metadata.spi.scope

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


      assertEquals(expected, previous);
   }

   protected void assertRemoveScope(ScopeKey key, ScopeLevel level, Scope expected) throws Exception
   {
      Scope previous = key.removeScopeLevel(level);
      assertEquals(expected, previous);
   }
View Full Code Here


      super(name);
   }

   public void testBasicScope() throws Exception
   {
      Scope test = new Scope(testLevel1, "localhost");
      assertEquals(testLevel1, test.getScopeLevel());
      assertEquals("localhost", test.getQualifier());
   }
View Full Code Here

      assertEquals("localhost", test.getQualifier());
   }

   public void testScopeEquals() throws Exception
   {
      Scope test1 = new Scope(testLevel1, "localhost");
      Scope test2 = new Scope(testLevel1, "localhost");
      assertEquals(test1, test2);
   }
View Full Code Here

      assertEquals(test1, test2);
   }

   public void testScopeNotEquals() throws Exception
   {
      Scope test1 = new Scope(testLevel1, "localhost");
      Scope test2 = new Scope(testLevel1, "remotehost");
      assertFalse(test1.equals(test2));
     
      Scope test3 = new Scope(testLevel2, "localhost");
      assertFalse(test1.equals(test3));
   }
View Full Code Here

      assertFalse(test1.equals(test3));
   }

   public void testScopeSerialization() throws Exception
   {
      Scope test1 = new Scope(testLevel1, "localhost");

      byte[] bytes = serialize(test1);
      Scope test2 = (Scope) deserialize(bytes);

      assertEquals(testLevel1, test2.getScopeLevel());
      assertEquals("localhost", test2.getQualifier());
     
      assertEquals(test1, test2);
   }
View Full Code Here

            assertNotNull(scopeKey);
           
            Collection<Scope> scopes = scopeKey.getScopes();
            assertEquals(1, scopes.size());
           
            Scope scope = scopes.iterator().next();
           
            assertEquals(CommonLevels.THREAD, scope.getScopeLevel());
            assertEquals(Thread.currentThread().getName(), scope.getQualifier());
         }
         catch (Throwable t)
         {
            log.error("Error", t);
            error = t;
View Full Code Here

      Collection<Scope> scopes = key.getScopes();
      if (scopes.size() != 1)
         return null;
     
      // See if we have a factory
      Scope scope = scopes.iterator().next();
      ScopeLevel scopeLevel = scope.getScopeLevel();
      MetaDataRetrievalFactory factory = getMetaDataRetrievalFactory(scopeLevel);
      if (factory == null)
         return null;
     
      // We have a factory, use it
View Full Code Here

      assertNotNull(scopeKey);
     
      Collection<Scope> scopes = scopeKey.getScopes();
      assertEquals(1, scopes.size());
     
      Scope scope = scopes.iterator().next();
     
      assertEquals(CommonLevels.CLASS, scope.getScopeLevel());
      assertEquals(TestAnnotationScopeBean.class, scope.getQualifier());
   }
View Full Code Here

      assertNotNull(scopeKey);
     
      Collection<Scope> scopes = scopeKey.getScopes();
      assertEquals(1, scopes.size());
     
      Scope scope = scopes.iterator().next();
     
      assertEquals(CommonLevels.JOINPOINT, scope.getScopeLevel());
      assertEquals(member, scope.getQualifier());
   }
View Full Code Here

         return true;
     
      boolean match = false;
      int index = 0;
      Iterator<Scope> i = key.getScopes().iterator();
      Scope repositoryScope = i.next();
      Scope matchScope = matchScopes[index];
      while (true)
      {
         ScopeLevel keyLevel = matchScope.getScopeLevel();
         ScopeLevel repositoryLevel = repositoryScope.getScopeLevel();

         // Same level
         if (keyLevel.compareTo(repositoryLevel) == 0)
         { 
            if (matchScope.equals(repositoryScope))
               match = true;
            else
            {
               // No match, we are done
               match = false;
View Full Code Here

TOP

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

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.