use of com.android.tools.idea.testartifacts.instrumented.AndroidTestConsoleProperties 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]);
}
Aggregations