edu.cmu.hcii.calo.test.WizardOfOzTest Class Reference

Inherits edu.cmu.hcii.calo.test.MessagePassingTestHarness.

Inheritance diagram for edu.cmu.hcii.calo.test.WizardOfOzTest:

Inheritance graph
[legend]
Collaboration diagram for edu.cmu.hcii.calo.test.WizardOfOzTest:

Collaboration graph
[legend]
List of all members.

Detailed Description

Tests that we match spec with our Wizard of Oz front end and engine.

Author:
Will Haines


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< Messageiterator ()
 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)
 
See also:
java.util.Observer.update(java.util.Observable, java.lang.Object)


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.


Member Function Documentation

void edu.cmu.hcii.calo.test.WizardOfOzTest.setUp (  )  throws Exception

Test setup method.

Exceptions:
java.lang.Exception 

void edu.cmu.hcii.calo.test.WizardOfOzTest.tearDown (  )  throws Exception

Test teardown method.

Exceptions:
Exception 

void edu.cmu.hcii.calo.test.WizardOfOzTest.testAddTask (  )  throws Exception

Tests the front end telling the engine to add a task.

Exceptions:
Exception 

void edu.cmu.hcii.calo.test.WizardOfOzTest.testChangeNotificationPriority (  )  throws Exception

Tests the front end telling the engine to change a notification priority.

Exceptions:
Exception 

void edu.cmu.hcii.calo.test.WizardOfOzTest.testChangeTaskPriority (  )  throws Exception

Tests the front end telling the engine to change a task priority.

Exceptions:
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.

Parameters:
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].

Parameters:
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.

Parameters:
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.

Note:
This method does NOT check for multiple key-value pairs in the same message. It checks for a single key-value pair in each message. To get the former behavior, simply call expectUserInfoValueForKey(String, Object) multiple times.
Parameters:
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.

Returns:
the least recent message

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.

Returns:
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).

Returns:
an iterator over the messages
See also:
java.util.Collection.iterator()

Message edu.cmu.hcii.calo.test.MessagePassingTestHarness.lastMessage (  )  [inherited]

Retrieves the last (most recent) message received during this test.

Returns:
the most recent message

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]

See also:
java.util.Observer.update(java.util.Observable, java.lang.Object)


Member Data Documentation

WizardOfOzFrontEnd edu.cmu.hcii.calo.test.WizardOfOzTest.frontEnd = null [private]

Store the front end instance.


The documentation for this class was generated from the following file:
Generated on Mon Jul 9 12:34:40 2007 for CALO by  doxygen 1.5.2