cz.cuni.amis.utils
Class TestOutput

Package class diagram package TestOutput
java.lang.Object
  extended by cz.cuni.amis.utils.TestOutput

public class TestOutput
extends 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.

Author:
Jimmy

Constructor Summary
TestOutput(String name)
           
 
Method Summary
 void clear()
          Clear the queue.
 boolean consume(String output)
          Consume string symbol from the queue - false is failure (string didn't match).
 boolean consume(String[] output)
          Try to consume many strings, false - one of them didn't match, failure.
 boolean consumeAnyOrder(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(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(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(String name)
Method Detail

push

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

Parameters:
output -

consumeMany

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

Parameters:
outputs -
Returns:

consume

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

Parameters:
output -
Returns:

consume

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

Parameters:
output -
Returns:

consumeAnyOrder

public boolean consumeAnyOrder(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 -


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.