View | Details | Raw Unified | Return to bug 419829
Collapse All | Expand All

(-)a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java (+56 lines)
Lines 27-32 import org.eclipse.core.resources.IResource; Link Here
27
import org.eclipse.core.resources.IWorkspaceRunnable;
27
import org.eclipse.core.resources.IWorkspaceRunnable;
28
import org.eclipse.core.resources.IncrementalProjectBuilder;
28
import org.eclipse.core.resources.IncrementalProjectBuilder;
29
import org.eclipse.core.runtime.CoreException;
29
import org.eclipse.core.runtime.CoreException;
30
import org.eclipse.core.runtime.FileLocator;
30
import org.eclipse.core.runtime.ILogListener;
31
import org.eclipse.core.runtime.ILogListener;
31
import org.eclipse.core.runtime.IProgressMonitor;
32
import org.eclipse.core.runtime.IProgressMonitor;
32
import org.eclipse.core.runtime.IStatus;
33
import org.eclipse.core.runtime.IStatus;
Lines 43-54 import org.eclipse.jdt.core.tests.util.Util; Link Here
43
import org.eclipse.jdt.internal.core.CompilationUnit;
44
import org.eclipse.jdt.internal.core.CompilationUnit;
44
import org.eclipse.jdt.internal.core.JavaModelManager;
45
import org.eclipse.jdt.internal.core.JavaModelManager;
45
import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
46
import org.eclipse.jdt.internal.core.search.indexing.IndexManager;
47
import org.osgi.framework.Bundle;
46
48
47
public class ReconcilerTests extends ModifyingResourceTests {
49
public class ReconcilerTests extends ModifyingResourceTests {
48
50
49
	protected ICompilationUnit workingCopy;
51
	protected ICompilationUnit workingCopy;
50
	protected ProblemRequestor problemRequestor;
52
	protected ProblemRequestor problemRequestor;
51
53
54
	static {
55
		TESTS_NUMBERS = new int [] { 35 };
56
		TESTS_NAMES = new String [] { "testfoo" };
57
	}
58
52
	/* A problem requestor that auto-cancels on first problem */
59
	/* A problem requestor that auto-cancels on first problem */
53
	static class CancelingProblemRequestor extends ProblemRequestor {
60
	static class CancelingProblemRequestor extends ProblemRequestor {
54
		IProgressMonitor progressMonitor = new IProgressMonitor() {
61
		IProgressMonitor progressMonitor = new IProgressMonitor() {
Lines 5489-5492 public void testSecondaryTypeDeletion() throws CoreException, IOException { Link Here
5489
			);
5496
			);
5490
	
5497
	
5491
}
5498
}
5499
5500
public void testfoo() throws CoreException, IOException {
5501
//testMethodWithError02
5502
5503
	Bundle[] bundles = Platform.getBundles("org.eclipse.jdt.annotation", "[1.1.0,2.0.0)");
5504
	File bundleFile = FileLocator.getBundleFile(bundles[0]);
5505
	String ANNOTATION_LIB = bundleFile.isDirectory() ? bundleFile.getPath()+"/bin" : bundleFile.getPath();
5506
5507
	String src2 = "package one.test;\n" +
5508
			"\n" +
5509
			//"import org.eclipse.jdt.annotation.Repeatable;\n" +
5510
			"import java.lang.annotation.*;\n" +
5511
			"\n" +
5512
			"@interface FooContainerContainer {\n" +
5513
			"	FooContainer[] value();\n" +
5514
			"}\n" +
5515
			"\n" +
5516
			"@Repeatable(FooContainerContainer.class)\n" +
5517
			"@interface FooContainer {\n" +
5518
			"	Foo[] value() default {};\n" +
5519
			"}\n" +
5520
			"\n" +
5521
			"@Repeatable(FooContainer.class)\n" +
5522
			"@interface Foo {\n" +
5523
			"	int value();\n" +
5524
			"}\n" +
5525
			"\n" +
5526
			"@Foo(0)\n" +
5527
			"@FooContainer({ @Foo(1) })\n" +
5528
			"@FooContainer({ @Foo(2) })\n" +
5529
			"public class A3 {}\n";
5530
5531
	String fpath = "/P1/src/one/test/A3.java";
5532
	char[] src2Char = src2.toCharArray();
5533
	this.problemRequestor.initialize(src2Char);
5534
	IJavaProject project = null;
5535
	try {
5536
		project = createJavaProject("P1", new String[] {"src"}, new String[] {"JCL_LIB18", ANNOTATION_LIB}, "bin", "1.8");
5537
		createFolder("/P1/src/one/test");
5538
		this.createFile(fpath, src2);
5539
5540
		this.workingCopy = getCompilationUnit(fpath).getWorkingCopy(this.wcOwner, null);
5541
		startDeltas();
5542
		this.workingCopy.reconcile(ICompilationUnit.NO_AST, true, null, null);
5543
		assertProblems("", "");
5544
	} finally {
5545
		deleteProject("P1");
5546
	}
5547
}
5492
}
5548
}

Return to bug 419829