cz.cuni.amis.utils
Class TestOutput

java.lang.Object
  extended by cz.cuni.amis.utils.TestOutput

public class TestOutput
extends java.lang.Object

Used to produce text strings during tests, those strings are then consumed by the test case.

Used to control that everything is OK in tested objects / classes.


Constructor Summary
TestOutput(java.lang.String name)
           
 
Method Summary
 void clear()
          Clear the queue.
 boolean consume(java.lang.String output)
          Consume string symbol from the queue - false is failure (string didn't match).
 boolean consume(java.lang.String[] output)
          Try to consume many strings, false - one of them didn't match, failure.
 boolean consumeAnyOrder(java.lang.String[] output)
          Consume output in any order, returns false if first output.length string in the queue can't be matched to the output strings.
 boolean consumeMany(java.lang.String... outputs)
          Consume many strings from the output - if not equals, returns false as failure.
 boolean isClear(boolean printIfNot)
          Whether the queue is clear.
static boolean isLog()
          Do we print the messages to the console (simple logging),
 void printOutput()
           
 void push(java.lang.String output)
          Adds next String to the queue.
static void setLog(boolean log)
          Set simple console logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestOutput

public TestOutput(java.lang.String name)
Method Detail

push

public void push(java.lang.String output)
Adds next String to the queue.

Parameters:
output -

consumeMany

public boolean consumeMany(java.lang.String... outputs)
Consume many strings from the output - if not equals, returns false as failure.

Parameters:
outputs -
Returns:

consume

public boolean consume(java.lang.String output)
Consume string symbol from the queue - false is failure (string didn't match).

Parameters:
output -
Returns:

consume

public boolean consume(java.lang.String[] output)
Try to consume many strings, false - one of them didn't match, failure.

Parameters:
output -
Returns:

consumeAnyOrder

public boolean consumeAnyOrder(java.lang.String[] output)
Consume output in any order, returns false if first output.length string in the queue can't be matched to the output strings.

Parameters:
output -
Returns:

isClear

public boolean isClear(boolean printIfNot)
Whether the queue is clear.

Returns:

clear

public void clear()
Clear the queue.


printOutput

public void printOutput()

isLog

public static boolean isLog()
Do we print the messages to the console (simple logging),

Returns:

setLog

public static void setLog(boolean log)
Set simple console logging.

Parameters:
log -