1 package net.sf.jguard.ext.authentication.manager; 2 3 import java.util.Set ; 4 5 import net.sf.jguard.ext.SecurityConstants; 6 import net.sf.jguard.ext.database.DatabaseTestCase; 7 8 public class JdbcAuthenticationManagerTest extends DatabaseTestCase { 9 10 public void setUp(){ 11 super.setUp(); 12 13 setProperties("/authentication."+database+".properties"); 14 DatabaseTestCase.getOptions().put(SecurityConstants.AUTHENTICATION_DATABASE_FILE_LOCATION,DatabaseTestCase.getPropertiesURIPath()); 15 16 } 17 18 public void testInit()throws Exception { 19 21 } 22 23 public void testGetAllPrincipalsSet()throws Exception { 24 JdbcAuthenticationManager authManager = new JdbcAuthenticationManager(); 25 authManager.init(DatabaseTestCase.getOptions()); 26 AuthenticationManagerFactory.setAuthenticationManager(authManager); 27 Set principals = authManager.getAllPrincipalsSet(); 28 System.out.println(principals); 29 30 } 31 32 public void testGetUsers()throws Exception { 33 JdbcAuthenticationManager authManager = new JdbcAuthenticationManager(); 34 authManager.init(DatabaseTestCase.getOptions()); 35 AuthenticationManagerFactory.setAuthenticationManager(authManager); 36 Set users = authManager.getUsers(); 37 System.out.println(users); 38 39 } 40 } 41 | Popular Tags |