public interface

ExamSystem

org.ops4j.pax.exam.ExamSystem

Class Overview

An instance that drives cross cutting concerns when using Pax Exam. - Provides System Resource Locations, - Cross Cutting default properties, - access to API entry (building probes, getting TestContainerFactory etc.)

Summary

Public Methods
abstract void clear()
Clears up resources taken by system (like temporary files)
abstract String createID(String purposeText)
Exam relies on uniquely used identifiers per system.
abstract TestProbeBuilder createProbe()
New Probe creator using this systems "caches".
abstract ExamSystem fork(Option[] options)
abstract File getConfigFolder()
abstract <T extends Option> T[] getOptions(Class<T> optionType)
Getting options of this "system".
abstract <T extends Option> T getSingleOption(Class<T> optionType)
A shortcut to getOptions(Class) when expecting a single value.
abstract File getTempFolder()
Each call to this method might create a new folder that is being cleared on clear().
abstract RelativeTimeout getTimeout()

Public Methods

public abstract void clear ()

Clears up resources taken by system (like temporary files)

public abstract String createID (String purposeText)

Exam relies on uniquely used identifiers per system. This method gives you one UUID.

Parameters
purposeText Human readable (short) text that can be used to backtrack the created identifier (for debugging and logging purposes)
Returns
  • a new and unqiue identifier.

public abstract TestProbeBuilder createProbe ()

New Probe creator using this systems "caches".

Returns
Throws
IOException in case of an IO problem.

public abstract ExamSystem fork (Option[] options)

Parameters
options options to be used additionally in this fork
Returns
  • a forked ExamSystem instance (new instance). The parent ExamSysten (the one you called fork on) will notice and take care to bring down forked instances on cleanup (for example).
Throws
IOException in case creation of the new ExamSystem fails. (IO related).

public abstract File getConfigFolder ()

Returns
  • the basic directory that Exam should use to look at user-defaults.

public abstract T[] getOptions (Class<T> optionType)

Getting options of this "system". This is the prime method on accessing options of a giving system.

Parameters
optionType type of option to be retrieved.
Returns
  • options matching the parameter type T. If none was found, this method returns an empty array.

public abstract T getSingleOption (Class<T> optionType)

A shortcut to getOptions(Class) when expecting a single value.

Parameters
optionType type of option to be retrieved.
Returns
  • option matching the parameter type T or null if no option was found. Implementations may rule of their own how to react when multiple values are found (check their javadoc).

public abstract File getTempFolder ()

Each call to this method might create a new folder that is being cleared on clear().

Returns
  • the basic directory that Exam should use for all IO write activities.

public abstract RelativeTimeout getTimeout ()

Returns
  • a relative indication of how to deal with timeouts.