org.nakedobjects.applib.fixtures
Class SwitchUserFixture

java.lang.Object
  extended by org.nakedobjects.applib.AbstractContainedObject
      extended by org.nakedobjects.applib.fixtures.AbstractFixture
          extended by org.nakedobjects.applib.fixtures.SwitchUserFixture
All Implemented Interfaces:
CompositeFixture, InstallableFixture, SwitchUserServiceAware

public class SwitchUserFixture
extends AbstractFixture

Sole purpose is to switch the current user while object fixtures are being installed.

An alternative is to switch user using the switchUser method.

Note that (unlike the otherwise similar DateFixture) the last user switched to is not used as the logon fixture. If you want to automatically logon as some user, use the LogonFixture.

See Also:
DateFixture, LogonFixture

Constructor Summary
SwitchUserFixture(int year, int month, int day)
           
SwitchUserFixture(int year, int month, int day, int hour, int minutes)
           
 
Method Summary
 int getDay()
           
 int getHour()
           
 int getMinute()
           
 int getMonth()
           
 int getYear()
           
 void install()
          Most subclasses will override this method, but composite fixtures should instead call AbstractFixture.addFixture(Object) in their constructor.
 
Methods inherited from class org.nakedobjects.applib.fixtures.AbstractFixture
addFixture, earlierDate, earlierTime, getFixtureClock, getFixtures, getType, laterDate, laterTime, resetClock, setDate, setService, setTime, switchUser
 
Methods inherited from class org.nakedobjects.applib.AbstractContainedObject
allInstances, allMatches, allMatches, allMatches, allMatches, firstMatch, firstMatch, firstMatch, firstMatch, getContainer, getUser, informUser, isPersistent, isValid, newTransientInstance, persist, persistIfNotAlready, raiseError, remove, setContainer, uniqueMatch, uniqueMatch, uniqueMatch, uniqueMatch, validate, warnUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchUserFixture

public SwitchUserFixture(int year,
                         int month,
                         int day,
                         int hour,
                         int minutes)

SwitchUserFixture

public SwitchUserFixture(int year,
                         int month,
                         int day)
Method Detail

getYear

public int getYear()

getMonth

public int getMonth()

getDay

public int getDay()

getHour

public int getHour()

getMinute

public int getMinute()

install

public void install()
Description copied from class: AbstractFixture
Most subclasses will override this method, but composite fixtures should instead call AbstractFixture.addFixture(Object) in their constructor.

Specified by:
install in interface InstallableFixture
Overrides:
install in class AbstractFixture


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.