|
Lines 278-283
Link Here
|
| 278 |
pkg.getNonJavaResources()); |
278 |
pkg.getNonJavaResources()); |
| 279 |
} |
279 |
} |
| 280 |
/* |
280 |
/* |
|
|
281 |
* Ensure that creating a file that corresponds to an included compilation unit |
| 282 |
* in a folder that is not included makes it appear as a child of its package and not as a non-java resource. |
| 283 |
* (regression test for bug 65234 Inclusion filter not working) |
| 284 |
*/ |
| 285 |
public void testCreateResourceIncludedCompilationUnit2() throws CoreException { |
| 286 |
setClasspath(new String[] {"/P/src", "p1/p2/p3/A.java"}); |
| 287 |
createFolder("/P/src/p1/p2/p3"); |
| 288 |
|
| 289 |
clearDeltas(); |
| 290 |
createFile( |
| 291 |
"/P/src/p1/p2/p3/A.java", |
| 292 |
"package p1.p2.p3;\n" + |
| 293 |
"public class A {\n" + |
| 294 |
"}" |
| 295 |
); |
| 296 |
|
| 297 |
assertDeltas( |
| 298 |
"Unexpected deltas", |
| 299 |
"P[*]: {CHILDREN}\n" + |
| 300 |
" src[*]: {CHILDREN | CONTENT}\n" + |
| 301 |
" p1.p2.p3[*]: {CHILDREN}\n" + |
| 302 |
" A.java[+]: {}\n" + |
| 303 |
" ResourceDelta(/P/src/p1)[*]" |
| 304 |
); |
| 305 |
|
| 306 |
IPackageFragment pkg = getPackage("/P/src/p1/p2/p3"); |
| 307 |
assertSortedElementsEqual( |
| 308 |
"Unexpected children", |
| 309 |
"A.java [in p1.p2.p3 [in src [in P]]]", |
| 310 |
pkg.getChildren()); |
| 311 |
|
| 312 |
assertResourcesEqual( |
| 313 |
"Unexpected non-java resources", |
| 314 |
"", |
| 315 |
pkg.getNonJavaResources()); |
| 316 |
} |
| 317 |
/* |
| 281 |
* Ensure that creating a folder that corresponds to an included package |
318 |
* Ensure that creating a folder that corresponds to an included package |
| 282 |
* makes it appear as a child of its package fragment root and not as a non-java resource. |
319 |
* makes it appear as a child of its package fragment root and not as a non-java resource. |
| 283 |
*/ |
320 |
*/ |
|
Lines 303-308
Link Here
|
| 303 |
assertResourcesEqual( |
340 |
assertResourcesEqual( |
| 304 |
"Unexpected non-java resources", |
341 |
"Unexpected non-java resources", |
| 305 |
"", |
342 |
"", |
|
|
343 |
root.getNonJavaResources()); |
| 344 |
} |
| 345 |
/* |
| 346 |
* Ensure that creating a folder that is included in a folder that is not included |
| 347 |
* makes it appear as a child of its package fragment root and not as a non-java resource. |
| 348 |
* (regression test for bug 65234 Inclusion filter not working) |
| 349 |
*/ |
| 350 |
public void testCreateResourceIncludedPackage2() throws CoreException { |
| 351 |
setClasspath(new String[] {"/P/src", "p1/p2/p3/"}); |
| 352 |
createFolder("/P/src/p1/p2"); |
| 353 |
|
| 354 |
clearDeltas(); |
| 355 |
createFolder("/P/src/p1/p2/p3"); |
| 356 |
|
| 357 |
assertDeltas( |
| 358 |
"Unexpected deltas", |
| 359 |
"P[*]: {CHILDREN}\n" + |
| 360 |
" src[*]: {CHILDREN | CONTENT}\n" + |
| 361 |
" p1.p2.p3[+]: {}\n" + |
| 362 |
" ResourceDelta(/P/src/p1)[*]" |
| 363 |
); |
| 364 |
|
| 365 |
IPackageFragmentRoot root = getPackageFragmentRoot("/P/src"); |
| 366 |
assertSortedElementsEqual( |
| 367 |
"Unexpected children", |
| 368 |
"p1.p2.p3 [in src [in P]]", |
| 369 |
root.getChildren()); |
| 370 |
|
| 371 |
assertResourcesEqual( |
| 372 |
"Unexpected non-java resources", |
| 373 |
"p1", |
| 306 |
root.getNonJavaResources()); |
374 |
root.getNonJavaResources()); |
| 307 |
} |
375 |
} |
| 308 |
/* |
376 |
/* |