org.nakedobjects.runtime.fixturesinstaller
Class FixturesInstallerDelegate

java.lang.Object
  extended by org.nakedobjects.runtime.fixturesinstaller.FixturesInstallerDelegate

public class FixturesInstallerDelegate
extends java.lang.Object

Helper for FixturesInstaller implementations.

Does the mechanics of actually installing the fixtures.


Field Summary
protected  java.util.List<java.lang.Object> fixtures
           
 
Constructor Summary
FixturesInstallerDelegate()
          The PersistenceSession used will be that from NakedObjectsContext.
FixturesInstallerDelegate(PersistenceSession persistenceSession)
          For testing, supply own PersistenceSession rather than lookup from context.
 
Method Summary
 void addFixture(java.lang.Object fixture)
          Automatically flattens any Lists, recursively (depth-first) if necessary.
 void clearFixtures()
          Allows the set of fixtures to be cleared (for whatever reason).
protected  java.util.List<java.lang.Object> getFixtures()
          Returns all fixtures that have been added.
 LogonFixture getLogonFixture()
          The LogonFixture, if any.
 void installFixtures()
          Installs all {added fixtures fixtures (ie as returned by getFixtures()).
protected  void postInstallFixtures(PersistenceSession persistenceSession)
          Hook - default does nothing.
protected  void preInstallFixtures(PersistenceSession persistenceSession)
          Hook - default does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fixtures

protected final java.util.List<java.lang.Object> fixtures
Constructor Detail

FixturesInstallerDelegate

public FixturesInstallerDelegate()
The PersistenceSession used will be that from NakedObjectsContext.


FixturesInstallerDelegate

public FixturesInstallerDelegate(PersistenceSession persistenceSession)
For testing, supply own PersistenceSession rather than lookup from context.

Parameters:
persistenceSession -
Method Detail

addFixture

public void addFixture(java.lang.Object fixture)
Automatically flattens any Lists, recursively (depth-first) if necessary.


getFixtures

protected java.util.List<java.lang.Object> getFixtures()
Returns all fixtures that have been added.


clearFixtures

public void clearFixtures()
Allows the set of fixtures to be cleared (for whatever reason).


installFixtures

public final void installFixtures()
Installs all {added fixtures fixtures (ie as returned by getFixtures()).

The set of fixtures (as per getFixtures()) is not cleared after installation; this allows the FixtureBuilderAbstract to be reused across multiple tests.


preInstallFixtures

protected void preInstallFixtures(PersistenceSession persistenceSession)
Hook - default does nothing.


postInstallFixtures

protected void postInstallFixtures(PersistenceSession persistenceSession)
Hook - default does nothing.


getLogonFixture

public LogonFixture getLogonFixture()
The LogonFixture, if any.

Used to automatically logon if in DeploymentType.PROTOTYPE mode.



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