Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 40326 Details for
Bug 138577
Package content disapear in package explorer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Improved patch and regression tests
138577.txt (text/plain), 5.58 KB, created by
Jerome Lanneluc
on 2006-05-04 02:22:18 EDT
(
hide
)
Description:
Improved patch and regression tests
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-05-04 02:22:18 EDT
Size:
5.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ExclusionPatternsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExclusionPatternsTests.java,v >retrieving revision 1.32 >diff -u -r1.32 ExclusionPatternsTests.java >--- src/org/eclipse/jdt/core/tests/model/ExclusionPatternsTests.java 29 Mar 2006 04:03:06 -0000 1.32 >+++ src/org/eclipse/jdt/core/tests/model/ExclusionPatternsTests.java 4 May 2006 06:19:41 -0000 >@@ -622,7 +622,7 @@ > IPackageFragment pkg = root.createPackageFragment("p", false, null); > > clearDeltas(); >- pkg.rename("q", false, null); >+ pkg.getResource().move(new Path("/P/src/q"), false, null); > > assertDeltas( > "Unexpected deltas", >Index: src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java,v >retrieving revision 1.66 >diff -u -r1.66 JavaProjectTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 29 Mar 2006 04:03:07 -0000 1.66 >+++ src/org/eclipse/jdt/core/tests/model/JavaProjectTests.java 4 May 2006 06:19:43 -0000 >@@ -620,6 +620,44 @@ > assertTrue("java should have subpackages", java.hasSubpackages()); > assertTrue("java.lang should NOT have subpackages", !lang.hasSubpackages()); > } >+/* >+ * Ensures that the structure is known for a package fragment on the classpath. >+ */ >+public void testPackageFragmentIsStructureKnown1() throws CoreException { >+ IPackageFragment pkg = getPackageFragment("JavaProjectTests", "", "x"); >+ assertTrue("Structure of package 'x' should be known", pkg.isStructureKnown()); >+} >+/* >+ * Ensures that asking if the structure is known for a package fragment outside the classpath throws a JavaModelException. >+ * (regression test for bug 138577 Package content disapear in package explorer) >+ */ >+public void testPackageFragmentIsStructureKnown2() throws CoreException { >+ try { >+ createJavaProject("P"); >+ createFolder("/P/pack"); >+ IPackageFragment pkg = getPackage("/P/pack"); >+ editFile( >+ "/P/.classpath", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"\"/>\n" + >+ "</classpath>" >+ ); >+ JavaModelException exception = null; >+ try { >+ pkg.isStructureKnown(); >+ } catch (JavaModelException e) { >+ exception = e; >+ } >+ assertExceptionEquals( >+ "Unexpected exception", >+ "pack [in <project root> [in P]] does not exist", >+ exception); >+ } finally { >+ deleteProject("P"); >+ } >+} > /** > * Test getting the non-java resources from a package fragment. > */ >Index: src/org/eclipse/jdt/core/tests/model/ExistenceTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ExistenceTests.java,v >retrieving revision 1.21 >diff -u -r1.21 ExistenceTests.java >--- src/org/eclipse/jdt/core/tests/model/ExistenceTests.java 29 Mar 2006 04:03:07 -0000 1.21 >+++ src/org/eclipse/jdt/core/tests/model/ExistenceTests.java 4 May 2006 06:19:42 -0000 >@@ -245,6 +245,28 @@ > } > } > /* >+ * Ensure that an excluded package fragment doesn't exist. >+ * (regression test for bug 138577 Package content disapear in package explorer) >+ */ >+public void testNonExistingPackageFragment3() throws CoreException { >+ try { >+ createJavaProject("P"); >+ createFolder("/P/pack"); >+ IPackageFragment pkg = getPackage("/P/pack"); >+ editFile( >+ "/P/.classpath", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry excluding=\"pack/\" kind=\"src\" path=\"\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"\"/>\n" + >+ "</classpath>" >+ ); >+ assertFalse( "pack should not exist", pkg.exists()); >+ } finally { >+ deleteProject("P"); >+ } >+} >+/* > * Ensure that a non-Java project doesn't exist. > * (regression test for bug 28545 JavaProject.exists() returns true if project doesn't have Java nature) > */ >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/PackageFragment.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java,v >retrieving revision 1.77 >diff -u -r1.77 PackageFragment.java >--- model/org/eclipse/jdt/internal/core/PackageFragment.java 29 Mar 2006 03:08:47 -0000 1.77 >+++ model/org/eclipse/jdt/internal/core/PackageFragment.java 4 May 2006 06:19:44 -0000 >@@ -65,8 +65,12 @@ > > // check whether this pkg can be opened > if (!underlyingResource.isAccessible()) throw newNotPresentException(); >- >+ >+ // check that it is not excluded (https://bugs.eclipse.org/bugs/show_bug.cgi?id=138577) > int kind = getKind(); >+ if (kind == IPackageFragmentRoot.K_SOURCE && Util.isExcluded(this)) >+ throw newNotPresentException(); >+ > > // add compilation units/class files from resources > HashSet vChildren = new HashSet(); >@@ -162,6 +166,9 @@ > return Util.equalArraysOrNull(this.names, other.names) && > this.parent.equals(other.parent); > } >+public boolean exists() { >+ return super.exists() && !Util.isExcluded(this); >+} > /** > * @see IPackageFragment#getClassFile(String) > * @exception IllegalArgumentException if the name does not end with ".class"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138577
:
40303
| 40326 |
40335