protected void doTest() throws Exception { 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(); for (String line : FileUtil.loadLines( new File(getTestDataPath(), getTestName(true) + ".txt"), CharsetToolkit.UTF8)) { converter.processServiceMessages( line + "\n", ProcessOutputTypes.STDOUT, serviceMessageVisitor); } assertSameLinesWithFile( getTestDataPath() + "/" + getTestName(true) + "-expected.txt", serviceMessageVisitor.getLog()); }
@NotNull @Override protected Map<String, String> compute() { if (isUnix && !isMac) { try { List<String> lines = FileUtil.loadLines("/etc/os-release"); Map<String, String> info = ContainerUtil.newHashMap(); for (String line : lines) { int p = line.indexOf('='); if (p > 0) { String name = line.substring(0, p); String value = StringUtil.unquoteString(line.substring(p + 1)); if (!StringUtil.isEmptyOrSpaces(name) && !StringUtil.isEmptyOrSpaces(value)) { info.put(name, value); } } } return info; } catch (IOException ignored) { } } return Collections.emptyMap(); }