1 /* 2 * Copyright (c) 2003 3 * Information Desire GmbH 4 * All rights reserved. 5 */ 6 package com.infodesire.infobit; 7 8 import junit.framework.TestCase; 9 import junit.framework.TestSuite; 10 11 import com.infodesire.infobit.data.Acl; 12 import com.infodesire.infobit.data.Capability; 13 14 import java.util.Map; 15 import java.util.Set; 16 /*** 17 * test security manipulation - granting and revoking roles. 18 * 19 * @author konstantin 20 * @created August 14, 2003 21 * @version $Revision: 1.1 $ 22 */ 23 public class SecurityManipulationTest extends InfobitTestBase { 24 25 /*** 26 * Constructor for the SecurityManipulationTest object 27 * 28 * @param name Description of Parameter 29 */ 30 public SecurityManipulationTest(String name) { 31 super(name); 32 } 33 34 35 /*** 36 * The JUnit setup method 37 * 38 * @exception Exception Description of Exception 39 */ 40 public void setUp() throws Exception { 41 super.setUp(); 42 43 } 44 45 46 /*** 47 * A unit test for JUnit 48 * 49 * @exception Exception Description of Exception 50 */ 51 public void testGrantRevoke() throws Exception { 52 InfobitPool pool = _configuration.getPool("superuser_pool"); 53 AclManager manager = pool.getAclManager(); 54 55 Capability cap = manager.createCapability("bang_pamella_anderson"); 56 Capability cap2 = manager.createCapability("bang_jenna_jemison"); 57 58 manager.createAcl("holywood_banging"); 59 Acl acl = manager.getAcl("holywood_banging"); 60 assertTrue(acl.getRoles(cap).isEmpty()); 61 62 manager.grantPermission(acl, cap, "blurge"); 63 } 64 }

This page was automatically generated by Maven