use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug435043Test 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("\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("\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_11.
@Test
public void test_11() 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.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("\t ");
_builder.append("<|>");
_builder.newLine();
_builder.append("\t ");
_builder.append("val bytes2 = \"FooBar\".bytes.iterator");
_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_29.
@Test
public void test_29() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("static class D {");
_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.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 Bug435043Test method test_12.
@Test
public void test_12() 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.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("\t ");
_builder.append("<|>");
_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_27.
@Test
public void test_27() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("static class D {");
_builder.newLine();
_builder.append("\t ");
_builder.append("val foo = \"\"");
_builder.newLine();
_builder.append("\t ");
_builder.append("<|>");
_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.newLine();
_builder.append("\t ");
_builder.append("val bar = \"\"");
_builder.newLine();
_builder.append("\t ");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalDisplayedAtCursor("equals(Object) - Override method from Object");
}
Aggregations