use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method removePrivateMethod.
@Test
public void removePrivateMethod() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("private void 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", "private void bar() {}", "");
};
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 removeSecondaryTopLevelTypeWithinDefaultPackage.
@Test
public void removeSecondaryTopLevelTypeWithinDefaultPackage() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("public class Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {}");
_builder.newLine();
this.testHelper.createFile("Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("Bar.java", "class Foo {}", "");
};
this.assertThereAreDeltas(_function, "Foo");
} 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 testRenameMethodWithoutSaving.
@Test
public void testRenameMethodWithoutSaving() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public void bar() {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("package mypackage;");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("public class Bar2 {");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("public void bar() {");
_builder_1.newLine();
_builder_1.append("\t");
_builder_1.append("}");
_builder_1.newLine();
_builder_1.newLine();
_builder_1.append("}");
_builder_1.newLine();
this.testHelper.createFile("/mypackage/Bar2.java", _builder_1.toString());
final Procedure0 _function = () -> {
this.close("/mypackage/Bar.java", "bar()", "bar2()");
this.save("/mypackage/Bar2.java", "bar()", "bar2()");
};
this.assertThereAreDeltas(_function, "mypackage.Bar2");
} 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 removeSecondaryTopLevelType.
@Test
public void removeSecondaryTopLevelType() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "class Foo {}", "");
};
this.assertThereAreDeltas(_function, "mypackage.Foo");
} 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 addSecondaryTopLevelType.
@Test
public void addSecondaryTopLevelType() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("// secondary top level type");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "// secondary top level type", "class Foo {}");
};
this.assertThereAreDeltas(_function, "mypackage.Foo");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations