|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.applib.AbstractContainedObject
org.nakedobjects.applib.fixtures.AbstractFixture
public abstract class AbstractFixture
Convenience class for creating fixtures.
Most subclasses will simply override install() to setup objects. In addition though
fixtures may also:
setDate(int, int, int) and
setTime(int, int).
switchUser(String, String...).
addFixture(Object).
AbstractContainedObject.firstMatch(Class, org.nakedobjects.applib.Filter) or
AbstractContainedObject.uniqueMatch(Class, org.nakedobjects.applib.Filter) (and various overloads thereof).
To automatically logon for the demo/test, use
| Constructor Summary | |
|---|---|
AbstractFixture()
Assumed to be data fixture. |
|
AbstractFixture(FixtureType fixtureType)
|
|
| Method Summary | |
|---|---|
protected void |
addFixture(java.lang.Object fixture)
Allows the fixture to act as a composite (call within constructor). |
void |
earlierDate(int years,
int months,
int days)
Will print warning message and do nothing if FixtureClock could not be initialized. |
void |
earlierTime(int hours,
int minutes)
Will print warning message and do nothing if FixtureClock could not be initialized. |
FixtureClock |
getFixtureClock()
The Clock singleton, downcast to FixtureClock. |
java.util.List<java.lang.Object> |
getFixtures()
Returns an array of any fixtures that have been added. |
FixtureType |
getType()
As specified in constructor. |
void |
install()
Most subclasses will override this method, but composite fixtures should instead call addFixture(Object) in their constructor. |
void |
laterDate(int years,
int months,
int days)
Will print warning message and do nothing if FixtureClock could not be initialized. |
void |
laterTime(int hours,
int minutes)
Will print warning message and do nothing if FixtureClock could not be initialized. |
void |
resetClock()
Will print warning message and do nothing if FixtureClock could not be initialized. |
void |
setDate(int year,
int month,
int day)
Will print warning message and do nothing if FixtureClock could not be initialized. |
void |
setService(SwitchUserService fixtureService)
|
void |
setTime(int hour,
int minute)
Will print warning message and do nothing if FixtureClock could not be initialized. |
protected void |
switchUser(java.lang.String username,
java.lang.String... roles)
|
| 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 |
|---|
public AbstractFixture()
data fixture.
public AbstractFixture(FixtureType fixtureType)
| Method Detail |
|---|
public FixtureType getType()
getType in interface InstallableFixturepublic void install()
addFixture(Object) in their constructor.
install in interface InstallableFixtureprotected void addFixture(java.lang.Object fixture)
public java.util.List<java.lang.Object> getFixtures()
added.
getFixtures in interface CompositeFixturepublic FixtureClock getFixtureClock()
Clock singleton, downcast to FixtureClock.
Will return null if FixtureClock could not be initialized.
public void earlierDate(int years,
int months,
int days)
FixtureClock could not be initialized.
public void earlierTime(int hours,
int minutes)
FixtureClock could not be initialized.
public void laterDate(int years,
int months,
int days)
FixtureClock could not be initialized.
public void laterTime(int hours,
int minutes)
FixtureClock could not be initialized.
public void resetClock()
FixtureClock could not be initialized.
public void setDate(int year,
int month,
int day)
FixtureClock could not be initialized.
public void setTime(int hour,
int minute)
FixtureClock could not be initialized.
protected void switchUser(java.lang.String username,
java.lang.String... roles)
public void setService(SwitchUserService fixtureService)
setService in interface SwitchUserServiceAware
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||