Search in sources :

Example 1 with TestClassFilter

use of com.intellij.execution.junit.TestClassFilter in project android by JetBrains.

the class AndroidTestsPattern method getClassFilter.

@Override
protected TestClassFilter getClassFilter(JUnitConfiguration.Data data) throws CantRunException {
    TestClassFilter classFilter = super.getClassFilter(data);
    JUnitConfiguration configuration = getConfiguration();
    Module[] modules = configuration instanceof AndroidJUnitConfiguration ? ((AndroidJUnitConfiguration) configuration).getModulesToCompile() : configuration.getModules();
    for (Module module : modules) {
        TestArtifactSearchScopes testArtifactSearchScopes = TestArtifactSearchScopes.get(module);
        if (testArtifactSearchScopes != null) {
            classFilter = classFilter.intersectionWith(testArtifactSearchScopes.getAndroidTestExcludeScope());
        }
    }
    return classFilter;
}
Also used : TestArtifactSearchScopes(com.android.tools.idea.testartifacts.scopes.TestArtifactSearchScopes) JUnitConfiguration(com.intellij.execution.junit.JUnitConfiguration) Module(com.intellij.openapi.module.Module) TestClassFilter(com.intellij.execution.junit.TestClassFilter)

Example 2 with TestClassFilter

use of com.intellij.execution.junit.TestClassFilter in project android by JetBrains.

the class AndroidTestPackage method getClassFilter.

@Override
@VisibleForTesting
public TestClassFilter getClassFilter(JUnitConfiguration.Data data) throws CantRunException {
    TestClassFilter classFilter = super.getClassFilter(data);
    JUnitConfiguration configuration = getConfiguration();
    Module[] modules = configuration instanceof AndroidJUnitConfiguration ? ((AndroidJUnitConfiguration) configuration).getModulesToCompile() : configuration.getModules();
    for (Module module : modules) {
        TestArtifactSearchScopes testArtifactSearchScopes = TestArtifactSearchScopes.get(module);
        if (testArtifactSearchScopes != null) {
            classFilter = classFilter.intersectionWith(testArtifactSearchScopes.getAndroidTestExcludeScope());
        }
    }
    return classFilter;
}
Also used : TestArtifactSearchScopes(com.android.tools.idea.testartifacts.scopes.TestArtifactSearchScopes) JUnitConfiguration(com.intellij.execution.junit.JUnitConfiguration) Module(com.intellij.openapi.module.Module) TestClassFilter(com.intellij.execution.junit.TestClassFilter) VisibleForTesting(com.android.annotations.VisibleForTesting)

Aggregations

TestArtifactSearchScopes (com.android.tools.idea.testartifacts.scopes.TestArtifactSearchScopes)2 JUnitConfiguration (com.intellij.execution.junit.JUnitConfiguration)2 TestClassFilter (com.intellij.execution.junit.TestClassFilter)2 Module (com.intellij.openapi.module.Module)2 VisibleForTesting (com.android.annotations.VisibleForTesting)1