Lines 391-396
Link Here
|
391 |
assertEquals("Unexpected number of roots for non existing entry", 0, roots.length); |
391 |
assertEquals("Unexpected number of roots for non existing entry", 0, roots.length); |
392 |
|
392 |
|
393 |
} |
393 |
} |
|
|
394 |
/* |
395 |
* Ensures that a type can be found if run after setting the classpath in a runnable |
396 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=212769 ) |
397 |
*/ |
398 |
public void testFindTypeAfterSetClasspath() throws CoreException { |
399 |
try { |
400 |
final IJavaProject project = createJavaProject("P", new String[] {"src1"}, "bin"); |
401 |
createFolder("/P/src2/p"); |
402 |
createFile("/P/src2/p/X.java", "package p; public class X {}"); |
403 |
project.findType("p.X"); // populate project's cache |
404 |
final IType[] result = new IType[1]; |
405 |
ResourcesPlugin.getWorkspace().run( |
406 |
new IWorkspaceRunnable() { |
407 |
public void run(IProgressMonitor monitor) throws CoreException { |
408 |
addClasspathEntry(project, JavaCore.newSourceEntry(new Path("/P/src2"))); |
409 |
result[0] = project.findType("p.X"); |
410 |
} |
411 |
}, |
412 |
null); |
413 |
assertElementsEqual( |
414 |
"Unexpected type found", |
415 |
"X [in X.java [in p [in src2 [in P]]]]", |
416 |
result); |
417 |
} finally { |
418 |
deleteProject("P"); |
419 |
} |
420 |
} |
394 |
/** |
421 |
/** |
395 |
* Test that a folder with a dot name does not relate to a package fragment |
422 |
* Test that a folder with a dot name does not relate to a package fragment |
396 |
*/ |
423 |
*/ |