1 16 package org.apache.lenya.ac.impl; 17 18 import junit.textui.TestRunner; 19 20 import org.apache.lenya.ac.AccessControlException; 21 import org.apache.lenya.ac.Identity; 22 import org.apache.lenya.ac.User; 23 import org.apache.lenya.cms.PublicationHelper; 24 25 public class IdentityTest extends AccessControlTest { 26 27 31 public IdentityTest(String test) { 32 super(test); 33 } 34 35 39 public static void main(String [] args) { 40 PublicationHelper.extractPublicationArguments(args); 41 TestRunner.run(IdentityTest.class); 42 } 43 44 public static final String USER_ID = "lenya"; 45 46 51 public void testIdentity() throws AccessControlException { 52 Identity identity = new Identity(); 53 User user = getAccessController().getAccreditableManager().getUserManager().getUser(USER_ID); 54 System.out.println("Adding user to identity: [" + user + "]"); 55 identity.addIdentifiable(user); 56 57 assertSame(user, identity.getUser()); 58 } 59 60 } 61 | Popular Tags |