Lines 620-625
Link Here
|
620 |
assertTrue("java should have subpackages", java.hasSubpackages()); |
620 |
assertTrue("java should have subpackages", java.hasSubpackages()); |
621 |
assertTrue("java.lang should NOT have subpackages", !lang.hasSubpackages()); |
621 |
assertTrue("java.lang should NOT have subpackages", !lang.hasSubpackages()); |
622 |
} |
622 |
} |
|
|
623 |
/* |
624 |
* Ensures that the structure is known for a package fragment on the classpath. |
625 |
*/ |
626 |
public void testPackageFragmentIsStructureKnown1() throws CoreException { |
627 |
IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x"); |
628 |
assertTrue("Structure of package 'x' should be known", pkg.isStructureKnown()); |
629 |
} |
630 |
/* |
631 |
* Ensures that asking if the structure is known for a package fragment outside the classpath throws a JavaModelException. |
632 |
* (regression test for bug 138577 Package content disapear in package explorer) |
633 |
*/ |
634 |
public void testPackageFragmentIsStructureKnown2() throws CoreException { |
635 |
try { |
636 |
createJavaProject("P"); |
637 |
createFolder("/P/pack"); |
638 |
IPackageFragment pkg = getPackage("/P/pack"); |
639 |
editFile( |
640 |
"/P/.classpath", |
641 |
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + |
642 |
"<classpath>\n" + |
643 |
" <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" + |
644 |
" <classpathentry kind=\"output\" path=\"\"/>\n" + |
645 |
"</classpath>" |
646 |
); |
647 |
JavaModelException exception = null; |
648 |
try { |
649 |
pkg.isStructureKnown(); |
650 |
} catch (JavaModelException e) { |
651 |
exception = e; |
652 |
} |
653 |
assertExceptionEquals( |
654 |
"Unexpected exception", |
655 |
"pack [in <project root> [in P]] does not exist", |
656 |
exception); |
657 |
} finally { |
658 |
deleteProject("P"); |
659 |
} |
660 |
} |
623 |
/** |
661 |
/** |
624 |
* Test getting the non-java resources from a package fragment. |
662 |
* Test getting the non-java resources from a package fragment. |
625 |
*/ |
663 |
*/ |