1 22 package org.jboss.test.jmx.compliance.security; 23 24 import java.security.PermissionCollection ; 25 26 import javax.management.MBeanServerPermission ; 27 28 import junit.framework.TestCase; 29 30 35 public class MBeanServerPermissionTestCase 36 extends TestCase 37 { 38 public MBeanServerPermissionTestCase(String s) 39 { 40 super(s); 41 } 42 43 public void testMBeanServerPermission() 44 { 45 MBeanServerPermission p0 = new MBeanServerPermission ("newMBeanServer"); 46 MBeanServerPermission p1 = new MBeanServerPermission ("createMBeanServer"); 47 assertTrue("createMBeanServer implies newMBeanServer", p1.implies(p0)); 48 assertTrue("createMBeanServer implies newMBeanServer", p0.implies(p1)); 49 50 PermissionCollection pc = p0.newPermissionCollection(); 51 pc.add(p0); 52 assertTrue("PC(newMBeanServer) implies createMBeanServer", pc.implies(p1)); 53 } 54 } 55 | Popular Tags |