CompilerConfiguration () { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.put(CommonConfigurationKeys.MODULE_NAME, TEST_MODULE_NAME); configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, new MessageCollector() { @Override public void clear() { } @Override public void report( @NotNull CompilerMessageSeverity severity, @NotNull String message, @Nullable CompilerMessageSourceLocation location ) { if (severity == CompilerMessageSeverity.ERROR) { String prefix = location == null ? "" : "(" + location.getPath() + ":" + location.getLine() + ":" + location.getColumn() + ") "; throw new AssertionError(prefix + message); } } @Override public boolean hasErrors() { return false; } }); return configuration; }