Lines 19-24
Link Here
|
19 |
import org.eclipse.jdt.core.ICompilationUnit; |
19 |
import org.eclipse.jdt.core.ICompilationUnit; |
20 |
import org.eclipse.jdt.core.eval.IEvaluationContext; |
20 |
import org.eclipse.jdt.core.eval.IEvaluationContext; |
21 |
import org.eclipse.jdt.internal.codeassist.RelevanceConstants; |
21 |
import org.eclipse.jdt.internal.codeassist.RelevanceConstants; |
|
|
22 |
import org.eclipse.jdt.internal.core.eval.EvaluationContextWrapper; |
22 |
|
23 |
|
23 |
import junit.framework.*; |
24 |
import junit.framework.*; |
24 |
|
25 |
|
Lines 44-49
Link Here
|
44 |
public void tearDownSuite() throws Exception { |
45 |
public void tearDownSuite() throws Exception { |
45 |
super.tearDownSuite(); |
46 |
super.tearDownSuite(); |
46 |
} |
47 |
} |
|
|
48 |
private String getVarClassSignature(IEvaluationContext context) { |
49 |
char[] varClassName = ((EvaluationContextWrapper)context).getVarClassName(); |
50 |
return Signature.createTypeSignature(varClassName, true); |
51 |
} |
47 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311 |
52 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=164311 |
48 |
public void testBug164311() throws JavaModelException { |
53 |
public void testBug164311() throws JavaModelException { |
49 |
this.workingCopies = new ICompilationUnit[1]; |
54 |
this.workingCopies = new ICompilationUnit[1]; |
Lines 14046-14051
Link Here
|
14046 |
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"}", |
14051 |
"toString[METHOD_REF]{toString(), Ljava.lang.Object;, ()Ljava.lang.String;, toString, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_NON_STATIC + R_NON_RESTRICTED)+"}", |
14047 |
requestor.getResults()); |
14052 |
requestor.getResults()); |
14048 |
} |
14053 |
} |
|
|
14054 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=179000 |
14055 |
public void testEvaluationContextCompletion6() throws JavaModelException { |
14056 |
this.workingCopies = new ICompilationUnit[1]; |
14057 |
this.workingCopies[0] = getWorkingCopy( |
14058 |
"/Completion/src/test/TestEvaluationContextCompletion6.java", |
14059 |
"package test;"+ |
14060 |
"public class TestEvaluationContextCompletion6 {\n"+ |
14061 |
"}"); |
14062 |
|
14063 |
String start = ""; |
14064 |
IJavaProject javaProject = getJavaProject("Completion"); |
14065 |
IEvaluationContext context = javaProject.newEvaluationContext(); |
14066 |
|
14067 |
context.newVariable( "Object", "someVariable", null ); |
14068 |
|
14069 |
CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true, false, false, false); |
14070 |
context.codeComplete(start, start.length(), requestor, this.wcOwner); |
14071 |
|
14072 |
int startOffset = start.length(); |
14073 |
int endOffset = startOffset; |
14074 |
|
14075 |
assertResults( |
14076 |
"completion offset="+endOffset+"\n"+ |
14077 |
"completion range=["+startOffset+", "+(endOffset)+"]\n"+ |
14078 |
"completion token=\"\"\n"+ |
14079 |
"completion token kind=TOKEN_KIND_NAME\n"+ |
14080 |
"expectedTypesSignatures=null\n"+ |
14081 |
"expectedTypesKeys=null", |
14082 |
requestor.getContext()); |
14083 |
|
14084 |
String varClassSignature = getVarClassSignature(context); |
14085 |
|
14086 |
assertResults( |
14087 |
"someVariable[FIELD_REF]{someVariable, "+varClassSignature+", Ljava.lang.Object;, someVariable, null, "+(R_DEFAULT + R_RESOLVED + R_INTERESTING + R_CASE + R_UNQUALIFIED + R_NON_RESTRICTED)+"}", |
14088 |
requestor.getResults()); |
14089 |
} |
14049 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
14090 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=152123 |
14050 |
public void testFavoriteImports001() throws JavaModelException { |
14091 |
public void testFavoriteImports001() throws JavaModelException { |
14051 |
this.workingCopies = new ICompilationUnit[2]; |
14092 |
this.workingCopies = new ICompilationUnit[2]; |