Search in sources :

Example 26 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug435043Test method test_17.

@Test
public void test_17() 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("toS<|>");
    _builder.newLine();
    _builder.append("\t  ");
    _builder.append("val bytes = \"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");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 27 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug435043Test method test_22.

@Test
public void test_22() 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("new() {}");
    _builder.newLine();
    _builder.append("\t  ");
    _builder.append("toS<|>");
    _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");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 28 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug435043Test method test_07.

@Test
public void test_07() 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("toS<|>");
    _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");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 29 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug435043Test method test_19.

@Test
public void test_19() 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 = new Object() {}");
    _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");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 30 with ContentAssistProcessorTestBuilder

use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.

the class Bug435043Test method test_20.

@Test
public void test_20() 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 = new Object() {}");
    _builder.newLine();
    _builder.append("\t  ");
    _builder.append("toS<|>");
    _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");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Aggregations

ContentAssistProcessorTestBuilder (org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder)185 Test (org.junit.Test)184 AbstractXtendContentAssistBugTest (org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest)183 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)182 Flaky (org.eclipse.xtext.testing.Flaky)13 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)4 List (java.util.List)1