Search in sources :

Example 1 with JUnitPatcher

use of com.intellij.execution.JUnitPatcher in project android by JetBrains.

the class AndroidJunitPatcherWithTestArtifactTest method testRemoveAndroidTestClasspath.

public void testRemoveAndroidTestClasspath() throws Exception {
    loadProject(SYNC_MULTIPROJECT);
    JUnitPatcher myPatcher = new AndroidJunitPatcher();
    Module module1 = ModuleManager.getInstance(myFixture.getProject()).findModuleByName("module1");
    JavaParameters parameters = new JavaParameters();
    parameters.configureByModule(module1, JavaParameters.CLASSES_AND_TESTS);
    String classpath = parameters.getClassPath().getPathsString();
    assertThat(classpath).contains("junit-4.12.jar");
    assertThat(classpath).contains("gson-2.2.4.jar");
    // JUnit is in test dependency, gson and guava are android test dependency
    myPatcher.patchJavaParameters(module1, parameters);
    classpath = parameters.getClassPath().getPathsString();
    assertThat(classpath).contains("junit-4.12.jar");
    assertThat(classpath).doesNotContain("gson-2.2.4.jar");
    assertThat(classpath).doesNotContain("guava-18.0.jar");
    assertThat(classpath).doesNotContain("module3");
}
Also used : JavaParameters(com.intellij.execution.configurations.JavaParameters) JUnitPatcher(com.intellij.execution.JUnitPatcher) Module(com.intellij.openapi.module.Module)

Aggregations

JUnitPatcher (com.intellij.execution.JUnitPatcher)1 JavaParameters (com.intellij.execution.configurations.JavaParameters)1 Module (com.intellij.openapi.module.Module)1