@NotNull @Override protected Filter getFilter(@NotNull Project project, @NotNull GlobalSearchScope searchScope) { return super.getFilter(project, searchScope).and(new Filter() { @Override public boolean shouldAccept(AbstractTestProxy test) { Location location = test.getLocation(project, searchScope); return location instanceof PsiLocation && location.getPsiElement() instanceof GoFunctionOrMethodDeclaration; } }); }
MixOutputToGeneralTestEventsConverter(@NotNull String testFrameworkName, @NotNull TestConsoleProperties consoleProperties) { super(testFrameworkName, consoleProperties); splitter = new OutputLineSplitter(consoleProperties.isEditable()) { @Override protected void onLineAvailable(@NotNull String text, @NotNull Key outputType, boolean tcLikeFakeOutput) { subProcessConsistentText(text, outputType, tcLikeFakeOutput); } }; }
@Override public boolean shouldAccept(AbstractTestProxy test) { Location location = test.getLocation(project, searchScope); return location instanceof PsiLocation && location.getPsiElement() instanceof GoFunctionOrMethodDeclaration; } });
@Nullable @Override protected MyRunProfile getRunProfile(@NotNull ExecutionEnvironment environment) { return new MyRunProfile((RunConfigurationBase)myConsoleProperties.getConfiguration()) { @NotNull @Override public Module[] getModules() { return Module.EMPTY_ARRAY; } @Nullable @Override public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment environment) throws ExecutionException { RunConfigurationBase configurationBase = getPeer(); if (configurationBase instanceof GoTestRunConfiguration) { List<AbstractTestProxy> failedTests = getFailedTests(configurationBase.getProject()); if (failedTests.isEmpty()) { return null; } GoTestRunConfiguration goTestRunConfiguration = (GoTestRunConfiguration)configurationBase; Module module = goTestRunConfiguration.getConfigurationModule().getModule(); GoTestRunningState runningState = goTestRunConfiguration.newRunningState(environment, module); runningState.setFailedTests(failedTests); return runningState; } return null; } }; } }
private static Icon getTestStateIcon(@NotNull String url, @NotNull Project project) { TestStateStorage.Record state = TestStateStorage.getInstance(project).getState(url); if (state != null) { TestStateInfo.Magnitude magnitude = TestIconMapper.getMagnitude(state.magnitude); if (magnitude != null) { switch (magnitude) { case ERROR_INDEX: case FAILED_INDEX: return AllIcons.RunConfigurations.TestState.Red2; case PASSED_INDEX: case COMPLETE_INDEX: return AllIcons.RunConfigurations.TestState.Green2; default: } } } return AllIcons.RunConfigurations.TestState.Run; } }
final Location location = failedTest.getLocation(project, searchScope); if (location != null) { final PsiElement psiElement = location.getPsiElement();