Package org.jboss.naming

Examples of org.jboss.naming.JndiPermission


      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
  
   public void testBasicConstructorRecursivePathName() throws Exception
   {
      JndiPermission test = new JndiPermission(new CompositeName("1/2/3/-"), JndiPermission.BIND_ACTION);
      assertEquals("1/2/3/-", test.getName());
      assertEquals(JndiPermission.BIND_ACTION, test.getActions());
   }
View Full Code Here


  
   public void testBasicConstructorBadString() throws Exception
   {
      try
      {
         new JndiPermission((String) null, JndiPermission.ALL_ACTION);
         fail("Should not be here!");
      }
      catch (Exception expected)
      {
         checkThrowable(NullPointerException.class, expected);
View Full Code Here

  
   public void testBasicConstructorBadName() throws Exception
   {
      try
      {
         new JndiPermission((Name) null, JndiPermission.ALL_ACTION);
         fail("Should not be here!");
      }
      catch (Exception expected)
      {
         checkThrowable(NullPointerException.class, expected);
View Full Code Here

                  builder.append(',');
               builder.append(action);
               comma = true;
            }
           
            JndiPermission test = new JndiPermission("simple", builder.toString());
            assertEquals("simple", test.getName());

            String foundActions = test.getActions();
            assertNotNull(foundActions);
            HashSet<String> actual = new HashSet<String>(Arrays.asList(foundActions.split(",")));
            assertEquals(newTest, actual);

            // Recurse
View Full Code Here

      }
   } */
  
   public void testBasicConstructorAllAction() throws Exception
   {
      JndiPermission all = new JndiPermission("simple", JndiPermission.ALL_ACTION);
      JndiPermission test = new JndiPermission("simple", ALL_ACTIONS);
      assertEquals(test, all);
   }
View Full Code Here

   public void testBasicConstructorBadActions() throws Exception
   {
      try
      {
         new JndiPermission("simple", "rubbish");
         fail("Should not be here!");
      }
      catch (Exception expected)
      {
         checkThrowable(IllegalArgumentException.class, expected);
      }

      try
      {
         new JndiPermission("simple", "bind,rubbish");
         fail("Should not be here!");
      }
      catch (Exception expected)
      {
         checkThrowable(IllegalArgumentException.class, expected);
View Full Code Here

      }
   }
  
   public void testImpliesSimplePath() throws Exception
   {
      JndiPermission test1 = new JndiPermission("simple", JndiPermission.ALL_ACTION);
      JndiPermission test2 = new JndiPermission("simple", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));

      test2 = new JndiPermission("notsimple", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission(ALL_BINDINGS, JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));
   }
View Full Code Here

      assertTrue(test2.implies(test1));
   }
  
   public void testImpliesHierarchy() throws Exception
   {
      JndiPermission test1 = new JndiPermission("1/2/3", JndiPermission.ALL_ACTION);
      JndiPermission test2 = new JndiPermission("1/2/3", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));

      test2 = new JndiPermission("1", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/2", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/2/4", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/2/3/4", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission(ALL_BINDINGS, JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));
   }
View Full Code Here

      assertTrue(test2.implies(test1));
   }
  
   public void testImpliesWildcard() throws Exception
   {
      JndiPermission test1 = new JndiPermission("1/2/3", JndiPermission.ALL_ACTION);
      JndiPermission test2 = new JndiPermission("1/2/*", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));

      test2 = new JndiPermission("1/2/3/*", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/4/*", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/*", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      /*
      test2 = new JndiPermission("*", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test1 = new JndiPermission("1", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));
      */

      test1 = new JndiPermission("1/2/34", JndiPermission.ALL_ACTION);
      test2 = new JndiPermission("1/2/3*", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));
   }
View Full Code Here

      assertFalse(test2.implies(test1));
   }
  
   public void testImpliesRecursive() throws Exception
   {
      JndiPermission test1 = new JndiPermission("1/2/3", JndiPermission.ALL_ACTION);
      JndiPermission test2 = new JndiPermission("1/2/-", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));

      test2 = new JndiPermission("1/-", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));

      /*
      test2 = new JndiPermission("-", JndiPermission.ALL_ACTION);
      assertTrue(test2.implies(test1));
      */

      test2 = new JndiPermission("1/2/3/-", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test2 = new JndiPermission("1/4/-", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));

      test1 = new JndiPermission("1/2/34", JndiPermission.ALL_ACTION);
      test2 = new JndiPermission("1/2/3-", JndiPermission.ALL_ACTION);
      assertFalse(test2.implies(test1));
   }
View Full Code Here

TOP

Related Classes of org.jboss.naming.JndiPermission

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.