Lines 148-177
Link Here
|
148 |
throw c; |
148 |
throw c; |
149 |
} |
149 |
} |
150 |
} |
150 |
} |
151 |
|
151 |
static { |
|
|
152 |
// TESTS_NAMES = new String[] { "testBug96950" }; |
153 |
} |
152 |
public static Test suite() { |
154 |
public static Test suite() { |
153 |
TestSuite suite = new Suite(CompletionTests2.class.getName()); |
155 |
return buildTestSuite(CompletionTests2.class); |
154 |
|
|
|
155 |
suite.addTest(new CompletionTests2("testBug29832")); |
156 |
suite.addTest(new CompletionTests2("testBug33560")); |
157 |
suite.addTest(new CompletionTests2("testBug79288")); |
158 |
suite.addTest(new CompletionTests2("testBug91772")); |
159 |
suite.addTest(new CompletionTests2("testBug93891")); |
160 |
suite.addTest(new CompletionTests2("testAccessRestriction1")); |
161 |
suite.addTest(new CompletionTests2("testAccessRestriction2")); |
162 |
suite.addTest(new CompletionTests2("testAccessRestriction3")); |
163 |
suite.addTest(new CompletionTests2("testAccessRestriction4")); |
164 |
suite.addTest(new CompletionTests2("testAccessRestriction5")); |
165 |
suite.addTest(new CompletionTests2("testAccessRestriction6")); |
166 |
suite.addTest(new CompletionTests2("testAccessRestriction7")); |
167 |
suite.addTest(new CompletionTests2("testAccessRestriction8")); |
168 |
suite.addTest(new CompletionTests2("testAccessRestriction9")); |
169 |
suite.addTest(new CompletionTests2("testAccessRestriction10")); |
170 |
suite.addTest(new CompletionTests2("testAccessRestriction11")); |
171 |
suite.addTest(new CompletionTests2("testAccessRestriction12")); |
172 |
suite.addTest(new CompletionTests2("testAccessRestriction13")); |
173 |
suite.addTest(new CompletionTests2("testAccessRestriction14")); |
174 |
return suite; |
175 |
} |
156 |
} |
176 |
|
157 |
|
177 |
File createFile(File parent, String name, String content) throws IOException { |
158 |
File createFile(File parent, String name, String content) throws IOException { |
Lines 2205-2208
Link Here
|
2205 |
// JavaCore.setOptions(oldOptions); |
2186 |
// JavaCore.setOptions(oldOptions); |
2206 |
// } |
2187 |
// } |
2207 |
//} |
2188 |
//} |
|
|
2189 |
public void testBug96950() throws Exception { |
2190 |
try { |
2191 |
// create variable |
2192 |
JavaCore.setClasspathVariables( |
2193 |
new String[] {"JCL_LIB", "JCL_SRC", "JCL_SRCROOT"}, |
2194 |
new IPath[] {getExternalJCLPath(), getExternalJCLSourcePath(), getExternalJCLRootSourcePath()}, |
2195 |
null); |
2196 |
|
2197 |
// create P1 |
2198 |
this.createJavaProject( |
2199 |
"P1", |
2200 |
new String[]{"src"}, |
2201 |
new String[]{"JCL_LIB"}, |
2202 |
"bin"); |
2203 |
this.createFile( |
2204 |
"/P1/src/Taratata.java", |
2205 |
"public class Taratata {\n"+ |
2206 |
"}"); |
2207 |
|
2208 |
// create P2 |
2209 |
this.createJavaProject( |
2210 |
"P2", |
2211 |
new String[]{"src"}, |
2212 |
new String[]{"JCL_LIB"}, |
2213 |
null, |
2214 |
null, |
2215 |
new String[]{"/P1"}, |
2216 |
new String[][]{{}}, |
2217 |
new String[][]{{"**/*"}}, |
2218 |
new boolean[]{false}, |
2219 |
"bin", |
2220 |
null, |
2221 |
null, |
2222 |
null, |
2223 |
"1.4"); |
2224 |
this.createFile( |
2225 |
"/P2/src/BreakRules.java", |
2226 |
"public class BreakRules {\n"+ |
2227 |
" Tara\n"+ |
2228 |
"}"); |
2229 |
|
2230 |
waitUntilIndexesReady(); |
2231 |
|
2232 |
// do completion |
2233 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(); |
2234 |
ICompilationUnit cu= getCompilationUnit("P2", "src", "", "BreakRules.java"); |
2235 |
|
2236 |
String str = cu.getSource(); |
2237 |
String completeBehind = "Tara"; |
2238 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
2239 |
cu.codeComplete(cursorLocation, requestor); |
2240 |
|
2241 |
assertResults( |
2242 |
"Tara[POTENTIAL_METHOD_DECLARATION]{Tara, LBreakRules;, ()V, Tara, "+(R_DEFAULT + R_INTERESTING + R_NON_RESTRICTED) + "}", |
2243 |
requestor.getResults()); |
2244 |
} finally { |
2245 |
this.deleteProject("P1"); |
2246 |
this.deleteProject("P2"); |
2247 |
} |
2248 |
} |
2208 |
} |
2249 |
} |