|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object raccoon.core.types.AbsComponent raccoon.core.types.AbsLoadable raccoon.core.types.AbsConfigurableLoadable raccoon.core.uitest.UiTester
public class UiTester
The primary unit testing service.
Field Summary | |
---|---|
static java.lang.String |
MESSAGES_NOT_RECEIVED
The user friendly message indicating a failure of the test. |
static java.lang.String |
UNIT_FILE
The name of the property UnitFile |
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable |
---|
mConfigurableManager |
Fields inherited from class raccoon.core.types.AbsLoadable |
---|
mIsLoaded |
Fields inherited from class raccoon.core.types.AbsComponent |
---|
mIsInError |
Constructor Summary | |
---|---|
UiTester()
Default constructor, required for dynamic instanciation |
Method Summary | |
---|---|
void |
configureParameters()
Configures the various parameters for this component. |
(package private) UiTestResult |
executeTest(UiTest pTest)
Executes a single test case. |
(package private) ReceivedMessage |
findMessage(IComparator pComparator,
java.util.ArrayList pResultOfComparator,
java.util.Map pMessages)
Checks if the given message is located in the list of messages. |
int |
getNbUnitCase()
The number of test contained in this instance. |
java.lang.String |
getUnitFile()
The XML file that contains the configuration for this Suite instance. |
(package private) UiTestResult |
isReceived(UiTest pTest)
Checks if the expected messages where all received. |
void |
load()
Invoked by the service manager to start this component once it has been configured. |
(package private) void |
loadExpected(UiTest pTest)
Retrieves from the file system the messages that are expected for this test. |
(package private) void |
loadIgnoreList(java.util.Iterator pWalker)
|
(package private) void |
loadSubscribers(java.util.Iterator pWalker)
Loads the subscribers via the service manager attached to this component. |
IUnitCaseResult |
run()
Executes the test case that was defined during the invocation of setUp(int) . |
(package private) void |
setServiceManager(IServiceManager pServiceManager)
For unit testing purposes exclusively! |
void |
setUnitFile(java.lang.String pFileName)
Defines the XML File that is to be used to configure this instance |
void |
setUp(int pUnitCaseId)
Prepares the system to execute the specified test case |
(package private) IUnitPlayer |
setUp(UiTest pTest)
Prepares the given unit test for execution. |
void |
tearDown()
Deactivates the current unit test |
(package private) void |
tearDown(UiTest pTest)
Tears down the specified test case. |
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable |
---|
isStable, setConfigurableManager, setLogger |
Methods inherited from class raccoon.core.types.AbsLoadable |
---|
getLog, isInError, isInitialised, isRunning, unload |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UNIT_FILE
public static final java.lang.String MESSAGES_NOT_RECEIVED
Constructor Detail |
---|
public UiTester()
Method Detail |
---|
public void configureParameters()
IConfigurableManager
provided during the invocation
of AbsConfigurableLoadable.setConfigurableManager(raccoon.api.types.IConfigurableManager)
.
configureParameters
in interface IConfigurable
configureParameters
in class AbsConfigurableLoadable
void setServiceManager(IServiceManager pServiceManager)
pServiceManager
- just to test internally this componentpublic java.lang.String getUnitFile()
public void setUnitFile(java.lang.String pFileName) throws RaccoonException, java.lang.IllegalArgumentException
setUnitFile
in interface IUnitTester
pFileName
- the name of the XML file to use.
RaccoonException
- if this component is already running: the component can't be changed.
Error code is ErrorCodes.COMPONENT_INITIALISED
java.lang.IllegalArgumentException
- if the parameter is null
, the message is obtained via
MsgHelper.formatNullParamter(java.lang.String, java.lang.Class)
public void load() throws LoadableException
false
and then set to true
once all the init code has been performed.
Checks if all the required properties are set.
load
in interface ILoadable
load
in class AbsConfigurableLoadable
LoadableException
- if this component isn't initialisable or is already running.public int getNbUnitCase()
getNbUnitCase
in interface IUnitTester
public void setUp(int pUnitCaseId) throws RaccoonException
setUp
in interface IUnitTester
pUnitCaseId
- the id of the test case to execute
RaccoonException
- if this component isn't loaded.
RaccoonException
- if the specified unit case doesn't exist.public IUnitCaseResult run() throws RaccoonException
setUp(int)
.
run
in interface IUnitTester
HashMap
where the key is the name of the UiTest and the value is
the result of the execution of the test.
RaccoonException
- if setUp(int)
wasn't invoked or if something went wrong.UiTestResult executeTest(UiTest pTest) throws RaccoonException
pTest
- the test case to execute.
RaccoonException
- if an error occurred during the execution of the test.IUnitPlayer setUp(UiTest pTest) throws RaccoonException
pTest
- the unit test to prepare for execution
RaccoonException
- the setup process fails.void loadSubscribers(java.util.Iterator pWalker) throws RaccoonException
pWalker
- an iterator of ComponentFile
representing the subscribers to load.
RaccoonException
- if a subscriber isn't defined in the current context.void loadIgnoreList(java.util.Iterator pWalker) throws RaccoonException
RaccoonException
void loadExpected(UiTest pTest) throws RaccoonException
pTest
- the test for which the expected messages are to be loaded.
RaccoonException
- if the one of the expected message is invalid.UiTestResult isReceived(UiTest pTest)
pTest
- the test for which the check is to be done.
null
if the expected message wasn't received.ReceivedMessage findMessage(IComparator pComparator, java.util.ArrayList pResultOfComparator, java.util.Map pMessages)
pMessages
- the list of messages that may contain the given message.
null
if the message wasn't located.void tearDown(UiTest pTest) throws RaccoonException
pTest
- the test case to tear down
RaccoonException
- if soemthing goes wrong.public void tearDown() throws RaccoonException
tearDown
in interface IUnitTester
RaccoonException
- if the tear down process fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |