use of org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder in project xtext-xtend by eclipse.
the class QuickfixTest method duplicateImport_11.
@Test
public void duplicateImport_11() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static java.lang.String.valueOf|");
_builder.newLine();
_builder.append("import static extension java.lang.String.valueOf");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("def foo() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("1.valueOf");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabels = this.builder.create("Foo.xtend", _builder).assertIssueCodes(IssueCodes.IMPORT_UNUSED).assertResolutionLabels("Organize imports");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("import static extension java.lang.String.valueOf");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("1.valueOf");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}
use of org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder in project xtext-xtend by eclipse.
the class QuickfixTest method redundantModifiers_02.
@Test
public void redundantModifiers_02() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package a");
_builder.newLine();
_builder.append("publ|ic class Foo {}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabels = this.builder.create("Foo.xtend", _builder).assertIssueCodes(org.eclipse.xtend.core.validation.IssueCodes.REDUNDANT_MODIFIER).assertResolutionLabels("Remove the redundant modifier.");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("package a");
_builder_1.newLine();
_builder_1.append(" ");
_builder_1.append("class Foo {}");
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}
use of org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder in project xtext-xtend by eclipse.
the class QuickfixTest method duplicateImport_13.
@Test
public void duplicateImport_13() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("import static java.lang.String.*|");
_builder.newLine();
_builder.append("import static extension java.lang.String.valueOf");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("def foo() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("1.valueOf");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabels = this.builder.create("Foo.xtend", _builder).assertIssueCodes(IssueCodes.IMPORT_UNUSED).assertResolutionLabels("Organize imports");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("import static extension java.lang.String.valueOf");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("1.valueOf");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}
use of org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder in project xtext-xtend by eclipse.
the class QuickfixTest method fixPackageName_4.
@Test
public void fixPackageName_4() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package bar|");
_builder.newLine();
_builder.newLine();
_builder.append("import static bar.C.D.*");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def void m() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("staticM");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.append("class C {");
_builder.newLine();
_builder.append("\t");
_builder.append("static class D {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("static def void staticM() {}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabels = this.builder.create("test/Foo.xtend", _builder).assertIssueCodes(org.eclipse.xtend.core.validation.IssueCodes.WRONG_PACKAGE).assertResolutionLabels("Change package declaration to \'test\'");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("package test");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("import static test.C.D.*");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def void m() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("staticM");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("class C {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("static class D {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("static def void staticM() {}");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_assertResolutionLabels.assertModelAfterQuickfix(_builder_1);
}
use of org.eclipse.xtend.ide.tests.quickfix.QuickfixTestBuilder in project xtext-xtend by eclipse.
the class QuickfixTest method missingConstructorCallParentheses_4.
@Test
public void missingConstructorCallParentheses_4() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("class Foo {");
_builder.newLine();
_builder.append("\t");
_builder.append("def foo() {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("new ArrayList|().size");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
QuickfixTestBuilder _assertResolutionLabelsSubset = this.builder.create("Foo.xtend", _builder).assertIssueCodes(Diagnostic.LINKING_DIAGNOSTIC).assertResolutionLabelsSubset("Import \'ArrayList\' (java.util)");
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("import java.util.ArrayList");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("class Foo {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("def foo() {");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("new ArrayList().size");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
_assertResolutionLabelsSubset.assertModelAfterQuickfix("Import \'ArrayList\' (java.util)", _builder_1);
}
Aggregations