commented out many useless tests (access restrictions).
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java
index d992618..f310a08 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/CompletionTests2.java
@@ -471,1708 +471,1717 @@
this.deleteProject("P3");
}
}
-public void testBug79288() throws Exception {
- try {
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
+/*
+ *
+ * This tests a project which includes functions and methods marked as "not exported" from another project. This is N/A for JS.
+ */
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- new String[]{"/P1"},
- "bin");
-
- this.createFolder("/P2/src/b");
- this.createFile(
- "/P2/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- new String[]{"/P2"},
- "bin");
-
- this.createFile(
- "/P3/src/YY.js",
- "public class YY {\n"+
- " vois foo(){\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- }
-}
-public void testBug91772() throws Exception {
- try {
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
+//public void testBug79288() throws Exception {
+// try {
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// new String[]{"/P1"},
+// "bin");
+//
+// this.createFolder("/P2/src/b");
+// this.createFile(
+// "/P2/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// new String[]{"/P2"},
+// "bin");
+//
+// this.createFile(
+// "/P3/src/YY.js",
+// "public class YY {\n"+
+// " vois foo(){\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// }
+//}
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- // create P2
- ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}));
- String[] classLib = new String[]{"JCL_LIB"};
- int classLibLength = classLib.length;
- String[] lib = new String[classLibLength + 1];
- System.arraycopy(classLib, 0, lib, 0, classLibLength);
- lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- lib,
- "bin");
-
- this.createFolder("/P2/src/b");
- this.createFile(
- "/P2/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- new String[]{"/P2"},
- "bin");
-
- this.createFile(
- "/P3/src/YY.js",
- "public class YY {\n"+
- " vois foo(){\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
-
-
- // TODO the following code is not the correct way to remove the container
- // Cleanup caches
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- manager.containers = new HashMap(5);
- manager.variables = new HashMap(5);
- }
-}
-public void testBug93891() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}, new String[]{"a/*"}));
- String[] classLib = new String[]{"JCL_LIB"};
- int classLibLength = classLib.length;
- String[] lib = new String[classLibLength + 1];
- System.arraycopy(classLib, 0, lib, 0, classLibLength);
- lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- lib,
- "bin");
-
- this.createFolder("/P2/src/b");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
-
- // TODO the following code is not the correct way to remove the container
- // Cleanup caches
- JavaModelManager manager = JavaModelManager.getJavaModelManager();
- manager.containers = new HashMap(5);
- manager.variables = new HashMap(5);
-
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction1() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- new String[]{"/P1"},
- "bin");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-
-public void testAccessRestriction2() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction3() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction4() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction5() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction6() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- this.createFolder("/P1/src/c");
- this.createFile(
- "/P1/src/c/XX3.js",
- "package c;\n"+
- "public class XX3 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P2"},
- new String[][]{{}},
- new String[][]{{"b/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFile(
- "/P3/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX3[TYPE_REF]{c.XX3, c, Lc.XX3;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction7() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1", "/P3"},
- new String[][]{{}, {}},
- new String[][]{{"a/*"}, {}},
- new boolean[]{false, false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction8() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P3", "/P1"},
- new String[][]{{}, {}},
- new String[][]{{}, {"a/*"}},
- new boolean[]{false, false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction9() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/p11");
- this.createFile(
- "/P1/src/p11/XX11.js",
- "package p11;\n"+
- "public class XX11 {\n"+
- "}");
-
- this.createFolder("/P1/src/p12");
- this.createFile(
- "/P1/src/p12/XX12.js",
- "package p12;\n"+
- "public class XX12 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1", "/P3"},
- new String[][]{{}, {}},
- new String[][]{{"p11/*"}, {"p31/*"}},
- new boolean[]{true, true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P2/src/p21");
- this.createFile(
- "/P2/src/p21/XX21.js",
- "package p21;\n"+
- "public class XX21 {\n"+
- "}");
-
- this.createFolder("/P2/src/p22");
- this.createFile(
- "/P2/src/p22/XX22.js",
- "package p22;\n"+
- "public class XX22 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"p12/*"}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P3/src/p31");
- this.createFile(
- "/P3/src/p31/XX31.js",
- "package p31;\n"+
- "public class XX31 {\n"+
- "}");
-
- this.createFolder("/P3/src/p32");
- this.createFile(
- "/P3/src/p32/XX32.js",
- "package p32;\n"+
- "public class XX32 {\n"+
- "}");
-
- // create PX
- this.createJavaProject(
- "PX",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P2"},
- null,
- null,
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFile(
- "/PX/src/X.js",
- "public class X {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- this.deleteProject("PX");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction10() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/p11");
- this.createFile(
- "/P1/src/p11/XX11.js",
- "package p11;\n"+
- "public class XX11 {\n"+
- "}");
-
- this.createFolder("/P1/src/p12");
- this.createFile(
- "/P1/src/p12/XX12.js",
- "package p12;\n"+
- "public class XX12 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1", "/P3"},
- new String[][]{{}, {}},
- new String[][]{{"p11/*"}, {"p31/*"}},
- new boolean[]{true, true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P2/src/p21");
- this.createFile(
- "/P2/src/p21/XX21.js",
- "package p21;\n"+
- "public class XX21 {\n"+
- "}");
-
- this.createFolder("/P2/src/p22");
- this.createFile(
- "/P2/src/p22/XX22.js",
- "package p22;\n"+
- "public class XX22 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"p12/*"}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P3/src/p31");
- this.createFile(
- "/P3/src/p31/XX31.js",
- "package p31;\n"+
- "public class XX31 {\n"+
- "}");
-
- this.createFolder("/P3/src/p32");
- this.createFile(
- "/P3/src/p32/XX32.js",
- "package p32;\n"+
- "public class XX32 {\n"+
- "}");
-
- // create PX
- this.createJavaProject(
- "PX",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P2"},
- null,
- null,
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFile(
- "/PX/src/X.js",
- "public class X {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
- "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
- "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- this.deleteProject("PX");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction11() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/x/y/z/p11");
- this.createFile(
- "/P1/src/x/y/z/p11/XX11.js",
- "package x.y.z.p11;\n"+
- "public class XX11 {\n"+
- "}");
-
- this.createFolder("/P1/src/x/y/z/p12");
- this.createFile(
- "/P1/src/x/y/z/p12/XX12.js",
- "package x.y.z.p12;\n"+
- "public class XX12 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P3", "/P1"},
- new String[][]{{}, {}},
- new String[][]{{"x/y/z/p31/*"}, {"x/y/z/p11/*"}},
- new boolean[]{true, true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P2/src/x/y/z/p21");
- this.createFile(
- "/P2/src/x/y/z/p21/XX21.js",
- "package x.y.z.p21;\n"+
- "public class XX21 {\n"+
- "}");
-
- this.createFolder("/P2/src/x/y/z/p22");
- this.createFile(
- "/P2/src/x/y/z/p22/XX22.js",
- "package x.y.z.p22;\n"+
- "public class XX22 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"x/y/z/p12/*"}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P3/src/x/y/z/p31");
- this.createFile(
- "/P3/src/x/y/z/p31/XX31.js",
- "package x.y.z.p31;\n"+
- "public class XX31 {\n"+
- "}");
-
- this.createFolder("/P3/src/x/y/z/p32");
- this.createFile(
- "/P3/src/x/y/z/p32/XX32.js",
- "package x.y.z.p32;\n"+
- "public class XX32 {\n"+
- "}");
-
- // create PX
- this.createJavaProject(
- "PX",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P2"},
- null,
- null,
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFile(
- "/PX/src/X.js",
- "public class X {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX11[TYPE_REF]{x.y.z.p11.XX11, x.y.z.p11, Lx.y.z.p11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX21[TYPE_REF]{x.y.z.p21.XX21, x.y.z.p21, Lx.y.z.p21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX22[TYPE_REF]{x.y.z.p22.XX22, x.y.z.p22, Lx.y.z.p22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX32[TYPE_REF]{x.y.z.p32.XX32, x.y.z.p32, Lx.y.z.p32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- this.deleteProject("PX");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction12() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/p11");
- this.createFile(
- "/P1/src/p11/XX11.js",
- "package p11;\n"+
- "public class XX11 {\n"+
- "}");
-
- this.createFolder("/P1/src/p12");
- this.createFile(
- "/P1/src/p12/XX12.js",
- "package p12;\n"+
- "public class XX12 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P3", "/P1"},
- new String[][]{{}, {}},
- new String[][]{{"p31/*"}, {"p11/*"}},
- new boolean[]{true, true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P2/src/p21");
- this.createFile(
- "/P2/src/p21/XX21.js",
- "package p21;\n"+
- "public class XX21 {\n"+
- "}");
-
- this.createFolder("/P2/src/p22");
- this.createFile(
- "/P2/src/p22/XX22.js",
- "package p22;\n"+
- "public class XX22 {\n"+
- "}");
-
- // create P3
- this.createJavaProject(
- "P3",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"p12/*"}},
- new boolean[]{true},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFolder("/P3/src/p31");
- this.createFile(
- "/P3/src/p31/XX31.js",
- "package p31;\n"+
- "public class XX31 {\n"+
- "}");
-
- this.createFolder("/P3/src/p32");
- this.createFile(
- "/P3/src/p32/XX32.js",
- "package p32;\n"+
- "public class XX32 {\n"+
- "}");
-
- // create PX
- this.createJavaProject(
- "PX",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P2"},
- null,
- null,
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
-
- this.createFile(
- "/PX/src/X.js",
- "public class X {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
- "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
- "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
- "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- this.deleteProject("P3");
- this.deleteProject("PX");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction13() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.WARNING);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
-public void testAccessRestriction14() throws Exception {
- Hashtable oldOptions = JavaCore.getOptions();
- try {
- Hashtable options = new Hashtable(oldOptions);
- options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.WARNING);
- options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
- options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.ENABLED);
- JavaCore.setOptions(options);
-
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
-
- this.createFolder("/P1/src/a");
- this.createFile(
- "/P1/src/a/XX1.js",
- "package a;\n"+
- "public class XX1 {\n"+
- "}");
-
- this.createFolder("/P1/src/b");
- this.createFile(
- "/P1/src/b/XX2.js",
- "package b;\n"+
- "public class XX2 {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"a/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/YY.js",
- "public class YY {\n"+
- " void foo() {\n"+
- " XX\n"+
- " }\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
-
- String str = cu.getSource();
- String completeBehind = "XX";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- JavaCore.setOptions(oldOptions);
- }
-}
+//public void testBug91772() throws Exception {
+// try {
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// // create P2
+// ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}));
+// String[] classLib = new String[]{"JCL_LIB"};
+// int classLibLength = classLib.length;
+// String[] lib = new String[classLibLength + 1];
+// System.arraycopy(classLib, 0, lib, 0, classLibLength);
+// lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// lib,
+// "bin");
+//
+// this.createFolder("/P2/src/b");
+// this.createFile(
+// "/P2/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// new String[]{"/P2"},
+// "bin");
+//
+// this.createFile(
+// "/P3/src/YY.js",
+// "public class YY {\n"+
+// " vois foo(){\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+//
+//
+// // TODO the following code is not the correct way to remove the container
+// // Cleanup caches
+// JavaModelManager manager = JavaModelManager.getJavaModelManager();
+// manager.containers = new HashMap(5);
+// manager.variables = new HashMap(5);
+// }
+//}
+//public void testBug93891() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// ContainerInitializer.setInitializer(new CompletionContainerInitializer("P2", new String[] {"/P1"}, new boolean[] {true}, new String[]{"a/*"}));
+// String[] classLib = new String[]{"JCL_LIB"};
+// int classLibLength = classLib.length;
+// String[] lib = new String[classLibLength + 1];
+// System.arraycopy(classLib, 0, lib, 0, classLibLength);
+// lib[classLibLength] = "org.eclipse.wst.jsdt.core.tests.model.TEST_CONTAINER";
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// lib,
+// "bin");
+//
+// this.createFolder("/P2/src/b");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+//
+// // TODO the following code is not the correct way to remove the container
+// // Cleanup caches
+// JavaModelManager manager = JavaModelManager.getJavaModelManager();
+// manager.containers = new HashMap(5);
+// manager.variables = new HashMap(5);
+//
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction1() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// new String[]{"/P1"},
+// "bin");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//
+//public void testAccessRestriction2() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction3() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction4() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.COMPILER_PB_DISCOURAGED_REFERENCE, JavaCore.IGNORE);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction5() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction6() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/c");
+// this.createFile(
+// "/P1/src/c/XX3.js",
+// "package c;\n"+
+// "public class XX3 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P2"},
+// new String[][]{{}},
+// new String[][]{{"b/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFile(
+// "/P3/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P3", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX3[TYPE_REF]{c.XX3, c, Lc.XX3;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction7() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1", "/P3"},
+// new String[][]{{}, {}},
+// new String[][]{{"a/*"}, {}},
+// new boolean[]{false, false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction8() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P3", "/P1"},
+// new String[][]{{}, {}},
+// new String[][]{{}, {"a/*"}},
+// new boolean[]{false, false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX1[TYPE_REF]{a.XX1, a, La.XX1;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction9() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/p11");
+// this.createFile(
+// "/P1/src/p11/XX11.js",
+// "package p11;\n"+
+// "public class XX11 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/p12");
+// this.createFile(
+// "/P1/src/p12/XX12.js",
+// "package p12;\n"+
+// "public class XX12 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1", "/P3"},
+// new String[][]{{}, {}},
+// new String[][]{{"p11/*"}, {"p31/*"}},
+// new boolean[]{true, true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P2/src/p21");
+// this.createFile(
+// "/P2/src/p21/XX21.js",
+// "package p21;\n"+
+// "public class XX21 {\n"+
+// "}");
+//
+// this.createFolder("/P2/src/p22");
+// this.createFile(
+// "/P2/src/p22/XX22.js",
+// "package p22;\n"+
+// "public class XX22 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"p12/*"}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P3/src/p31");
+// this.createFile(
+// "/P3/src/p31/XX31.js",
+// "package p31;\n"+
+// "public class XX31 {\n"+
+// "}");
+//
+// this.createFolder("/P3/src/p32");
+// this.createFile(
+// "/P3/src/p32/XX32.js",
+// "package p32;\n"+
+// "public class XX32 {\n"+
+// "}");
+//
+// // create PX
+// this.createJavaProject(
+// "PX",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P2"},
+// null,
+// null,
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFile(
+// "/PX/src/X.js",
+// "public class X {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// this.deleteProject("PX");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction10() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/p11");
+// this.createFile(
+// "/P1/src/p11/XX11.js",
+// "package p11;\n"+
+// "public class XX11 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/p12");
+// this.createFile(
+// "/P1/src/p12/XX12.js",
+// "package p12;\n"+
+// "public class XX12 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1", "/P3"},
+// new String[][]{{}, {}},
+// new String[][]{{"p11/*"}, {"p31/*"}},
+// new boolean[]{true, true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P2/src/p21");
+// this.createFile(
+// "/P2/src/p21/XX21.js",
+// "package p21;\n"+
+// "public class XX21 {\n"+
+// "}");
+//
+// this.createFolder("/P2/src/p22");
+// this.createFile(
+// "/P2/src/p22/XX22.js",
+// "package p22;\n"+
+// "public class XX22 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"p12/*"}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P3/src/p31");
+// this.createFile(
+// "/P3/src/p31/XX31.js",
+// "package p31;\n"+
+// "public class XX31 {\n"+
+// "}");
+//
+// this.createFolder("/P3/src/p32");
+// this.createFile(
+// "/P3/src/p32/XX32.js",
+// "package p32;\n"+
+// "public class XX32 {\n"+
+// "}");
+//
+// // create PX
+// this.createJavaProject(
+// "PX",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P2"},
+// null,
+// null,
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFile(
+// "/PX/src/X.js",
+// "public class X {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
+// "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
+// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// this.deleteProject("PX");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction11() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/x/y/z/p11");
+// this.createFile(
+// "/P1/src/x/y/z/p11/XX11.js",
+// "package x.y.z.p11;\n"+
+// "public class XX11 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/x/y/z/p12");
+// this.createFile(
+// "/P1/src/x/y/z/p12/XX12.js",
+// "package x.y.z.p12;\n"+
+// "public class XX12 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P3", "/P1"},
+// new String[][]{{}, {}},
+// new String[][]{{"x/y/z/p31/*"}, {"x/y/z/p11/*"}},
+// new boolean[]{true, true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P2/src/x/y/z/p21");
+// this.createFile(
+// "/P2/src/x/y/z/p21/XX21.js",
+// "package x.y.z.p21;\n"+
+// "public class XX21 {\n"+
+// "}");
+//
+// this.createFolder("/P2/src/x/y/z/p22");
+// this.createFile(
+// "/P2/src/x/y/z/p22/XX22.js",
+// "package x.y.z.p22;\n"+
+// "public class XX22 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"x/y/z/p12/*"}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P3/src/x/y/z/p31");
+// this.createFile(
+// "/P3/src/x/y/z/p31/XX31.js",
+// "package x.y.z.p31;\n"+
+// "public class XX31 {\n"+
+// "}");
+//
+// this.createFolder("/P3/src/x/y/z/p32");
+// this.createFile(
+// "/P3/src/x/y/z/p32/XX32.js",
+// "package x.y.z.p32;\n"+
+// "public class XX32 {\n"+
+// "}");
+//
+// // create PX
+// this.createJavaProject(
+// "PX",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P2"},
+// null,
+// null,
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFile(
+// "/PX/src/X.js",
+// "public class X {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX11[TYPE_REF]{x.y.z.p11.XX11, x.y.z.p11, Lx.y.z.p11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX21[TYPE_REF]{x.y.z.p21.XX21, x.y.z.p21, Lx.y.z.p21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX22[TYPE_REF]{x.y.z.p22.XX22, x.y.z.p22, Lx.y.z.p22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX32[TYPE_REF]{x.y.z.p32.XX32, x.y.z.p32, Lx.y.z.p32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// this.deleteProject("PX");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction12() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.ERROR);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.DISABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/p11");
+// this.createFile(
+// "/P1/src/p11/XX11.js",
+// "package p11;\n"+
+// "public class XX11 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/p12");
+// this.createFile(
+// "/P1/src/p12/XX12.js",
+// "package p12;\n"+
+// "public class XX12 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P3", "/P1"},
+// new String[][]{{}, {}},
+// new String[][]{{"p31/*"}, {"p11/*"}},
+// new boolean[]{true, true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P2/src/p21");
+// this.createFile(
+// "/P2/src/p21/XX21.js",
+// "package p21;\n"+
+// "public class XX21 {\n"+
+// "}");
+//
+// this.createFolder("/P2/src/p22");
+// this.createFile(
+// "/P2/src/p22/XX22.js",
+// "package p22;\n"+
+// "public class XX22 {\n"+
+// "}");
+//
+// // create P3
+// this.createJavaProject(
+// "P3",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"p12/*"}},
+// new boolean[]{true},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFolder("/P3/src/p31");
+// this.createFile(
+// "/P3/src/p31/XX31.js",
+// "package p31;\n"+
+// "public class XX31 {\n"+
+// "}");
+//
+// this.createFolder("/P3/src/p32");
+// this.createFile(
+// "/P3/src/p32/XX32.js",
+// "package p32;\n"+
+// "public class XX32 {\n"+
+// "}");
+//
+// // create PX
+// this.createJavaProject(
+// "PX",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P2"},
+// null,
+// null,
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+//
+// this.createFile(
+// "/PX/src/X.js",
+// "public class X {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("PX", "src", "", "X.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX12[TYPE_REF]{p12.XX12, p12, Lp12.XX12;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
+// "XX31[TYPE_REF]{p31.XX31, p31, Lp31.XX31;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE) + "}\n" +
+// "XX11[TYPE_REF]{p11.XX11, p11, Lp11.XX11;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX21[TYPE_REF]{p21.XX21, p21, Lp21.XX21;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX22[TYPE_REF]{p22.XX22, p22, Lp22.XX22;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}\n" +
+// "XX32[TYPE_REF]{p32.XX32, p32, Lp32.XX32;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// this.deleteProject("P3");
+// this.deleteProject("PX");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction13() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.WARNING);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.DISABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
+//public void testAccessRestriction14() throws Exception {
+// Hashtable oldOptions = JavaCore.getOptions();
+// try {
+// Hashtable options = new Hashtable(oldOptions);
+// options.put(JavaCore.COMPILER_PB_FORBIDDEN_REFERENCE, JavaCore.WARNING);
+// options.put(JavaCore.CODEASSIST_FORBIDDEN_REFERENCE_CHECK, JavaCore.ENABLED);
+// options.put(JavaCore.CODEASSIST_DISCOURAGED_REFERENCE_CHECK, JavaCore.ENABLED);
+// JavaCore.setOptions(options);
+//
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+//
+// this.createFolder("/P1/src/a");
+// this.createFile(
+// "/P1/src/a/XX1.js",
+// "package a;\n"+
+// "public class XX1 {\n"+
+// "}");
+//
+// this.createFolder("/P1/src/b");
+// this.createFile(
+// "/P1/src/b/XX2.js",
+// "package b;\n"+
+// "public class XX2 {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"a/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/YY.js",
+// "public class YY {\n"+
+// " void foo() {\n"+
+// " XX\n"+
+// " }\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "YY.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "XX";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "XX2[TYPE_REF]{b.XX2, b, Lb.XX2;, null, "+(R_DEFAULT + R_INTERESTING + R_CASE + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// JavaCore.setOptions(oldOptions);
+// }
+//}
//public void testAccessRestrictionX() throws Exception {
// Hashtable oldOptions = JavaCore.getOptions();
// try {
@@ -2248,149 +2257,159 @@
// JavaCore.setOptions(oldOptions);
// }
//}
-public void testBug96950() throws Exception {
- try {
- // create variable
-// JavaCore.setClasspathVariables(
-// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
-// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
-// null);
-
- // create P1
- this.createJavaProject(
- "P1",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- "bin");
- this.createFile(
- "/P1/src/Taratata.js",
- "public class Taratata {\n"+
- "}");
-
- // create P2
- this.createJavaProject(
- "P2",
- new String[]{"src"},
- new String[]{"JCL_LIB"},
- null,
- null,
- new String[]{"/P1"},
- new String[][]{{}},
- new String[][]{{"**/*"}},
- new boolean[]{false},
- "bin",
- null,
- null,
- null,
- "1.4");
- this.createFile(
- "/P2/src/BreakRules.js",
- "public class BreakRules {\n"+
- " Tara\n"+
- "}");
-
- waitUntilIndexesReady();
-
- // do completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit cu= getCompilationUnit("P2", "src", "", "BreakRules.js");
-
- String str = cu.getSource();
- String completeBehind = "Tara";
- int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
- cu.codeComplete(cursorLocation, requestor);
-
- assertResults(
- "Tara[POTENTIAL_METHOD_DECLARATION]{Tara, LBreakRules;, ()V, Tara, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
- requestor.getResults());
- } finally {
- this.deleteProject("P1");
- this.deleteProject("P2");
- }
-}
+//public void testBug96950() throws Exception {
+// try {
+// // create variable
+//// JavaCore.setClasspathVariables(
+//// new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"},
+//// new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()},
+//// null);
+//
+// // create P1
+// this.createJavaProject(
+// "P1",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// "bin");
+// this.createFile(
+// "/P1/src/Taratata.js",
+// "public class Taratata {\n"+
+// "}");
+//
+// // create P2
+// this.createJavaProject(
+// "P2",
+// new String[]{"src"},
+// new String[]{"JCL_LIB"},
+// null,
+// null,
+// new String[]{"/P1"},
+// new String[][]{{}},
+// new String[][]{{"**/*"}},
+// new boolean[]{false},
+// "bin",
+// null,
+// null,
+// null,
+// "1.4");
+// this.createFile(
+// "/P2/src/BreakRules.js",
+// "public class BreakRules {\n"+
+// " Tara\n"+
+// "}");
+//
+// waitUntilIndexesReady();
+//
+// // do completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit cu= getCompilationUnit("P2", "src", "", "BreakRules.js");
+//
+// String str = cu.getSource();
+// String completeBehind = "Tara";
+// int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
+// cu.codeComplete(cursorLocation, requestor);
+//
+// assertResults(
+// "Tara[POTENTIAL_METHOD_DECLARATION]{Tara, LBreakRules;, ()V, Tara, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}",
+// requestor.getResults());
+// } finally {
+// this.deleteProject("P1");
+// this.deleteProject("P2");
+// }
+//}
/**
* @bug 162621: [model][delta] Validation errors do not clear after replacing jar file
* @test Ensures that changing an internal jar and refreshing takes the change into account
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=162621"
*/
-public void testChangeInternalJar() throws CoreException, IOException {
- String jarName = "b162621.jar";
- try {
- // Create jar file with a class with 2 methods doXXX
- String[] pathAndContents = new String[] {
- "pack/Util.js",
- "package pack;\n" +
- "public class Util {\n" +
- " public void doit2A(int x, int y) { }\n" +
- " public void doit2B(int x) { }\n" +
- "}\n"
- };
- addLibrary(jarName, "b162621_src.zip", pathAndContents, JavaCore.VERSION_1_4);
-
- // Wait a little bit to be sure file system is aware of zip file creation
- try {
- Thread.sleep(1000);
- }
- catch (InterruptedException ie) {
- // skip
- }
-
- // Create compilation unit in which completion occurs
- String path = "/Completion/src/test/Test.js";
- String source = "package test;\n" +
- "import pack.*;\n" +
- "public class Test {\n" +
- " public void foo() {\n" +
- " Util test = new Util();\n" +
- " test.doit2A(1, 2);\n" +
- " }\n" +
- "}\n";
- createFolder("/Completion/src/test");
- createFile(path, source);
-
- // first completion
- CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
- ICompilationUnit unit = getCompilationUnit(path);
- String completeBehind = "test.do";
- int cursorLocation = source.lastIndexOf(completeBehind) + completeBehind.length();
- unit.codeComplete(cursorLocation, requestor);
- assertResults(
- "doit2A[METHOD_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
- "doit2B[METHOD_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
- requestor.getResults());
-
- // change class file to add a third doXXX method and refresh
- String projectLocation = this.currentProject.getProject().getLocation().toOSString();
- String jarPath = projectLocation + File.separator + jarName;
- org.eclipse.wst.jsdt.core.tests.util.Util.createJar(new String[] {
- "pack/Util.js",
- "package pack;\n" +
- "public class Util {\n" +
- " public void doit2A(int x, int y) { }\n" +
- " public void doit2B(int x) { }\n" +
- " public void doit2C(int x) { }\n" +
- "}\n"
- }, jarPath, "1.4");
- this.currentProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
-
- try {
- Thread.sleep(1000);
- }
- catch (InterruptedException ie) {
- // skip
- }
-
- // second completion
- requestor = new CompletionTestsRequestor2();
- unit.codeComplete(cursorLocation, requestor);
- assertResults(
- "doit2A[METHOD_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
- "doit2B[METHOD_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
- "doit2C[METHOD_REF]{doit2C, Lpack.Util;, (I)V, doit2C, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
- requestor.getResults());
- } finally {
- removeLibraryEntry(this.currentProject, new Path(jarName));
- deleteFile(new File(jarName));
- }
-}
+//public void testChangeInternalJar() throws CoreException, IOException {
+//
+//
+// IJavaProject p = this.createJavaProject(
+// "P1",
+// new String[]{"/"},
+// new String[]{},
+// "");
+//
+//
+//
+//
+// try {
+// // Create jar file with a class with 2 methods doXXX
+// String[] pathAndContents = new String[] {
+// "pack/Util.js",
+// "package pack;\n" +
+// "public class Util {\n" +
+// " public void doit2A(int x, int y) { }\n" +
+// " public void doit2B(int x) { }\n" +
+// "}\n"
+// };
+// addLibrary(jarName, "b162621_src.zip", pathAndContents, JavaCore.VERSION_1_4);
+//
+// // Wait a little bit to be sure file system is aware of zip file creation
+// try {
+// Thread.sleep(1000);
+// }
+// catch (InterruptedException ie) {
+// // skip
+// }
+//
+// // Create compilation unit in which completion occurs
+// String path = "/Completion/src/test/Test.js";
+// String source = "package test;\n" +
+// "import pack.*;\n" +
+// "public class Test {\n" +
+// " public void foo() {\n" +
+// " Util test = new Util();\n" +
+// " test.doit2A(1, 2);\n" +
+// " }\n" +
+// "}\n";
+// createFolder("/Completion/src/test");
+// createFile(path, source);
+//
+// // first completion
+// CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2();
+// ICompilationUnit unit = getCompilationUnit(path);
+// String completeBehind = "test.do";
+// int cursorLocation = source.lastIndexOf(completeBehind) + completeBehind.length();
+// unit.codeComplete(cursorLocation, requestor);
+// assertResults(
+// "doit2A[METHOD_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
+// "doit2B[METHOD_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
+// requestor.getResults());
+//
+// // change class file to add a third doXXX method and refresh
+// String projectLocation = this.currentProject.getProject().getLocation().toOSString();
+// String jarPath = projectLocation + File.separator + jarName;
+// org.eclipse.wst.jsdt.core.tests.util.Util.createJar(new String[] {
+// "pack/Util.js",
+// "package pack;\n" +
+// "public class Util {\n" +
+// " public void doit2A(int x, int y) { }\n" +
+// " public void doit2B(int x) { }\n" +
+// " public void doit2C(int x) { }\n" +
+// "}\n"
+// }, jarPath, "1.4");
+// this.currentProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
+//
+// try {
+// Thread.sleep(1000);
+// }
+// catch (InterruptedException ie) {
+// // skip
+// }
+//
+// // second completion
+// requestor = new CompletionTestsRequestor2();
+// unit.codeComplete(cursorLocation, requestor);
+// assertResults(
+// "doit2A[METHOD_REF]{doit2A, Lpack.Util;, (II)V, doit2A, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
+// "doit2B[METHOD_REF]{doit2B, Lpack.Util;, (I)V, doit2B, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}\n" +
+// "doit2C[METHOD_REF]{doit2C, Lpack.Util;, (I)V, doit2C, "+(R_DEFAULT + R_CASE + R_INTERESTING + R_NON_RESTRICTED + R_NON_STATIC) + "}",
+// requestor.getResults());
+// } finally {
+// removeLibraryEntry(this.currentProject, new Path(jarName));
+// deleteFile(new File(jarName));
+// }
+//}
}
diff --git a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/RunCompletionModelTests.java b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/RunCompletionModelTests.java
index 3733a53..0fcdf01 100644
--- a/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/RunCompletionModelTests.java
+++ b/tests/org.eclipse.wst.jsdt.core.tests.model/src/org/eclipse/wst/jsdt/core/tests/model/RunCompletionModelTests.java
@@ -26,11 +26,13 @@
public final static List COMPLETION_SUITES = new ArrayList();
static {
if (!ONLY_JAVADOC) {
- if(false) COMPLETION_SUITES.add(CompletionTests.class);
+ COMPLETION_SUITES.add(CompletionTests.class);
+ COMPLETION_SUITES.add(CompletionTests2.class);
//COMPLETION_SUITES.add(CompletionTests_1_5.class);
if(false) COMPLETION_SUITES.add(CompletionContextTests.class);
//COMPLETION_SUITES.add(CompletionContextTests_1_5.class);
if(false) COMPLETION_SUITES.add(CompletionWithMissingTypesTests.class);
+ if(false) COMPLETION_SUITES.add(CompletionWithMissingTypesTests2.class);
//COMPLETION_SUITES.add(CompletionWithMissingTypesTests_1_5.class);
if(false) COMPLETION_SUITES.add(SnippetCompletionContextTests.class);
}
@@ -45,19 +47,19 @@
}
public static Class[] getTestClasses() {
- int size = COMPLETION_SUITES.size();
- if (!ONLY_JAVADOC) {
- Class[] testClasses = new Class[size+1];
- COMPLETION_SUITES.toArray(testClasses);
- testClasses[size] = CompletionTests2.class;
- if(false) testClasses[size+1] = CompletionWithMissingTypesTests2.class;
- if(false) testClasses[size+2] = SnippetCompletionTests.class;
- if(false) testClasses[size+3] = SnippetCompletionTests_1_5.class;
- return testClasses;
- }
- Class[] testClasses = new Class[size];
- COMPLETION_SUITES.toArray(testClasses);
- return testClasses;
+// int size = COMPLETION_SUITES.size();
+// if (!ONLY_JAVADOC) {
+// Class[] testClasses = new Class[size+1];
+// COMPLETION_SUITES.toArray(testClasses);
+// testClasses[size] = CompletionTests2.class;
+// testClasses[size+1] = CompletionWithMissingTypesTests2.class;
+// if(false) testClasses[size+2] = SnippetCompletionTests.class;
+// if(false) testClasses[size+3] = SnippetCompletionTests_1_5.class;
+// return testClasses;
+// }
+// Class[] testClasses = new Class[size];
+ return (Class[])COMPLETION_SUITES.toArray(new Class[COMPLETION_SUITES.size()]);
+ //return testClasses;
}
public RunCompletionModelTests(String name) {