Lines 37-43
Link Here
|
37 |
public class CompletionTests extends AbstractJavaModelCompletionTests { |
37 |
public class CompletionTests extends AbstractJavaModelCompletionTests { |
38 |
|
38 |
|
39 |
static { |
39 |
static { |
40 |
// TESTS_NAMES = new String[] { "testDeprecationCheck17"}; |
40 |
TESTS_NAMES = new String[] { "testBug310427c"}; |
41 |
} |
41 |
} |
42 |
public static Test suite() { |
42 |
public static Test suite() { |
43 |
return buildModelTestSuite(CompletionTests.class); |
43 |
return buildModelTestSuite(CompletionTests.class); |
Lines 21395-21400
Link Here
|
21395 |
requestor.getResults()); |
21395 |
requestor.getResults()); |
21396 |
} |
21396 |
} |
21397 |
|
21397 |
|
|
|
21398 |
|
21399 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=310427 |
21400 |
// To verify that we don't get proposals for fields that have not yet been declared |
21401 |
// inside a field declaration statement |
21402 |
public void testBug310427c() throws JavaModelException { |
21403 |
this.workingCopies = new ICompilationUnit[1]; |
21404 |
this.workingCopies[0] = getWorkingCopy( |
21405 |
"/Completion/src/test/Test.java", |
21406 |
"package test;"+ |
21407 |
"public class Test {\n" + |
21408 |
" int myVar1 = 1;\n" + |
21409 |
" int myVar2 = 1;\n" + |
21410 |
" int myVar3 = myVar;\n" + |
21411 |
" int myVar4 = 1;\n" + |
21412 |
" int myVar5 = 1;\n" + |
21413 |
" }\n" + |
21414 |
"}\n"); |
21415 |
|
21416 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true); |
21417 |
String str = this.workingCopies[0].getSource(); |
21418 |
String completeBehind = "int myVar3 = myVar"; |
21419 |
int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length(); |
21420 |
this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner); |
21421 |
|
21422 |
assertResults( |
21423 |
"myVar1[FIELD_REF]{myVar1, Ltest.Test;, I, myVar1, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}\n" + |
21424 |
"myVar2[FIELD_REF]{myVar2, Ltest.Test;, I, myVar2, null, " + (R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}", |
21425 |
requestor.getResults()); |
21426 |
} |
21427 |
|
21398 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346 |
21428 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=195346 |
21399 |
// To verify that array types aren't proposed inside case, and also |
21429 |
// To verify that array types aren't proposed inside case, and also |
21400 |
// that finals have a higher priority in suggestions inside case expressions. |
21430 |
// that finals have a higher priority in suggestions inside case expressions. |