### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.model Index: src/org/eclipse/jdt/core/tests/model/DeleteTests.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/DeleteTests.java,v retrieving revision 1.18 diff -u -r1.18 DeleteTests.java --- src/org/eclipse/jdt/core/tests/model/DeleteTests.java 14 Sep 2006 23:49:11 -0000 1.18 +++ src/org/eclipse/jdt/core/tests/model/DeleteTests.java 15 Sep 2006 00:27:06 -0000 @@ -13,9 +13,6 @@ import java.io.IOException; import org.eclipse.core.resources.*; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; @@ -48,7 +45,7 @@ // Use this static initializer to specify subset for tests // All specified tests which do not belong to the class are skipped... static { -// TESTS_NAMES = new String[] { "testDeleteField4" }; +// TESTS_NAMES = new String[] { "testDeleteField5" }; // TESTS_NUMBERS = new int[] { 2, 12 }; // TESTS_RANGE = new int[] { 16, -1 }; } @@ -458,6 +455,31 @@ } } /** + * Delete enum + */ +public void testDeleteField5() throws CoreException { + try { + this.createJavaProject("P1", new String[] {""}, new String[] {"JCL15_LIB"}, null, "", "1.5"); + createFile( + "P1/X.java", + "public enum X {\n" + + " A, B, C\n" + + "}" + ); + ICompilationUnit cu = getCompilationUnit("P1/X.java"); + IField field = cu.getType("X").getField("A"); + field.delete(false, null); + assertSourceEquals( + "Unexpected source", + "public enum X {\n" + + " B, C\n" + + "}", + cu.getSource()); + } finally { + deleteProject("P1"); + } +} +/** * Ensures that an import declaration can be deleted. */ public void testDeleteImportDeclaration() throws CoreException {