Search in sources :

Example 11 with ContentAssistProcessorTestBuilder

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

the class JavaDocContentAssistTest method testTypeInJavaDoc_2.

@Test
public void testTypeInJavaDoc_2() {
    try {
        ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("package foo");
        _builder.newLine();
        _builder.append("/**");
        _builder.newLine();
        _builder.append(" ");
        _builder.append("* @see java.lang.StringBuff");
        _builder.newLine();
        _builder.append(" ");
        _builder.append("*/");
        _builder.newLine();
        _builder.append("class Foo {}");
        _builder.newLine();
        ContentAssistProcessorTestBuilder _applyProposal = _newBuilder.append(_builder.toString()).assertTextAtCursorPosition(44, "StringBuffer").applyProposal(44);
        StringConcatenation _builder_1 = new StringConcatenation();
        _builder_1.append("package foo");
        _builder_1.newLine();
        _builder_1.append("/**");
        _builder_1.newLine();
        _builder_1.append(" ");
        _builder_1.append("* @see StringBuffer");
        _builder_1.newLine();
        _builder_1.append(" ");
        _builder_1.append("*/");
        _builder_1.newLine();
        _builder_1.append("class Foo {}");
        _builder_1.newLine();
        _applyProposal.expectContent(_builder_1.toString());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
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 12 with ContentAssistProcessorTestBuilder

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

the class JavaDocContentAssistTest method testTypeInJavaDoc_3.

@Test
public void testTypeInJavaDoc_3() {
    try {
        ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("package foo");
        _builder.newLine();
        _builder.append("/**");
        _builder.newLine();
        _builder.append(" ");
        _builder.append("* java.lang.StringBuff");
        _builder.newLine();
        _builder.append(" ");
        _builder.append("*/");
        _builder.newLine();
        _builder.append("class Foo {}");
        _builder.newLine();
        Assert.assertTrue(((List<ICompletionProposal>) Conversions.doWrapArray(_newBuilder.append(_builder.toString()).computeCompletionProposals(39))).isEmpty());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) ICompletionProposal(org.eclipse.jface.text.contentassist.ICompletionProposal) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 13 with ContentAssistProcessorTestBuilder

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

the class MemberFeatureCallProposalsTest method test_03.

@Flaky
@Test
public void test_03() throws Exception {
    ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("class C {");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("def static void main() {");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("val it = #[]");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("println(em)");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("}");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    _newBuilder.append(_builder.toString()).assertTextAtCursorPosition("em", 2, "empty", "emptyList", "emptyMap", "emptySet");
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Flaky(org.eclipse.xtext.testing.Flaky) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 14 with ContentAssistProcessorTestBuilder

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

the class XImportSectionContentAssistTest method testMemberName.

@Test
public void testMemberName() {
    try {
        final ContentAssistProcessorTestBuilder builder = this.newBuilder().append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.").assertTextAtCursorPosition("Foo.", "Foo.".length(), "publicStaticMethod", "publicStaticField");
        builder.applyProposal("publicStaticMethod").expectContent("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.publicStaticMethod");
        builder.applyProposal("publicStaticField").expectContent("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.publicStaticField");
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
Also used : ContentAssistProcessorTestBuilder(org.eclipse.xtext.ui.testing.ContentAssistProcessorTestBuilder) AbstractXtendContentAssistBugTest(org.eclipse.xtend.ide.tests.contentassist.AbstractXtendContentAssistBugTest) Test(org.junit.Test)

Example 15 with ContentAssistProcessorTestBuilder

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

the class XImportSectionContentAssistTest method testMemberName_3.

@Test
public void testMemberName_3() {
    try {
        ContentAssistProcessorTestBuilder _newBuilder = this.newBuilder();
        StringConcatenation _builder = new StringConcatenation();
        _builder.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder.newLine();
        _builder.newLine();
        _builder.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.");
        final ContentAssistProcessorTestBuilder builder = _newBuilder.append(_builder.toString()).assertText("publicStaticMethod", "defaultStaticMethod", "protectedStaticMethod", "publicStaticField", "defaultStaticField", "protectedStaticField");
        ContentAssistProcessorTestBuilder _applyProposal = builder.applyProposal("publicStaticMethod");
        StringConcatenation _builder_1 = new StringConcatenation();
        _builder_1.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_1.newLine();
        _builder_1.newLine();
        _builder_1.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.publicStaticMethod");
        _applyProposal.expectContent(_builder_1.toString());
        ContentAssistProcessorTestBuilder _applyProposal_1 = builder.applyProposal("defaultStaticMethod");
        StringConcatenation _builder_2 = new StringConcatenation();
        _builder_2.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_2.newLine();
        _builder_2.newLine();
        _builder_2.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.defaultStaticMethod");
        _applyProposal_1.expectContent(_builder_2.toString());
        ContentAssistProcessorTestBuilder _applyProposal_2 = builder.applyProposal("protectedStaticMethod");
        StringConcatenation _builder_3 = new StringConcatenation();
        _builder_3.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_3.newLine();
        _builder_3.newLine();
        _builder_3.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.protectedStaticMethod");
        _applyProposal_2.expectContent(_builder_3.toString());
        ContentAssistProcessorTestBuilder _applyProposal_3 = builder.applyProposal("publicStaticField");
        StringConcatenation _builder_4 = new StringConcatenation();
        _builder_4.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_4.newLine();
        _builder_4.newLine();
        _builder_4.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.publicStaticField");
        _applyProposal_3.expectContent(_builder_4.toString());
        ContentAssistProcessorTestBuilder _applyProposal_4 = builder.applyProposal("defaultStaticField");
        StringConcatenation _builder_5 = new StringConcatenation();
        _builder_5.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_5.newLine();
        _builder_5.newLine();
        _builder_5.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.defaultStaticField");
        _applyProposal_4.expectContent(_builder_5.toString());
        ContentAssistProcessorTestBuilder _applyProposal_5 = builder.applyProposal("protectedStaticField");
        StringConcatenation _builder_6 = new StringConcatenation();
        _builder_6.append("package org.eclipse.xtend.ide.tests.data.contentassist");
        _builder_6.newLine();
        _builder_6.newLine();
        _builder_6.append("import static org.eclipse.xtend.ide.tests.data.contentassist.Foo.protectedStaticField");
        _applyProposal_5.expectContent(_builder_6.toString());
    } catch (Throwable _e) {
        throw Exceptions.sneakyThrow(_e);
    }
}
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