FixtureScripts

Provides the mechanism to execute FixtureScript s from the UI of a domain app; and can also be used within integration testing.

API

FixtureScripts.java
class FixtureScripts {
  // secman seeding
public static final String LOGICAL_TYPE_NAME;
  public static final String PACKAGE_PREFIX;     (1)
  FixtureScripts(final FixtureScriptsSpecificationProvider fixtureScriptsSpecificationProvider, final ServiceRegistry serviceRegistry)
  List<FixtureResult> runFixtureScript(final String fixtureScriptName, final String parameters)     (2)
  List<FixtureResult> runFixtureScript(final FixtureScript fixtureScript, final String parameters)
  boolean hideRunFixtureScript()
  String disableRunFixtureScript()
  String default0RunFixtureScript()
  Set<String> choices0RunFixtureScript()
  String validateRunFixtureScript(final String fixtureScriptName, final String parameters)
  Object recreateObjectsAndReturnFirst()     (3)
  boolean hideRecreateObjectsAndReturnFirst()
  void run(final FixtureScript... fixtureScriptList)
  void runPersonas(PersonaWithBuilderScript<? extends BuilderScriptAbstract<?>>... personaScripts)
  T runPersona(final PersonaWithBuilderScript<? extends BuilderScriptAbstract<? extends T>> persona)
  T runBuilder(final BuilderScriptAbstract<T> builderScript)     (4)
  T runBuilderScriptNonTransactional(final BuilderScriptAbstract<T> builderScript)     (5)
  String findFixtureScriptNameFor(final Class<? extends FixtureScript> fixtureScriptClass)
  FixtureScript.ExecutionContext newExecutionContext(final String parameters)
  String mementoFor(final FixtureScript fs)
  void initOf(final String xml, final FixtureScript fs)
  FixtureResult newFixtureResult(final FixtureScript script, final String subkey, final Object object, final boolean firstTime)
  String titleOf(final FixtureResult fixtureResult)
  T fixtureScript(final PersonaWithBuilderScript<BuilderScriptAbstract<T>> persona)     (6)
  void runFixtureScript(final FixtureScript... fixtureScriptList)     (7)
  T runBuilderScript(final BuilderScriptAbstract<T> builderScript)     (8)
}
1 PACKAGE_PREFIX

The package prefix to search for fixture scripts. This default value will result in no fixture scripts being found. However, normally it will be overridden.

2 runFixtureScript(String, String)

Main action - as exposed in the UI - to execute the specified fixture script.

3 recreateObjectsAndReturnFirst()

Convenience action - exposed through the UI - to execute the specified "recreate" FixtureScript and return/show the first object returned by that fixture script.

4 runBuilder(BuilderScriptAbstract)

Runs the builderScript within its own transactional boundary.

5 runBuilderScriptNonTransactional(BuilderScriptAbstract)

Runs the builderScript without its own transactional boundary.The caller is responsible to provide a transactional context/boundary.

6 fixtureScript(PersonaWithBuilderScript)

deprecated:

renamed to #runPersona(PersonaWithBuilderScript)

7 runFixtureScript(FixtureScript)

deprecated:

renamed to #run(FixtureScript…​)

8 runBuilderScript(BuilderScriptAbstract)

deprecated:

renamed to #runBuilder(BuilderScriptAbstract)

Members

PACKAGE_PREFIX

The package prefix to search for fixture scripts. This default value will result in no fixture scripts being found. However, normally it will be overridden.

runFixtureScript(String, String)

Main action - as exposed in the UI - to execute the specified fixture script.

Also allows arbitrary parameters to be specified for said fixture script.

recreateObjectsAndReturnFirst()

Convenience action - exposed through the UI - to execute the specified "recreate" FixtureScript and return/show the first object returned by that fixture script.

runBuilder(BuilderScriptAbstract)

Runs the builderScript within its own transactional boundary.

runBuilderScriptNonTransactional(BuilderScriptAbstract)

Runs the builderScript without its own transactional boundary.The caller is responsible to provide a transactional context/boundary.

fixtureScript(PersonaWithBuilderScript)

deprecated:

renamed to #runPersona(PersonaWithBuilderScript)

runFixtureScript(FixtureScript)

deprecated:

renamed to #run(FixtureScript…​)

runBuilderScript(BuilderScriptAbstract)

deprecated:

renamed to #runBuilder(BuilderScriptAbstract)

Configuration Properties

The configuration properties used by this domain service can be found in the relevant section of the config guide.