use of com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoEventsConverterTestCase method doTest.
protected void doTest() {
Executor executor = new DefaultRunExecutor();
GoTestRunConfiguration runConfig = new GoTestRunConfiguration(myFixture.getProject(), "", GoTestRunConfigurationType.getInstance());
runConfig.setTestFramework(getTestFramework());
GoTestConsoleProperties consoleProperties = new GoTestConsoleProperties(runConfig, executor);
GoTestEventsConverterBase converter = (GoTestEventsConverterBase) consoleProperties.createTestEventsConverter("gotest", consoleProperties);
LoggingServiceMessageVisitor serviceMessageVisitor = new LoggingServiceMessageVisitor();
try {
for (String line : FileUtil.loadLines(new File(getTestDataPath(), getTestName(true) + ".txt"), CharsetToolkit.UTF8)) {
converter.processServiceMessages(line + "\n", ProcessOutputTypes.STDOUT, serviceMessageVisitor);
}
} catch (IOException | ParseException e) {
throw new RuntimeException(e);
}
((OutputToGeneralTestEventsConverter) converter).flushBufferBeforeTerminating();
Disposer.dispose((OutputToGeneralTestEventsConverter) converter);
assertSameLinesWithFile(getTestDataPath() + "/" + getTestName(true) + "-expected.txt", serviceMessageVisitor.getLog());
}
Aggregations