use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method addPrimaryTopLevelTypeWithinDefaultPackage.
@Test
public void addPrimaryTopLevelTypeWithinDefaultPackage() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("// primary top level type");
_builder.newLine();
this.testHelper.createFile("Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/Bar.java", "// primary top level type", "public class Bar {}");
};
this.assertThereAreDeltas(_function, "Bar");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method renameNestedTypes.
@Test
public void renameNestedTypes() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("public class Foo3 {}");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public static class Foo2 {}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
final Function1<ITextEditor, ITextEditor> _function_1 = (ITextEditor it) -> {
ITextEditor _xblockexpression = null;
{
this._javaEditorExtension.changeContent(it, " Foo ", " NewFoo ");
this._javaEditorExtension.changeContent(it, " Foo2 ", " NewFoo2 ");
_xblockexpression = this._javaEditorExtension.changeContent(it, " Foo3 ", " NewFoo3 ");
}
return _xblockexpression;
};
this.save("/mypackage/Bar.java", _function_1);
};
this.assertThereAreDeltas(_function, "mypackage.Bar", "mypackage.Bar$Foo", "mypackage.Bar$Foo2", "mypackage.Bar$NewFoo", "mypackage.Bar$NewFoo2", "mypackage.Bar$NewFoo$NewFoo3", "mypackage.Bar$Foo$Foo3");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method changeImports4.
@Test
public void changeImports4() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("import java.util.List;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public static class Bar2 {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "import java.util.List;", "import java.awt.List;");
};
this.assertThereAreNotDeltas(_function);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method changeImports2.
@Test
public void changeImports2() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("import java.util.List;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public List<String> bar;");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "import java.util.List;", "import java.awt.List;");
};
this.assertThereAreDeltas(_function, "mypackage.Bar");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method addNestedTypesWithinDefaultPackage2.
@Test
public void addNestedTypesWithinDefaultPackage2() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("// nested types");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("Bar.java", _builder.toString());
final Procedure0 _function = () -> {
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("public class Foo3 {}");
this.save("Bar.java", "// nested types", _builder_1.toString());
};
this.assertThereAreDeltas(_function, "Bar$Foo", "Bar$Foo$Foo3");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations