1 17 18 package org.apache.james.remotemanager; 19 20 import org.apache.james.test.AbstractProtocolTest; 21 22 public class UserManagementTest 23 extends AbstractProtocolTest 24 { 25 private String _userName; 26 private String _password; 27 28 public UserManagementTest( String action, String userName ) 29 { 30 this( action, userName, "password" ); 31 } 32 33 public UserManagementTest( String action, String userName, String password ) 34 { 35 super( action ); 36 _port = 4555; 37 _userName = userName; 38 _password = password; 39 } 40 41 public void setUp() throws Exception 42 { 43 super.setUp(); 44 addTestFile( "RemoteManagerLogin.test", _preElements ); 45 addTestFile( "RemoteManagerLogout.test", _postElements ); 46 } 47 48 public void addUser() throws Exception 49 { 50 addUser( _userName, _password ); 51 } 52 53 protected void addUser( String userName, String password ) 54 throws Exception 55 { 56 CL( "adduser " + userName + " " + password ); 57 SL( "User " + userName + " added" ); 58 executeTests(); 59 } 60 61 67 68 public void deleteUser() throws Exception 69 { 70 deleteUser( _userName ); 71 } 72 73 protected void deleteUser( String userName ) throws Exception 74 { 75 CL( "deluser " + userName ); 76 SL( "User " + userName + " deleted" ); 77 executeTests(); 78 } 79 } 80 | Popular Tags |