void () { myRootSuite.setShouldPrintOwnContentOnly(true); myConsole.getPrinter().updateOnTestSelected(myResultsViewer.getTestsRootNode()); myEventsProcessor.onStartTesting(); myEventsProcessor.onUncapturedOutput("root output 1\n", ProcessOutputTypes.STDOUT); myEventsProcessor.onSuiteStarted(new TestSuiteStartedEvent("suite", null)); SMTestProxy suite = myEventsProcessor.getCurrentSuite(); myEventsProcessor.onUncapturedOutput("suite output\n", ProcessOutputTypes.STDOUT); myEventsProcessor.onTestStarted(new TestStartedEvent("my test", null)); myEventsProcessor.onUncapturedOutput("test output\n", ProcessOutputTypes.STDOUT); myEventsProcessor.onTestFinished(new TestFinishedEvent("my test", null)); myEventsProcessor.onSuiteFinished(new TestSuiteFinishedEvent("suite")); myEventsProcessor.onUncapturedOutput("root output 2\n", ProcessOutputTypes.STDOUT); myEventsProcessor.onFinishTesting(); assertAllOutputs(myMockResettablePrinter, """ root output 1 root output 2 """, "", ""); myMockResettablePrinter.resetIfNecessary(); myConsole.getPrinter().updateOnTestSelected(suite); assertAllOutputs(myMockResettablePrinter, """ suite output test output """, "", ""); myMockResettablePrinter.resetIfNecessary(); myConsole.getPrinter().updateOnTestSelected(myResultsViewer.getTestsRootNode()); assertAllOutputs(myMockResettablePrinter, """ root output 1 root output 2 """, "", ""); myRootSuite.setShouldPrintOwnContentOnly(false); myMockResettablePrinter.resetIfNecessary(); myConsole.getPrinter().updateOnTestSelected(suite); assertAllOutputs(myMockResettablePrinter, """ suite output test output """, "", ""); myMockResettablePrinter.resetIfNecessary(); myConsole.getPrinter().updateOnTestSelected(myResultsViewer.getTestsRootNode()); assertAllOutputs(myMockResettablePrinter, """ root output 1 suite output test output root output 2 """, "", ""); }