org.apache.struts.webapp.example.memory
Class TestUserDatabase

java.lang.Object
  extended byorg.apache.struts.webapp.example.memory.MemoryUserDatabase
      extended byorg.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 $

Field Summary
 
Fields inherited from class org.apache.struts.webapp.example.memory.MemoryUserDatabase
 
Constructor Summary
TestUserDatabase()
           
 
Method Summary
 User findUser(String username)
          If the username is "expired" throw an ExpiredPasswordException to simulate a business exception.
 
Methods inherited from class org.apache.struts.webapp.example.memory.MemoryUserDatabase
close, createUser, findUsers, getPathname, open, removeUser, save, setPathname
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestUserDatabase

public TestUserDatabase()
Method Detail

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.