use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class AbstractSingleEditorQueuedBuildTest method changeImports3.
@Test
public void changeImports3() {
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("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Bar2 {");
_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 renameSecondaryTopLevelType.
@Test
public void renameSecondaryTopLevelType() {
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 Bar2 {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.testHelper.createFile("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.save("/mypackage/Bar.java", "Bar2", "Bar3");
};
this.assertThereAreDeltas(_function, "mypackage.Bar2", "mypackage.Bar3");
} 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 changeImports5.
@Test
public void changeImports5() {
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();
_builder.newLine();
_builder.append("class Bar2 {");
_builder.newLine();
_builder.newLine();
_builder.append("\t");
_builder.append("public List<String> bar2;");
_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", "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 removePublicAndPrivateMethods.
@Test
public void removePublicAndPrivateMethods() {
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.newLine();
_builder.append("\t");
_builder.append("private void bar2() {}");
_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) -> {
return this._javaEditorExtension.changeContent(this._javaEditorExtension.changeContent(it, "public void bar() {}", ""), "private void bar2() {}", "");
};
this.save("/mypackage/Bar.java", _function_1);
};
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 renamePrimaryTopLevelType.
@Test
public void renamePrimaryTopLevelType() {
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", "Bar", "Bar2");
};
this.assertThereAreDeltas(_function, "mypackage.Bar", "mypackage.Bar2");
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations