Lines 54-59
Link Here
|
54 |
import org.eclipse.jdt.core.JavaConventions; |
54 |
import org.eclipse.jdt.core.JavaConventions; |
55 |
import org.eclipse.jdt.core.JavaCore; |
55 |
import org.eclipse.jdt.core.JavaCore; |
56 |
import org.eclipse.jdt.core.JavaModelException; |
56 |
import org.eclipse.jdt.core.JavaModelException; |
|
|
57 |
import org.eclipse.jdt.core.tests.model.ClasspathInitializerTests.DefaultVariableInitializer; |
57 |
import org.eclipse.jdt.core.tests.util.Util; |
58 |
import org.eclipse.jdt.core.tests.util.Util; |
58 |
import org.eclipse.jdt.internal.core.ClasspathEntry; |
59 |
import org.eclipse.jdt.internal.core.ClasspathEntry; |
59 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
60 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
Lines 4497-4503
Link Here
|
4497 |
* Ensures that a duplicate entry created by editing the .classpath is detected. |
4498 |
* Ensures that a duplicate entry created by editing the .classpath is detected. |
4498 |
* (regression test for bug 24498 Duplicate entries on classpath cause CP marker to no longer refresh) |
4499 |
* (regression test for bug 24498 Duplicate entries on classpath cause CP marker to no longer refresh) |
4499 |
*/ |
4500 |
*/ |
4500 |
public void testDuplicateEntries() throws CoreException { |
4501 |
public void testDuplicateEntries1() throws CoreException { |
4501 |
try { |
4502 |
try { |
4502 |
IJavaProject project = this.createJavaProject("P", new String[] {"src"}, "bin"); |
4503 |
IJavaProject project = this.createJavaProject("P", new String[] {"src"}, "bin"); |
4503 |
editFile( |
4504 |
editFile( |
Lines 4517-4522
Link Here
|
4517 |
this.deleteProject("P"); |
4518 |
this.deleteProject("P"); |
4518 |
} |
4519 |
} |
4519 |
} |
4520 |
} |
|
|
4521 |
/* |
4522 |
* Ensures that duplicate entries due to resolution are not reported |
4523 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=175226 ) |
4524 |
*/ |
4525 |
public void testDuplicateEntries2() throws CoreException { |
4526 |
try { |
4527 |
IJavaProject project = createJavaProject("P"); |
4528 |
VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"})); |
4529 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"})); |
4530 |
createFile("/P/lib.jar", ""); |
4531 |
editFile( |
4532 |
"/P/.classpath", |
4533 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
4534 |
"<classpath>\n" + |
4535 |
" <classpathentry kind=\"var\" path=\"TEST_LIB\"/>\n" + |
4536 |
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\"/>\n" + |
4537 |
" <classpathentry kind=\"output\" path=\"bin\"/>\n" + |
4538 |
"</classpath>" |
4539 |
); |
4540 |
assertMarkers( |
4541 |
"Unexpected markers", |
4542 |
"", |
4543 |
project); |
4544 |
} finally { |
4545 |
ContainerInitializer.setInitializer(null); |
4546 |
VariablesInitializer.setInitializer(null); |
4547 |
deleteProject("P"); |
4548 |
} |
4549 |
} |
4550 |
/* |
4551 |
* Ensures that the resolved classpath doesn't contain duplicate entries due to resolution |
4552 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=175226 ) |
4553 |
*/ |
4554 |
public void testDuplicateEntries3() throws CoreException { |
4555 |
try { |
4556 |
IJavaProject project = createJavaProject("P"); |
4557 |
VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"})); |
4558 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"})); |
4559 |
createFile("/P/lib.jar", ""); |
4560 |
editFile( |
4561 |
"/P/.classpath", |
4562 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
4563 |
"<classpath>\n" + |
4564 |
" <classpathentry kind=\"var\" path=\"TEST_LIB\"/>\n" + |
4565 |
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\"/>\n" + |
4566 |
" <classpathentry kind=\"output\" path=\"bin\"/>\n" + |
4567 |
"</classpath>" |
4568 |
); |
4569 |
assertClasspathEquals( |
4570 |
project.getResolvedClasspath(true), |
4571 |
"/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]" |
4572 |
); |
4573 |
} finally { |
4574 |
ContainerInitializer.setInitializer(null); |
4575 |
VariablesInitializer.setInitializer(null); |
4576 |
deleteProject("P"); |
4577 |
} |
4578 |
} |
4520 |
private void denseCycleDetection(final int numberOfParticipants) throws CoreException { |
4579 |
private void denseCycleDetection(final int numberOfParticipants) throws CoreException { |
4521 |
|
4580 |
|
4522 |
final IJavaProject[] projects = new IJavaProject[numberOfParticipants]; |
4581 |
final IJavaProject[] projects = new IJavaProject[numberOfParticipants]; |