org.apache.struts.webapp.example.memory
Class TestUserDatabase
java.lang.Object
org.apache.struts.webapp.example.memory.MemoryUserDatabase
org.apache.struts.webapp.example.memory.TestUserDatabase
- All Implemented Interfaces:
- UserDatabase
- public final class TestUserDatabase
- extends MemoryUserDatabase
Help test exception handling by throwing exceptions when "magic" user names are requested.
- Version:
- $Id $
Method Summary |
User |
findUser(String username)
If the username is "expired" throw an ExpiredPasswordException to
simulate a business exception. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestUserDatabase
public TestUserDatabase()
findUser
public User findUser(String username)
throws ExpiredPasswordException
- 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.
- Specified by:
findUser
in interface UserDatabase
- Overrides:
findUser
in class MemoryUserDatabase
- Parameters:
username
-
- Returns:
-
- Throws:
ExpiredPasswordException
Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.