Package eu.bandm.tools.test
Class TestFrame_messages<D>
java.lang.Object
eu.bandm.tools.test.TestFrame
eu.bandm.tools.test.TestFrame_messages<D>
Base class with convenience methods for JUnit tests.
Currently we are using "junit 4" = https://junit.org/junit4/"
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.bandm.tools.test.TestFrame
TestFrame.ArrayCanvas -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MessageStore<SimpleMessage<D>> protected final MessageStore<SimpleMessage<D>> protected intprotected final MessageCounterMake it accessible by sub-classes!protected final MessageStore<SimpleMessage<D>> final MessageReceiver<SimpleMessage<D>> Shall be used as a receiver of all messages generated by test code.protected final MessageStore<SimpleMessage<D>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidcheckMessages(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.protected voidprotected voidexpectNo()protected voidprotected voidprotected voidmatchMessages(MessageStore<SimpleMessage<D>> store, @Opt Pattern<? super Integer> size, Pattern<? super Message>... expectedPrefix) protected voidprintEnd()protected voidprotected voidprintStart(boolean interactive) protected voidrequestReturn(String text) protected voidsetPrintFilter(Message.Kind... kinds) protected voidvoidsetTracelevel(int level) protected voidprotected voidMethods inherited from class eu.bandm.tools.test.TestFrame
filesystemRelativeProjectRoot, methodName, writeTmpFile, writeTmpFile
-
Field Details
-
mcounter
Make it accessible by sub-classes! -
warnings
-
errors
-
hints
-
messages
-
msg
Shall be used as a receiver of all messages generated by test code. -
interactionNumber
protected int interactionNumber
-
-
Constructor Details
-
TestFrame_messages
public TestFrame_messages()
-
-
Method Details
-
setTracelevel
public void setTracelevel(int level) -
setPrintFilter
-
setPrintFilter
-
showWarningsErrorsAndHints
protected void showWarningsErrorsAndHints() -
showWarningsAndErrors
protected void showWarningsAndErrors() -
matchMessages
protected void matchMessages(MessageStore<SimpleMessage<D>> store, @Opt @Opt Pattern<? super Integer> size, Pattern<? super Message>... expectedPrefix) -
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 uses guilemets »...« it is assumed NOT to use double quotes. If the actual value uses double quotes (= is an OLDER version), all guilemets in the expected value are replaced by double quotes.
- Parameters:
store- MessageStore to checkexpected- list of expected string values. A "null" stands for any string.
-
printStart
protected void printStart() -
printStart
protected void printStart(boolean interactive) -
printEnd
protected void printEnd() -
expectYes
protected void expectYes() -
expectNo
protected void expectNo() -
incrementAndPrintInteractionNumber
protected void incrementAndPrintInteractionNumber() -
doit
-
askYes
-
askNo
-
requestReturn
-