use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435043Test method test_03.
@Test
public void test_03() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.io.*");
_builder.newLine();
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("static class C2 extends InputStream {");
_builder.newLine();
_builder.append("\t ");
_builder.append("val bytes = \"FooBar\".bytes.iterator");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t ");
_builder.append("<|>");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t ");
_builder.append("override read() throws IOException {");
_builder.newLine();
_builder.append("\t ");
_builder.append("if(bytes.hasNext) bytes.next else -1");
_builder.newLine();
_builder.append("\t ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalDisplayedAtCursor("toString() - Override method from Object");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435043Test method test_24.
@Test
public void test_24() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("def static m() {");
_builder.newLine();
_builder.append(" \t");
_builder.append("new Object {");
_builder.newLine();
_builder.append("\t ");
_builder.append("val foo = \"\"");
_builder.newLine();
_builder.append("\t ");
_builder.newLine();
_builder.append("\t ");
_builder.append("override toString() {");
_builder.newLine();
_builder.append("\t ");
_builder.append("\"\"");
_builder.newLine();
_builder.append("\t ");
_builder.append("}");
_builder.newLine();
_builder.append("\t ");
_builder.append("<|>\t\t\t");
_builder.newLine();
_builder.append("\t ");
_builder.append("val bar = \"\"");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalDisplayedAtCursor("equals(Object) - Override method from Object");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435184Test method test_02.
@Test
public void test_02() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.io.*");
_builder.newLine();
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("def static void main(String[] args) {");
_builder.newLine();
_builder.append(" ");
_builder.append("val in = new InputStream {");
_builder.newLine();
_builder.append(" ");
_builder.append("val bytes = new ByteArrayInputStream(\"\".bytes)");
_builder.newLine();
_builder.append(" ");
_builder.append("override read() throws IOException {");
_builder.newLine();
_builder.append(" ");
_builder.append("byte|s.toString");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertTextAtCursorPosition("|", "bytes");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435184Test method test_01.
@Test
public void test_01() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.io.*");
_builder.newLine();
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("def static void main(String[] args) {");
_builder.newLine();
_builder.append(" ");
_builder.append("val in = new InputStream {");
_builder.newLine();
_builder.append(" ");
_builder.append("val bytes = new ByteArrayInputStream(\"\".bytes)");
_builder.newLine();
_builder.append(" ");
_builder.append("override read() throws IOException {");
_builder.newLine();
_builder.append(" ");
_builder.append("bytes.rea|");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertTextAtCursorPosition("|", "read", "read()", "read()");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug436564Test method test_10.
@Test
public void test_10() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("val o = new Object() {");
_builder.newLine();
_builder.append(" \t");
_builder.append("def s1() {}");
_builder.newLine();
_builder.append(" \t");
_builder.append("toS<|>");
_builder.newLine();
_builder.append(" \t");
_builder.append("def s2() {}");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("override toString() {}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalDisplayedAtCursor("toString() - Override method from Object");
}
Aggregations