use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method removePrimaryTopLevelType.
@Test
public void removePrimaryTopLevelType() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "public class 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 renameMethod.
@Test
public void renameMethod() {
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\t");
_builder.append("System.out.println(\"Hello world!\");");
_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", "bar()", "bar2()");
};
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 addAnnotation.
@Test
public void addAnnotation() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append("@javax.annotation.Resource");
_builder_1.newLine();
_builder_1.append("public class Bar {");
_builder_1.newLine();
this.save("/mypackage/Bar.java", "public class Bar {", _builder_1.toString());
};
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 makeFieldPublic.
@Test
public void makeFieldPublic() {
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 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", "private String bar;", "public String 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 addPrimaryTopLevelType.
@Test
public void addPrimaryTopLevelType() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("// primary top level type");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "// primary top level type", "public class Bar {}");
};
this.assertThereAreDeltas(_function, "mypackage.Bar");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations