raccoon.core.uitest.data
Class UiTestResult

java.lang.Object
  extended by raccoon.core.uitest.data.UiTestResult
All Implemented Interfaces:
IUnitTestResult

public class UiTestResult
extends java.lang.Object
implements IUnitTestResult

Contains the result of a single test run.

Since:
Raccoon v0.7
Version:
$Id: UiTestResult.java,v 1.1 2004/08/08 20:19:18 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
 
Fields inherited from interface raccoon.api.eai.uitest.report.IUnitTestResult
ERROR, FAILED, SUCCESSFUL, WARNING
 
Constructor Summary
UiTestResult(int pResult, long pExecutionTime)
          Convenience constructor.
 
Method Summary
 void addReceived(ReceivedMessage pReceived)
           
 void addRecorded(java.lang.String pRecorded)
           
 void addStillWaiting(java.lang.String pStillWaiting, java.util.ArrayList pResultOfComparator)
          Adds a still waiting for event
 long getExecutionTime()
          The time (in milliseconds) it took for this test to run.
 java.lang.String getName()
          Retrieves the name of the test this result corresponds to.
 java.util.ArrayList getReceived()
          The list of received events
 IReceivedMessage getReceivedMessageAt(int pIndex)
          Gets the expected message that was received at the specified index.
 java.util.List getReceivedMessages()
          Retrieves the list of received expected messages.
 java.util.ArrayList getRecorded()
           
 java.util.HashMap getStillWaiting()
          The list of events that haven't been received.
 int getTestResult()
          The result of the execution of the test.
 java.lang.String getUserMessage()
          A message that is user friendly.
 int receivedMsgSize()
          The number of expected messages that were received.
 void setExecutionTime(long pExecutionTime)
          Defines the execution time
 void setMessage(java.lang.String pMessage)
          Defines the result message of this test.
 void setName(java.lang.String pName)
          Defines the name of the test associated to this result.
 void setReceived(java.util.ArrayList pReceived)
          Defines the list of received events.
 void setRecorded(java.util.ArrayList pRecorded)
           
 void setResult(int pResult)
          Defines the result of this test
 void setStillWaiting(java.util.HashMap pStillWaiting)
          Defines the list of still pending events.
 java.lang.String toString()
          Generates a short string with the main elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UiTestResult

public UiTestResult(int pResult,
                    long pExecutionTime)
Convenience constructor.

Parameters:
pResult - the result of the execution
pExecutionTime - the time it took to execute the test.
Method Detail

setName

public void setName(java.lang.String pName)
Defines the name of the test associated to this result.

Parameters:
pName - the name of the test.

getName

public java.lang.String getName()
Retrieves the name of the test this result corresponds to.

Specified by:
getName in interface IUnitTestResult
Returns:
the name of the test.

getUserMessage

public java.lang.String getUserMessage()
A message that is user friendly. If this test failed or went in error then this string will provide useful information for the user.

Specified by:
getUserMessage in interface IUnitTestResult
Returns:
the message related to the results of the execution of this test.

getTestResult

public int getTestResult()
The result of the execution of the test.

Specified by:
getTestResult in interface IUnitTestResult
Returns:
one of IUnitTestResult.SUCCESSFUL, IUnitTestResult.FAILED, IUnitTestResult.WARNING or IUnitTestResult.ERROR.

receivedMsgSize

public int receivedMsgSize()
The number of expected messages that were received.

Specified by:
receivedMsgSize in interface IUnitTestResult
Returns:
the number of received messages.

getReceivedMessageAt

public IReceivedMessage getReceivedMessageAt(int pIndex)
Gets the expected message that was received at the specified index.

Specified by:
getReceivedMessageAt in interface IUnitTestResult
Parameters:
pIndex - the index of the expected message that was received.
Returns:
the information related to the expected message.
See Also:
receivedMsgSize()

getReceivedMessages

public java.util.List getReceivedMessages()
Retrieves the list of received expected messages.

Specified by:
getReceivedMessages in interface IUnitTestResult
Returns:
the information related to the messages that were received as expected.
See Also:
getReceivedMessageAt(int), receivedMsgSize()

getExecutionTime

public long getExecutionTime()
The time (in milliseconds) it took for this test to run.

Specified by:
getExecutionTime in interface IUnitTestResult
Returns:
the time elapsed since the first message was fired and the last expected message received.

setResult

public void setResult(int pResult)
Defines the result of this test

Parameters:
pResult - the result of the execution of this test

setExecutionTime

public void setExecutionTime(long pExecutionTime)
Defines the execution time

Parameters:
pExecutionTime - the time it took to execute this test.

setMessage

public void setMessage(java.lang.String pMessage)
Defines the result message of this test.

Parameters:
pMessage - the message for the human operator.

getStillWaiting

public java.util.HashMap getStillWaiting()
The list of events that haven't been received.

Specified by:
getStillWaiting in interface IUnitTestResult
Returns:
the list of still waiting elements.

setStillWaiting

public void setStillWaiting(java.util.HashMap pStillWaiting)
Defines the list of still pending events.

Parameters:
pStillWaiting - the non-received inbound events.

addStillWaiting

public void addStillWaiting(java.lang.String pStillWaiting,
                            java.util.ArrayList pResultOfComparator)
Adds a still waiting for event

Parameters:
pStillWaiting - the name of the event (defined in the configuration file)

getReceived

public java.util.ArrayList getReceived()
The list of received events

Returns:
the list of received events

setReceived

public void setReceived(java.util.ArrayList pReceived)
Defines the list of received events.

Parameters:
pReceived - the list of received events.

addReceived

public void addReceived(ReceivedMessage pReceived)

getRecorded

public java.util.ArrayList getRecorded()

setRecorded

public void setRecorded(java.util.ArrayList pRecorded)

addRecorded

public void addRecorded(java.lang.String pRecorded)

toString

public java.lang.String toString()
Generates a short string with the main elements.

Overrides:
toString in class java.lang.Object
Returns:
the string, short version


Copyright null null. All Rights Reserved.