use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class EclipseBug28DirtyStateModifierContentAssistTest method testDirtyStateModifiers_01.
@Test
public void testDirtyStateModifiers_01() throws Exception {
final ContentAssistProcessorTestBuilder builder = newBuilder().withDirtyState().appendNl("final class FooA1 {}").appendNl("class FooA2 {}").append("class FooA3 extends FooA").assertText("FooA2", "FooA3");
assertNoText(builder, "FooA1");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug458611Test method test_04.
@Test
public void test_04() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static extension C.Foo.*");
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("static class Bar {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("static class Foo {");
_builder.newLine();
_builder.append("\t ");
_builder.append("static def sum(Iterable<Bar> bars) {");
_builder.newLine();
_builder.append("\t ");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("def doit(Bar[] myBars) {");
_builder.newLine();
_builder.append(" ");
_builder.append("myBars.sum<|>");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalAtCursor("sum");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug458611Test method test_02.
@Test
public void test_02() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static extension C.Foo.*");
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("static class Bar {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("static class Foo {");
_builder.newLine();
_builder.append("\t ");
_builder.append("static def sum(Bar[] bars) {");
_builder.newLine();
_builder.append("\t ");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("def doit(Iterable<Bar> myBars) {");
_builder.newLine();
_builder.append(" ");
_builder.append("myBars.sum<|>");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertProposalAtCursor("sum");
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug460093Test method testMethodOverrides1.
@Test
public void testMethodOverrides1() {
try {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.util.List");
_builder.newLine();
_builder.newLine();
_builder.append("interface I extends List<String> {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("str");
ContentAssistProcessorTestBuilder _applyProposal = _newBuilder.append(_builder.toString()).assertText("\n\toverride stream() {\n\t\tList.super.stream()\n\t}").applyProposal();
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("import java.util.List");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("interface I extends List<String> {");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("override stream() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("List.super.stream()");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_applyProposal.expectContent(_builder_1.toString());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder in project xtext-xtend by eclipse.
the class Bug461923Test method test_11.
@Test
public void test_11() throws Exception {
ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
StringConcatenation _builder = new StringConcatenation();
_builder.append("import java.util.List");
_builder.newLine();
_builder.append("import com.google.common.collect.ImmutableList");
_builder.newLine();
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append(" ");
_builder.append("def static <T extends CharSequence> m(List<? extends T> list, T value) {");
_builder.newLine();
_builder.append(" ");
_builder.append("ImmutableList.builder.addAll(list.<|>filter[it != value]).build");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append(" ");
_builder.append("def static sum(List<? extends Number> list) {");
_builder.newLine();
_builder.append(" ");
_builder.append("null");
_builder.newLine();
_builder.append(" ");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_newBuilder.append(_builder.toString()).assertNoProposalAtCursor("sum");
}
Aggregations