Lines 6767-6772
Link Here
|
6767 |
ContainerInitializer.setInitializer(null); |
6767 |
ContainerInitializer.setInitializer(null); |
6768 |
} |
6768 |
} |
6769 |
} |
6769 |
} |
|
|
6770 |
/** |
6771 |
* @bug 324367: IJavaProject.findPackageFragmentRoots(IClasspathEntry cpe) returns empty list |
6772 |
* |
6773 |
* Test that exported classpath entries from the referenced project are included when invoked |
6774 |
* the API org.eclipse.jdt.core.IJavaProject.findPackageFragmentRoots(IClasspathEntry) |
6775 |
* |
6776 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=324367" |
6777 |
* @throws Exception |
6778 |
*/ |
6779 |
public void testBug324367() throws Exception { |
6780 |
try { |
6781 |
IJavaProject referencingProject = this.createJavaProject("ReferencingProject", new String[] {}, "bin"); |
6782 |
IJavaProject referencedProject = this.createJavaProject("ReferencedProject", new String[] {"src"}, "bin"); |
6783 |
|
6784 |
addLibrary(referencedProject, "lib.jar", null, new String[0], |
6785 |
new String[] { |
6786 |
"META-INF/MANIFEST.MF", |
6787 |
"Manifest-Version: 1.0\n", |
6788 |
}, |
6789 |
JavaCore.VERSION_1_4); |
6790 |
IClasspathEntry[] classpath = new IClasspathEntry[2]; |
6791 |
classpath[0] = JavaCore.newSourceEntry(new Path("/ReferencedProject/src"), new Path[0]); |
6792 |
classpath[1] = JavaCore.newLibraryEntry(new Path("/ReferencedProject/lib.jar"), null, null,true); |
6793 |
setClasspath(referencedProject, classpath); |
6794 |
classpath = new IClasspathEntry[1]; |
6795 |
classpath[0] = JavaCore.newProjectEntry(new Path("/ReferencedProject"), false); |
6796 |
setClasspath(referencingProject, classpath); |
6797 |
|
6798 |
IClasspathEntry referencedProjectCPE = null; |
6799 |
IClasspathEntry[] rawClasspath = referencingProject.getRawClasspath(); |
6800 |
for(int index = 0; index < rawClasspath.length; index++) { |
6801 |
IClasspathEntry cpe = rawClasspath[index]; |
6802 |
if (cpe.getPath().equals(referencedProject.getPath())) { |
6803 |
referencedProjectCPE = cpe; |
6804 |
break; |
6805 |
} |
6806 |
} |
6807 |
assertEquals("Incorrect package fragment roots", 2, referencingProject.findPackageFragmentRoots(referencedProjectCPE).length); |
6808 |
} finally { |
6809 |
deleteProject("ReferencingProject"); |
6810 |
deleteProject("ReferencedProject"); |
6811 |
} |
6812 |
} |
6770 |
|
6813 |
|
6771 |
|
6814 |
|
6772 |
} |
6815 |
} |