org.nakedobjects.applib.fixtures
Class DateFixture

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

public class DateFixture
extends AbstractFixture

Sole purpose is to set the date/time while object fixtures are being installed.

An alternative is to change the date using AbstractFixture.setDate(int, int, int) and AbstractFixture.setTime(int, int).

Note that the last date set will remain in force for the application itself. To revert to the current time, have a fixture at the end call AbstractFixture.resetClock().

See Also:
SwitchUserFixture

Constructor Summary
DateFixture(int year, int month, int day)
           
DateFixture(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, persistentIfNotAlready, 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

DateFixture

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

DateFixture

public DateFixture(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.