public void testClasspathConfiguration() throws CantRunException { JavaParameters parameters = new JavaParameters(); RunConfigurationModule module = new JavaRunConfigurationModule(myProject, false); Module module1 = getModule1(); Module module2 = getModule2(); addDependency(module1, module2); Module module3 = getModule3(); addDependency(module2, module3); addDependency(module1, module3); addOutputs(module1, 1); addOutputs(module2, 2); addOutputs(module3, 3); module.setModule(module1); parameters.configureByModule(module.getModule(), JavaParameters.JDK_AND_CLASSES_AND_TESTS); ArrayList<String> classPath = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(parameters.getClassPath().getPathsString(), File.pathSeparator); while (tokenizer.hasMoreTokens()) { String token = tokenizer.nextToken(); classPath.add(token); } CHECK.singleOccurence(classPath, getOutput(module1, false)); CHECK.singleOccurence(classPath, getOutput(module1, false)); CHECK.singleOccurence(classPath, getOutput(module1, true)); CHECK.singleOccurence(classPath, getOutput(module2, false)); CHECK.singleOccurence(classPath, getOutput(module2, true)); CHECK.singleOccurence(classPath, getOutput(module3, false)); CHECK.singleOccurence(classPath, getOutput(module3, true)); CHECK.singleOccurence(classPath, getFSPath(findFile(MOCK_JUNIT))); }
public void configureClasspath(final JavaParameters javaParameters) throws CantRunException { RunConfigurationModule module = getConfigurationModule(); final String jreHome = isAlternativeJrePathEnabled() ? getAlternativeJrePath() : null; final int pathType = JavaParameters.JDK_AND_CLASSES_AND_TESTS; if (myData.getScope() == TestSearchScope.WHOLE_PROJECT) { JavaParametersUtil.configureProject(module.getProject(), javaParameters, pathType, jreHome); } else { JavaParametersUtil.configureModule(module, javaParameters, pathType, jreHome); } }