View | Details | Raw Unified | Return to bug 172345 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/builder/BuildpathTests.java (-8 / +17 lines)
Lines 441-447 Link Here
441
		Problem[] prob1 = env.getProblemsFor(classTest1);
441
		Problem[] prob1 = env.getProblemsFor(classTest1);
442
		Problem[] prob2 = env.getProblemsFor(classTest2);
442
		Problem[] prob2 = env.getProblemsFor(classTest2);
443
		Problem[] prob3 = env.getProblemsFor(classTest3);
443
		Problem[] prob3 = env.getProblemsFor(classTest3);
444
		assertEquals("too many problems", prob1.length + prob2.length + prob3.length,1); //$NON-NLS-1$
444
		assertEquals("too many problems", prob1.length + prob2.length + prob3.length, 1); //$NON-NLS-1$
445
		if(prob1.length == 1) {
445
		if(prob1.length == 1) {
446
			expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$
446
			expectingSpecificProblemFor(classTest1, new Problem("p1", "The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files", classTest1, -1, -1, -1, IMarker.SEVERITY_ERROR)); //$NON-NLS-1$ //$NON-NLS-2$
447
		} else if (prob2.length == 1) {
447
		} else if (prob2.length == 1) {
Lines 465-501 Link Here
465
	}
465
	}
466
466
467
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
467
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
468
public void _testMissingLibrary3() throws JavaModelException {
468
public void testMissingLibrary3() throws JavaModelException {
469
	IPath projectPath = env.addProject("Project");
469
	IPath projectPath = env.addProject("Project");
470
	IJavaProject project = env.getJavaProject(projectPath);
470
	IJavaProject project = env.getJavaProject(projectPath);
471
	fullBuild();
471
	fullBuild();
472
	expectingNoProblems();
472
	expectingNoProblems();
473
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
473
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
474
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
474
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
475
	// triggers a build
475
	fullBuild();
476
	expectingSpecificProblemFor(
476
	expectingSpecificProblemFor(
477
		projectPath,
477
		projectPath,
478
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,
478
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,
479
				IMarker.SEVERITY_WARNING));
479
				IMarker.SEVERITY_WARNING));
480
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.ERROR);
480
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.ERROR);
481
	cleanBuild();
481
	// force classpath change delta - should not have to do this
482
	IClasspathEntry[] classpath = project.getRawClasspath();
483
	IPath outputLocation;
484
	project.setRawClasspath(null, outputLocation = project.getOutputLocation(), false, null);
485
	project.setRawClasspath(classpath, outputLocation, false, null);
486
	fullBuild();
482
	expectingSpecificProblemFor(
487
	expectingSpecificProblemFor(
483
		projectPath,
488
		projectPath,
484
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
489
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
485
	expectingSpecificProblemFor(
490
	expectingSpecificProblemFor(
486
		projectPath,
491
		projectPath,
487
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
492
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
488
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
489
}
493
}
490
	
494
	
491
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
495
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=172345
492
public void _testMissingLibrary4() throws JavaModelException {
496
public void testMissingLibrary4() throws JavaModelException {
493
	IPath projectPath = env.addProject("Project");
497
	IPath projectPath = env.addProject("Project");
494
	IJavaProject project = env.getJavaProject(projectPath);
498
	IJavaProject project = env.getJavaProject(projectPath);
495
	fullBuild();
499
	fullBuild();
496
	expectingNoProblems();
500
	expectingNoProblems();
497
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
501
	env.addLibrary(projectPath, projectPath.append("/lib/dummy.jar"), null, null);
498
	// triggers a build
502
	fullBuild();
499
	expectingSpecificProblemFor(
503
	expectingSpecificProblemFor(
500
		projectPath,
504
		projectPath,
501
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
505
		new Problem("", "The project cannot be built until build path errors are resolved", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
Lines 503-509 Link Here
503
		projectPath,
507
		projectPath,
504
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
508
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH, IMarker.SEVERITY_ERROR));
505
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
509
	project.setOption(JavaCore.CORE_INCOMPLETE_CLASSPATH, CompilerOptions.WARNING);
506
	cleanBuild();
510
	// force classpath change delta - should not have to do this
511
	IClasspathEntry[] classpath = project.getRawClasspath();
512
	IPath outputLocation;
513
	project.setRawClasspath(null, outputLocation = project.getOutputLocation(), false, null);
514
	project.setRawClasspath(classpath, outputLocation, false, null);
515
	fullBuild();
507
	expectingSpecificProblemFor(
516
	expectingSpecificProblemFor(
508
		projectPath,
517
		projectPath,
509
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,
518
		new Problem("Build path", "Project Project is missing required library: 'lib/dummy.jar'", projectPath, -1, -1, CategorizedProblem.CAT_BUILDPATH,

Return to bug 172345