From: Scott M S. <st...@us...> - 2002-08-17 21:33:46
|
User: starksm Date: 02/08/17 14:33:45 Modified: src/main/org/jboss/test/security/test Tag: Branch_3_0 SRPUnitTestCase.java Added: src/main/org/jboss/test/security/test Tag: Branch_3_0 SRPLoginModuleUnitTestCase.java Log: Factor out the SRP login module to SRP service test cases Revision Changes Path No revision No revision 1.1.2.1 +9 -20 jbosstest/src/main/org/jboss/test/security/test/SRPUnitTestCase.java Index: SRPUnitTestCase.java =================================================================== RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/security/test/SRPUnitTestCase.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- SRPUnitTestCase.java 23 Mar 2002 03:10:54 -0000 1.1 +++ SRPUnitTestCase.java 17 Aug 2002 21:33:45 -0000 1.1.2.1 @@ -29,10 +29,12 @@ import org.jboss.test.JBossTestCase; import org.jboss.test.JBossTestSetup; -/** Test of the secure remote password(SRP) service and its usage. +/** Test of the secure remote password(SRP) session key to perform crypto +operations. + @author Sco...@jb... - @version $Revision: 1.1 $ + @version $Revision: 1.1.2.1 $ */ public class SRPUnitTestCase extends JBossTestCase { @@ -48,22 +50,13 @@ super(name); } - /** Test a login against the SRP service using the SRPLoginModule - */ - public void testSRPLogin() throws Exception - { - log.debug("+++ testSRPLogin"); - login(); - logout(); - } - /** Test that the echo method argument is encrypted by the SRP session key. */ public void testEchoArgs() throws Exception { log.debug("+++ testEchoArgs"); - login(); + login("srp-test", username, password); Object obj = getInitialContext().lookup("srp.StatelessSession"); obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class); StatelessSessionHome home = (StatelessSessionHome) obj; @@ -75,20 +68,16 @@ logout(); } - /** Login as user scott using the conf.name login config or - 'srp-test' if conf.name is not defined. + /** Login using the given confName login configuration with the provided + username and password credential. */ - private void login() throws Exception - { - login(username, password); - } - private void login(String username, char[] password) throws Exception + private void login(String confName, String username, char[] password) + throws Exception { if( loggedIn ) return; lc = null; - String confName = System.getProperty("conf.name", "srp-test"); AppCallbackHandler handler = new AppCallbackHandler(username, password); log.debug("Creating LoginContext("+confName+")"); lc = new LoginContext(confName, handler); No revision No revision 1.1.2.1 +123 -0 jbosstest/src/main/org/jboss/test/security/test/Attic/SRPLoginModuleUnitTestCase.java |