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 26629 Details for
Bug 101425
Classpath persistence should be resilient with unknown attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
patch101425_org.eclipse.jdt.core.tests.model.txt (text/plain), 5.29 KB, created by
Jerome Lanneluc
on 2005-08-30 06:45:33 EDT
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2005-08-30 06:45:33 EDT
Size:
5.29 KB
patch
obsolete
>Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.130 >diff -u -r1.130 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 25 May 2005 16:08:44 -0000 1.130 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 30 Aug 2005 09:48:30 -0000 >@@ -75,8 +75,8 @@ > // All specified tests which do not belong to the class are skipped... > static { > // Names of tests to run: can be "testBugXXXX" or "BugXXXX") >-// TESTS_PREFIX = "testClasspathDuplicateExtraAttribute"; >-// TESTS_NAMES = new String[] {"testExportContainer"}; >+// TESTS_PREFIX = "testUnknownElements"; >+// TESTS_NAMES = new String[] {"testExtraAttributes4"}; > // TESTS_NUMBERS = new int[] { 23, 28, 38 }; > // TESTS_RANGE = new int[] { 21, 38 }; > } >@@ -3322,6 +3322,94 @@ > } > } > >+/* >+ * Ensures that unknown classpath attributes in a .classpath file are not lost when read and rewritten. >+ * (regression test for bug 101425 Classpath persistence should be resilient with unknown attributes) >+ */ >+public void testUnknownAttributes() throws CoreException { >+ try { >+ IJavaProject project = createJavaProject("P"); >+ editFile( >+ "/P/.classpath", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry unknown=\"test\" kind=\"src\" path=\"src1\"/>\n" + >+ " <classpathentry kind=\"src\" path=\"src2\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>\n" >+ ); >+ IClasspathEntry[] classpath = project.getRawClasspath(); >+ >+ // swap 2 entries >+ IClasspathEntry src1 = classpath[0]; >+ classpath[0] = classpath[1]; >+ classpath[1] = src1; >+ project.setRawClasspath(classpath, null); >+ >+ // check that .classpath has correct content >+ String contents = new String (org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.classpath"))); >+ assertSourceEquals( >+ "Unexpected content", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry kind=\"src\" path=\"src2\"/>\n" + >+ " <classpathentry unknown=\"test\" kind=\"src\" path=\"src1\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>\n", >+ contents); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ >+/* >+ * Ensures that unknown classpath elements in a .classpath file are not lost when read and rewritten. >+ * (regression test for bug 101425 Classpath persistence should be resilient with unknown attributes) >+ */ >+public void testUnknownElements() throws CoreException { >+ try { >+ IJavaProject project = createJavaProject("P"); >+ editFile( >+ "/P/.classpath", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry kind=\"src\" path=\"src1\">\n" + >+ " <unknown>\n" + >+ " <test kind=\"\"/>\n" + >+ " </unknown>\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"src\" path=\"src2\"/>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>\n" >+ ); >+ IClasspathEntry[] classpath = project.getRawClasspath(); >+ >+ // swap 2 entries >+ IClasspathEntry src1 = classpath[0]; >+ classpath[0] = classpath[1]; >+ classpath[1] = src1; >+ project.setRawClasspath(classpath, null); >+ >+ // check that .classpath has correct content >+ String contents = new String (org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(getFile("/P/.classpath"))); >+ assertSourceEquals( >+ "Unexpected content", >+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + >+ "<classpath>\n" + >+ " <classpathentry kind=\"src\" path=\"src2\"/>\n" + >+ " <classpathentry kind=\"src\" path=\"src1\">\n" + >+ " <unknown>\n" + >+ " <test kind=\"\" />\n" + >+ " </unknown>\n" + >+ " </classpathentry>\n" + >+ " <classpathentry kind=\"output\" path=\"bin\"/>\n" + >+ "</classpath>\n", >+ contents); >+ } finally { >+ deleteProject("P"); >+ } >+} >+ > /** > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=55992 > * Check that Assert.AssertionFailedException exception is well catched >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.65 >diff -u -r1.65 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 8 Jun 2005 09:03:20 -0000 1.65 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 30 Aug 2005 09:48:32 -0000 >@@ -63,7 +63,7 @@ > // All specified tests which do not belong to the class are skipped... > static { > // Names of tests to run: can be "testBugXXXX" or "BugXXXX") >- // TESTS_NAMES = new String[] { "testTwoProjectsWithDifferentCompliances" }; >+// TESTS_NAMES = new String[] { "testAccessRestriction5" }; > // Numbers of tests to run: "test<number>" will be run for each number of this array > //TESTS_NUMBERS = new int[] { 13 }; > // Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last }
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 101425
:
26628
|
26629
|
26698
|
26828
|
26829