org.equanda.util
Class MockObject

java.lang.Object
  extended by org.equanda.util.MockObject

public class MockObject
extends Object

Simple object for testing, allows white box verifications in testcases.

Author:
Joachim Van der Auwera

Constructor Summary
MockObject()
           
 
Method Summary
 void add(String msg)
          Add a message which can be verified
 void clear()
          Clear all the registered messages
 String get()
          Get the next message from the queue (also removes the message).
 String getAll()
          Get a string with all the messages in the queue, one on each line, does not change the queue.
 boolean verify(String msg)
          Verify whether the next message is as expected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockObject

public MockObject()
Method Detail

add

public void add(String msg)
Add a message which can be verified

Parameters:
msg -

clear

public void clear()
Clear all the registered messages


verify

public boolean verify(String msg)
Verify whether the next message is as expected

Parameters:
msg -
Returns:
true when equals

get

public String get()
Get the next message from the queue (also removes the message).

Returns:
next message

getAll

public String getAll()
Get a string with all the messages in the queue, one on each line, does not change the queue.

Returns:
next message


Copyright © 2007-2009. All Rights Reserved.