Search in sources :

Example 6 with SMTRunnerConsoleProperties

use of com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties in project android by JetBrains.

the class AndroidTestAndJUnitConfigurationConflictsTest method testDoubleClickRedirection.

public void testDoubleClickRedirection() throws Exception {
    String commonTestClassName = "google.testartifacts.ExampleTest";
    loadProject(TEST_ARTIFACTS_SAME_NAME_CLASSES);
    Executor executor = DefaultRunExecutor.getRunExecutorInstance();
    RunConfiguration jUnitConfiguration = createJUnitConfigurationFromDirectory(getProject(), "app/src/test/java");
    RunConfiguration androidTestRunConfiguration = createAndroidTestConfigurationFromDirectory(getProject(), "app/src/androidTest/java");
    assertNotNull(jUnitConfiguration);
    assertNotNull(androidTestRunConfiguration);
    SMTRunnerConsoleProperties jUnitProperties = ((AndroidJUnitConfiguration) jUnitConfiguration).createTestConsoleProperties(executor);
    SMTRunnerConsoleProperties androidTestProperties = new AndroidTestConsoleProperties(androidTestRunConfiguration, executor);
    PsiClass[] jUnitClasses = JavaPsiFacade.getInstance(getProject()).findClasses(commonTestClassName, jUnitProperties.getScope());
    PsiClass[] aTestClasses = JavaPsiFacade.getInstance(getProject()).findClasses(commonTestClassName, androidTestProperties.getScope());
    assertSize(1, jUnitClasses);
    assertSize(1, aTestClasses);
    assertNotSame(jUnitClasses[0], aTestClasses[0]);
}
Also used : AndroidTestConsoleProperties(com.android.tools.idea.testartifacts.instrumented.AndroidTestConsoleProperties) DefaultRunExecutor(com.intellij.execution.executors.DefaultRunExecutor) Executor(com.intellij.execution.Executor) AndroidTestRunConfiguration(com.android.tools.idea.testartifacts.instrumented.AndroidTestRunConfiguration) RunConfiguration(com.intellij.execution.configurations.RunConfiguration) PsiClass(com.intellij.psi.PsiClass) AndroidJUnitConfiguration(com.android.tools.idea.testartifacts.junit.AndroidJUnitConfiguration) SMTRunnerConsoleProperties(com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties)

Example 7 with SMTRunnerConsoleProperties

use of com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties in project intellij-elixir by KronicDeth.

the class MixExUnitRunningState method execute.

@NotNull
@Override
public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
    ProcessHandler processHandler = startProcess();
    TestConsoleProperties properties = new SMTRunnerConsoleProperties(myConfiguration, TEST_FRAMEWORK_NAME, executor);
    ConsoleView console = createAndAttachConsole(TEST_FRAMEWORK_NAME, processHandler, properties);
    ElixirConsoleUtil.attachFilters(myConfiguration.getProject(), console);
    return new DefaultExecutionResult(console, processHandler, createActions(console, processHandler));
}
Also used : DefaultExecutionResult(com.intellij.execution.DefaultExecutionResult) ConsoleView(com.intellij.execution.ui.ConsoleView) ProcessHandler(com.intellij.execution.process.ProcessHandler) SMTRunnerConsoleProperties(com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties) TestConsoleProperties(com.intellij.execution.testframework.TestConsoleProperties) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SMTRunnerConsoleProperties (com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties)7 BaseTestsOutputConsoleView (com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView)3 NotNull (org.jetbrains.annotations.NotNull)3 DefaultExecutionResult (com.intellij.execution.DefaultExecutionResult)2 DefaultRunExecutor (com.intellij.execution.executors.DefaultRunExecutor)2 ProcessHandler (com.intellij.execution.process.ProcessHandler)2 ProgramRunner (com.intellij.execution.runners.ProgramRunner)2 AbstractRerunFailedTestsAction (com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction)2 ConsoleView (com.intellij.execution.ui.ConsoleView)2 Project (com.intellij.openapi.project.Project)2 AndroidTestConsoleProperties (com.android.tools.idea.testartifacts.instrumented.AndroidTestConsoleProperties)1 AndroidTestRunConfiguration (com.android.tools.idea.testartifacts.instrumented.AndroidTestRunConfiguration)1 AndroidJUnitConfiguration (com.android.tools.idea.testartifacts.junit.AndroidJUnitConfiguration)1 GenericDebuggerRunnerSettings (com.intellij.debugger.impl.GenericDebuggerRunnerSettings)1 Executor (com.intellij.execution.Executor)1 RunConfiguration (com.intellij.execution.configurations.RunConfiguration)1 RunProfile (com.intellij.execution.configurations.RunProfile)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 ProcessAdapter (com.intellij.execution.process.ProcessAdapter)1 ProcessEvent (com.intellij.execution.process.ProcessEvent)1