View | Details | Raw Unified | Return to bug 157333 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/model/DeleteTests.java (-4 / +26 lines)
Lines 13-21 Link Here
13
import java.io.IOException;
13
import java.io.IOException;
14
14
15
import org.eclipse.core.resources.*;
15
import org.eclipse.core.resources.*;
16
import org.eclipse.core.resources.IFolder;
17
import org.eclipse.core.resources.IWorkspaceRunnable;
18
import org.eclipse.core.resources.ResourcesPlugin;
19
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.core.runtime.IProgressMonitor;
21
import org.eclipse.core.runtime.OperationCanceledException;
18
import org.eclipse.core.runtime.OperationCanceledException;
Lines 48-54 Link Here
48
// Use this static initializer to specify subset for tests
45
// Use this static initializer to specify subset for tests
49
// All specified tests which do not belong to the class are skipped...
46
// All specified tests which do not belong to the class are skipped...
50
static {
47
static {
51
//		TESTS_NAMES = new String[] { "testDeleteField4" };
48
//		TESTS_NAMES = new String[] { "testDeleteField5" };
52
//		TESTS_NUMBERS = new int[] { 2, 12 };
49
//		TESTS_NUMBERS = new int[] { 2, 12 };
53
//		TESTS_RANGE = new int[] { 16, -1 };
50
//		TESTS_RANGE = new int[] { 16, -1 };
54
}
51
}
Lines 458-463 Link Here
458
	}
455
	}
459
}
456
}
460
/**
457
/**
458
 * Delete enum
459
 */
460
public void testDeleteField5() throws CoreException {
461
	try {
462
		this.createJavaProject("P1", new String[] {""}, new String[] {"JCL15_LIB"}, null, "", "1.5");
463
		createFile(
464
			"P1/X.java",
465
			"public enum X {\n" +
466
			"  A, B, C\n" +
467
			"}"
468
		);
469
		ICompilationUnit cu = getCompilationUnit("P1/X.java");
470
		IField field = cu.getType("X").getField("A");
471
		field.delete(false, null);
472
		assertSourceEquals(
473
			"Unexpected source", 
474
			"public enum X {\n" + 
475
			"  B, C\n" + 
476
			"}",
477
			cu.getSource());
478
	} finally {
479
		deleteProject("P1");
480
	}
481
}
482
/**
461
 * Ensures that an import declaration can be deleted.
483
 * Ensures that an import declaration can be deleted.
462
 */
484
 */
463
public void testDeleteImportDeclaration() throws CoreException {
485
public void testDeleteImportDeclaration() throws CoreException {

Return to bug 157333