FileDocCategorySizeDatePackage
TestUserDatabase.javaAPI DocExample1645Thu Jul 08 09:28:06 BST 2004org.apache.struts.webapp.example.memory

TestUserDatabase

public final class TestUserDatabase extends MemoryUserDatabase

Help test exception handling by throwing exceptions when "magic" user names are requested.

Fields Summary
Constructors Summary
Methods Summary
public org.apache.struts.webapp.example.UserfindUser(java.lang.String username)
If the username is "expired" throw an ExpiredPasswordException to simulate a business exception. If the username is "arithmetic" throw an Aritmetic exception to simulate a system exception. Otherwise, delegate to MemoryDatabase.

param
username
return


        if ("expired".equals(username)) throw new ExpiredPasswordException("Testing ExpiredPasswordException ...");
        if ("arithmetic".equals(username)) throw new ArithmeticException();
        return super.findUser(username);