1 package org.apache.turbine.services.security.torque; 2 3 18 19 import junit.framework.Test; 20 import junit.framework.TestSuite; 21 22 import org.apache.turbine.Turbine; 23 import org.apache.turbine.services.security.SecurityService; 24 import org.apache.turbine.services.security.TurbineSecurity; 25 26 import org.apache.turbine.test.HsqlDB; 27 28 import org.apache.turbine.test.BaseTurbineTest; 29 30 public class TestTorqueSecurity 31 extends BaseTurbineTest 32 { 33 public static final String DATA_SOURCE="turbine"; 34 35 private HsqlDB hsqlDB = null; 36 37 public TestTorqueSecurity(String name) 38 throws Exception 39 { 40 super(name, "conf/test/TurbineResources.properties"); 41 hsqlDB = new HsqlDB("jdbc:hsqldb:.", Turbine.getRealPath("conf/test/create-db.sql")); 42 } 43 44 public static Test suite() 45 { 46 return new TestSuite(TestTorqueSecurity.class); 47 } 48 49 public void testInit() 50 { 51 SecurityService ss = TurbineSecurity.getService(); 52 53 assertEquals("No Torque Security Service", ss.getClass(), TorqueSecurityService.class); 54 assertEquals("No Torque User Manager", ss.getUserManager().getClass(), TorqueUserManager.class); 55 assertTrue("Service failed to initialize", ss.getInit()); 56 } 57 } 58 | Popular Tags |