Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 361279
Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaElementDeltaTests.java (-1 / +56 lines)
Lines 34-40 Link Here
34
// All specified tests which do not belong to the class are skipped...
34
// All specified tests which do not belong to the class are skipped...
35
static {
35
static {
36
//	TESTS_PREFIX =  "testBug100772_ProjectScope";
36
//	TESTS_PREFIX =  "testBug100772_ProjectScope";
37
//	TESTS_NAMES = new String[] { "testAddInvalidSubfolder" };
37
	TESTS_NAMES = new String[] { "testBug361279" };
38
//	TESTS_NUMBERS = new int[] { 100772 };
38
//	TESTS_NUMBERS = new int[] { 100772 };
39
//	TESTS_RANGE = new int[] { 83304, -1 };
39
//	TESTS_RANGE = new int[] { 83304, -1 };
40
}
40
}
Lines 3053-3057 Link Here
3053
		deleteProject("P");
3053
		deleteProject("P");
3054
	}
3054
	}
3055
}
3055
}
3056
public void testBug361279() throws Exception {
3057
	try {
3058
		createJavaProject("P", new String[] {""}, "");
3059
		createFolder("P/x/y");
3060
		createFile("P/x/y/A.java",
3061
			"package x.y;\n" +
3062
			"public class A {\n" +
3063
			"}");
3064
		final ICompilationUnit cu = getCompilationUnit("P/x/y/A.java");
3065
		final ICompilationUnit copy = cu.getWorkingCopy(null);
3066
		startDeltas();
3067
		Runnable r = new Runnable(){
3068
			public void run() {
3069
				try {
3070
					copy.getBuffer().setContents(
3071
							"package x.y;\n" +
3072
							"public class A {\n" +
3073
							"  public void foo() {\n" +
3074
							"  }\n" +
3075
							"}");
3076
					copy.save(null, true);
3077
				} catch (Exception e) {
3078
					e.printStackTrace();
3079
				}
3080
			}
3081
		};
3082
		Runnable r2 = new Runnable(){
3083
			public void run() {
3084
				try {
3085
					copy.getTypes()[0].createMethod("void bar() {}", null, true, null);
3086
				} catch (Exception e) {
3087
					e.printStackTrace();
3088
				}
3089
			}
3090
		};
3091
		Thread t = new Thread(r);
3092
		Thread t2 = new Thread(r2);
3093
		t.start();
3094
		t2.start();
3095
3096
		copy.commitWorkingCopy(true, null);
3097
		assertDeltas(
3098
			"Unexpected delta after commit",
3099
			"P[*]: {CHILDREN}\n" +
3100
					"	<project root>[*]: {CHILDREN}\n" +
3101
					"		x.y[*]: {CHILDREN}\n" +
3102
					"			A.java[*]: {CHILDREN | FINE GRAINED | PRIMARY RESOURCE}\n" +
3103
					"				A[*]: {CHILDREN | FINE GRAINED}\n" +
3104
					"					bar()[+]: {}"
3105
		);
3106
	} finally {
3107
		stopDeltas();
3108
		deleteProject("P");
3109
	}
3110
}
3056
}
3111
}
3057
3112

Return to bug 361279