Inheritance diagram for edu.cmu.hcii.calo.test.WizardOfOzTest:
Public Member Functions | |
void | setUp () throws Exception |
Test setup method. | |
void | tearDown () throws Exception |
Test teardown method. | |
void | testAddTask () throws Exception |
Tests the front end telling the engine to add a task. | |
void | testChangeNotificationPriority () throws Exception |
Tests the front end telling the engine to change a notification priority. | |
void | testChangeTaskPriority () throws Exception |
Tests the front end telling the engine to change a task priority. | |
void | clearMessages () |
Clears the list of messages, returning to the state that existed just after the test started. | |
Message | firstMessage () |
Retrieves the first (least recent) message received during this test. | |
boolean | hasMessages () |
Returns true if we have received any messages since the test began (or the last call to clearMessages()), false otherwise. | |
Iterator< Message > | iterator () |
Returns an iterator over the messages, in case direct access is needed. | |
Message | lastMessage () |
Retrieves the last (most recent) message received during this test. | |
void | onMessageReceived (Observable sender, Message msg) |
We override onMessageReceived so you don't have to™. | |
final void | update (Observable o, Object arg) |
| |
Protected Member Functions | |
void | expectMessage (Class<?extends Observable > managerClass, Class<?extends Message > messageClass, MessageType expectedType) |
Performs checks and assertions to ensure the following things are true:. | |
void | expectMessages (Class<?extends Observable > managerClasses[], Class<?extends Message > messageClasses[], MessageType expectedTypes[]) |
Performs checks and assertions to ensure the following things are true:. | |
void | expectUserInfoValueForKey (String key, Object value) |
Performs checks and assertions to ensure the following things are true:. | |
void | expectUserInfoValuesForKeys (String keys[], Object values[]) |
Performs checks and assertions to ensure the following things are true:. | |
Private Attributes | |
WizardOfOzFrontEnd | frontEnd = null |
Store the front end instance. |
void edu.cmu.hcii.calo.test.WizardOfOzTest.setUp | ( | ) | throws Exception |
Test setup method.
java.lang.Exception |
void edu.cmu.hcii.calo.test.WizardOfOzTest.tearDown | ( | ) | throws Exception |
Test teardown method.
Exception |
void edu.cmu.hcii.calo.test.WizardOfOzTest.testAddTask | ( | ) | throws Exception |
void edu.cmu.hcii.calo.test.WizardOfOzTest.testChangeNotificationPriority | ( | ) | throws Exception |
void edu.cmu.hcii.calo.test.WizardOfOzTest.testChangeTaskPriority | ( | ) | throws Exception |
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.clearMessages | ( | ) | [inherited] |
Clears the list of messages, returning to the state that existed just after the test started.
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.expectMessage | ( | Class<?extends Observable > | managerClass, | |
Class<?extends Message > | messageClass, | |||
MessageType | expectedType | |||
) | [protected, inherited] |
Performs checks and assertions to ensure the following things are true:.
1. We have received exactly one message since the start of the test.
2. The message we have received was from a manager of class managerClass
.
3. The message we have received is of the class messageClass
.
4. The message we have received has a MessageType equal to expectedType
.
managerClass | the manager class to check for | |
messageClass | the message class to check for | |
expectedType | the MessageType value to check for |
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.expectMessages | ( | Class<?extends Observable > | managerClasses[], | |
Class<?extends Message > | messageClasses[], | |||
MessageType | expectedTypes[] | |||
) | [protected, inherited] |
Performs checks and assertions to ensure the following things are true:.
1. The managerClasses
, messageClasses
, and expectedTypes
arrays all contain the same number of elements (if not, this is a runtime assertion, not a test failure).
2. We have received exactly as many messages since the start of the test as there are items in the messageClasses
array.
3. For each message i
we have received:
a. The message was from a manager of class managerClasses
[i
].
b. The message we have received is of the class messageClasses
[i
].
c. The message we have received has a MessageType equal to expectedTypes
[i
].
managerClasses | the manager classes to check for | |
messageClasses | the message classes to check for | |
expectedTypes | the MessageType values to check for |
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.expectUserInfoValueForKey | ( | String | key, | |
Object | value | |||
) | [protected, inherited] |
Performs checks and assertions to ensure the following things are true:.
1. We have received exactly one message since the start of the test.
2. The message we have received had a non-null userInfo map.
3. The value for key
in the userInfo map exists and is equal to value
.
key | the key to check for | |
value | the value to check for |
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.expectUserInfoValuesForKeys | ( | String | keys[], | |
Object | values[] | |||
) | [protected, inherited] |
Performs checks and assertions to ensure the following things are true:.
1. The keys and values arrays have the same number of elements (if not, this is a runtime assertion, not a test failure).
2. We have received exactly as many messages since the start of the test as there are items in the keys
array.
3. For each message i
we have received:
2. The message had a non-null userInfo map.
3. The value for key
in the userInfo map exists and is equal to value
.
keys | the keys to check for | |
values | the values to check for |
Message edu.cmu.hcii.calo.test.MessagePassingTestHarness.firstMessage | ( | ) | [inherited] |
Retrieves the first (least recent) message received during this test.
boolean edu.cmu.hcii.calo.test.MessagePassingTestHarness.hasMessages | ( | ) | [inherited] |
Returns true
if we have received any messages since the test began (or the last call to clearMessages()), false
otherwise.
true
if we have messages, false
if we don't Iterator<Message> edu.cmu.hcii.calo.test.MessagePassingTestHarness.iterator | ( | ) | [inherited] |
Returns an iterator over the messages, in case direct access is needed.
The iterator will return messages in order from least to most recent (earliest to latest received).
Message edu.cmu.hcii.calo.test.MessagePassingTestHarness.lastMessage | ( | ) | [inherited] |
void edu.cmu.hcii.calo.test.MessagePassingTestHarness.onMessageReceived | ( | Observable | sender, | |
Message | msg | |||
) | [virtual, inherited] |
We override onMessageReceived so you don't have to™.
This onMessageReceived method checks to make sure that the message's sender matches the sender
argument, but performs no other checks.
Implements edu.cmu.hcii.calo.messagePassing.MessageTarget.
final void edu.cmu.hcii.calo.messagePassing.MessageTarget.update | ( | Observable | o, | |
Object | arg | |||
) | [inherited] |
WizardOfOzFrontEnd edu.cmu.hcii.calo.test.WizardOfOzTest.frontEnd = null [private] |
Store the front end instance.