Package eu.bandm.tools.testsupport
Class MessageTester<D>
java.lang.Object
eu.bandm.tools.testsupport.MessageTester<D>
- Type Parameters:
D- the document identifier used by the locations
- All Implemented Interfaces:
MessageReceiver<SimpleMessage<D>>,Consumer<SimpleMessage<D>>
A message receiver which provides filtering, counting, analyzing of
the received messages, for test purposes.
For test driven debugging, the filtered messages can be printed for
the programmer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MessageStore<SimpleMessage<D>> final MessageStore<SimpleMessage<D>> protected final MessageCounterfinal MessageStore<SimpleMessage<D>> final MessageStore<SimpleMessage<D>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckMessages(MessageStore<SimpleMessage<D>> store, @Opt String... expected) The string values of the (formatted) messages in the given message store must correspond to the sequence of string constants.voidcheckMessagesPrefix(MessageStore<SimpleMessage<D>> store, @Opt String... expected) voidreceive(SimpleMessage<D> msg) Receive the given message.voidsetPrintFilter(Message.Kind... kinds) voidvoidsetTracelevel(int level) voidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.bandm.tools.message.MessageReceiver
accept, ifSubcriticalThen, ifSubcriticalThen, ifSubcriticalThenElse
-
Field Details
-
mcounter
-
warnings
-
errors
-
hints
-
messages
-
-
Constructor Details
-
MessageTester
public MessageTester()
-
-
Method Details
-
receive
Description copied from interface:MessageReceiverReceive the given message.- Specified by:
receivein interfaceMessageReceiver<D>- Parameters:
msg- the message to receive.
-
setTracelevel
public void setTracelevel(int level) -
setPrintFilter
-
setPrintFilter
-
showWarningsErrorsAndHints
public void showWarningsErrorsAndHints() -
showWarningsAndErrors
public void showWarningsAndErrors() -
checkMessages
The string values of the (formatted) messages in the given message store must correspond to the sequence of string constants.If the expected value contains guilemets »...« it must not contain double quotes. If the actual value contains double quotes (= comes from an older version of the tested software), all guilemets in the expected value are replaced by double quotes.
- Parameters:
store- MessageStore to checkexpected- list of expected string values. A null value stands for any string.
-
checkMessagesPrefix
-