Lines 53-58
Link Here
|
53 |
import org.eclipse.jdt.core.JavaConventions; |
53 |
import org.eclipse.jdt.core.JavaConventions; |
54 |
import org.eclipse.jdt.core.JavaCore; |
54 |
import org.eclipse.jdt.core.JavaCore; |
55 |
import org.eclipse.jdt.core.JavaModelException; |
55 |
import org.eclipse.jdt.core.JavaModelException; |
|
|
56 |
import org.eclipse.jdt.core.tests.model.ClasspathInitializerTests.DefaultVariableInitializer; |
56 |
import org.eclipse.jdt.core.tests.util.Util; |
57 |
import org.eclipse.jdt.core.tests.util.Util; |
57 |
import org.eclipse.jdt.internal.core.ClasspathEntry; |
58 |
import org.eclipse.jdt.internal.core.ClasspathEntry; |
58 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
59 |
import org.eclipse.jdt.internal.core.JavaModelManager; |
Lines 3768-3774
Link Here
|
3768 |
* Ensures that a duplicate entry created by editing the .classpath is detected. |
3769 |
* Ensures that a duplicate entry created by editing the .classpath is detected. |
3769 |
* (regression test for bug 24498 Duplicate entries on classpath cause CP marker to no longer refresh) |
3770 |
* (regression test for bug 24498 Duplicate entries on classpath cause CP marker to no longer refresh) |
3770 |
*/ |
3771 |
*/ |
3771 |
public void testDuplicateEntries() throws CoreException { |
3772 |
public void testDuplicateEntries1() throws CoreException { |
3772 |
try { |
3773 |
try { |
3773 |
IJavaProject project = this.createJavaProject("P", new String[] {"src"}, "bin"); |
3774 |
IJavaProject project = this.createJavaProject("P", new String[] {"src"}, "bin"); |
3774 |
this.editFile( |
3775 |
this.editFile( |
Lines 3788-3793
Link Here
|
3788 |
this.deleteProject("P"); |
3789 |
this.deleteProject("P"); |
3789 |
} |
3790 |
} |
3790 |
} |
3791 |
} |
|
|
3792 |
/* |
3793 |
* Ensures that duplicate entries due to resolution are not reported |
3794 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=175226 ) |
3795 |
*/ |
3796 |
public void testDuplicateEntries2() throws CoreException { |
3797 |
try { |
3798 |
IJavaProject project = createJavaProject("P"); |
3799 |
VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"})); |
3800 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"})); |
3801 |
createFile("/P/lib.jar", ""); |
3802 |
editFile( |
3803 |
"/P/.classpath", |
3804 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
3805 |
"<classpath>\n" + |
3806 |
" <classpathentry kind=\"var\" path=\"TEST_LIB\"/>\n" + |
3807 |
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\"/>\n" + |
3808 |
" <classpathentry kind=\"output\" path=\"bin\"/>\n" + |
3809 |
"</classpath>" |
3810 |
); |
3811 |
assertMarkers( |
3812 |
"Unexpected markers", |
3813 |
"", |
3814 |
project); |
3815 |
} finally { |
3816 |
ContainerInitializer.setInitializer(null); |
3817 |
VariablesInitializer.setInitializer(null); |
3818 |
deleteProject("P"); |
3819 |
} |
3820 |
} |
3821 |
/* |
3822 |
* Ensures that the resolved classpath doesn't contain duplicate entries due to resolution |
3823 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=175226 ) |
3824 |
*/ |
3825 |
public void testDuplicateEntries3() throws CoreException { |
3826 |
try { |
3827 |
IJavaProject project = createJavaProject("P"); |
3828 |
VariablesInitializer.setInitializer(new DefaultVariableInitializer(new String[] {"TEST_LIB", "/P/lib.jar"})); |
3829 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"})); |
3830 |
createFile("/P/lib.jar", ""); |
3831 |
editFile( |
3832 |
"/P/.classpath", |
3833 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
3834 |
"<classpath>\n" + |
3835 |
" <classpathentry kind=\"var\" path=\"TEST_LIB\"/>\n" + |
3836 |
" <classpathentry kind=\"con\" path=\"org.eclipse.jdt.core.tests.model.TEST_CONTAINER\"/>\n" + |
3837 |
" <classpathentry kind=\"output\" path=\"bin\"/>\n" + |
3838 |
"</classpath>" |
3839 |
); |
3840 |
assertClasspathEquals( |
3841 |
project.getResolvedClasspath(true), |
3842 |
"/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]" |
3843 |
); |
3844 |
} finally { |
3845 |
ContainerInitializer.setInitializer(null); |
3846 |
VariablesInitializer.setInitializer(null); |
3847 |
deleteProject("P"); |
3848 |
} |
3849 |
} |
3791 |
private void denseCycleDetection(final int numberOfParticipants) throws CoreException { |
3850 |
private void denseCycleDetection(final int numberOfParticipants) throws CoreException { |
3792 |
|
3851 |
|
3793 |
final IJavaProject[] projects = new IJavaProject[numberOfParticipants]; |
3852 |
final IJavaProject[] projects = new IJavaProject[numberOfParticipants]; |