use of com.android.tools.idea.testartifacts.junit.AndroidTestPackage in project android by JetBrains.
the class AndroidTestAndJUnitConfigurationConflictsTest method checkClassesInAllInPackage.
private void checkClassesInAllInPackage(TestSearchScope type) throws CantRunException {
Module module = ModuleManager.getInstance(myFixture.getProject()).findModuleByName("app");
assertNotNull(module);
AndroidJUnitConfiguration configuration = createConfiguration(getProject(), "google.simpleapplication", module);
configuration.getPersistentData().setScope(type);
AndroidTestPackage testPackage = new AndroidTestPackage(configuration, ExecutionEnvironmentBuilder.create(DefaultRunExecutor.getRunExecutorInstance(), configuration).build());
Set<PsiClass> myClasses = new HashSet<>();
ConfigurationUtil.findAllTestClasses(testPackage.getClassFilter(configuration.getPersistentData()), null, myClasses);
assertSize(1, myClasses);
TestArtifactSearchScopes scopes = TestArtifactSearchScopes.get(module);
assertNotNull(scopes);
assertTrue(scopes.isUnitTestSource(myClasses.iterator().next().getContainingFile().getVirtualFile()));
}
Aggregations