1 16 package org.apache.lenya.ac.impl; 17 18 import junit.textui.TestRunner; 19 20 import org.apache.avalon.framework.component.ComponentSelector; 21 import org.apache.lenya.ac.AccessControlException; 22 import org.apache.lenya.ac.AccreditableManager; 23 import org.apache.lenya.cms.ExcaliburTest; 24 import org.apache.lenya.cms.PublicationHelper; 25 26 public class AccreditableManagerTest extends ExcaliburTest { 27 28 31 public AccreditableManagerTest(String test) { 32 super(test); 33 } 34 35 41 public static void main(String [] args) { 42 args = PublicationHelper.extractPublicationArguments(args); 43 TestRunner.run(AccreditableManagerTest.class); 44 } 45 46 private AccreditableManager accreditableManager; 47 private ComponentSelector selector; 48 49 protected static final String HINT = "file"; 50 51 57 public void setUp() throws Exception { 58 super.setUp(); 59 60 String role = AccreditableManager.ROLE + "Selector"; 61 selector = (ComponentSelector) manager.lookup(role); 62 63 accreditableManager = (AccreditableManager) selector.select(HINT); 64 assertNotNull("AccreditableManager is null", accreditableManager); 65 } 66 67 71 public void testAccreditableManager() throws AccessControlException { 72 assertNotNull(accreditableManager.getUserManager()); 73 assertNotNull(accreditableManager.getGroupManager()); 74 assertNotNull(accreditableManager.getRoleManager()); 75 76 } 77 78 } 79 | Popular Tags |