use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class MutableAssert method assertValidQualifiedName.
public static void assertValidQualifiedName(final String name, final String expectedQualifiedName, final Procedure1<? super String> codeToTest) {
StringConcatenation _builder = new StringConcatenation();
_builder.append(name);
_builder.append(" has to be a valid qualified name");
final String message = _builder.toString();
final Procedure0 _function = () -> {
codeToTest.apply(null);
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, message, _function);
final Procedure0 _function_1 = () -> {
codeToTest.apply(" ");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, message, _function_1);
final Procedure0 _function_2 = () -> {
codeToTest.apply("456");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, message, _function_2);
final Procedure0 _function_3 = () -> {
codeToTest.apply("foo. Bar ");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, message, _function_3);
final Procedure0 _function_4 = () -> {
codeToTest.apply("foo.456.Bar");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, message, _function_4);
codeToTest.apply(expectedQualifiedName);
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method createPrimaryAndSecondaryType2.
@Test
public void createPrimaryAndSecondaryType2() {
final Procedure0 _function = () -> {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.create("/mypackage/Bar.java", _builder.toString());
};
this.assertThereAreDeltas(_function, "mypackage.Foo", "mypackage.Bar");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method deletePrimaryAndNestedTypes.
@Test
public void deletePrimaryAndNestedTypes() {
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.append("\t\t");
_builder.append("}");
_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.create("Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.delete("Bar.java");
};
this.assertThereAreDeltas(_function, "Bar", "Bar$Foo2", "Bar$Foo", "Bar$Foo$Foo3");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method createPrimaryAndNestedTypes2.
@Test
public void createPrimaryAndNestedTypes2() {
final Procedure0 _function = () -> {
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 class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("\t\t");
_builder.append("public class Foo3 {");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_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.create("/mypackage/Bar.java", _builder.toString());
};
this.assertThereAreDeltas(_function, "mypackage.Bar$Foo$Foo3", "mypackage.Bar$Foo", "mypackage.Bar$Foo2", "mypackage.Bar");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method deletePrimaryAndSecondaryType2.
@Test
public void deletePrimaryAndSecondaryType2() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypackage;");
_builder.newLine();
_builder.newLine();
_builder.append("public class Bar {");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.newLine();
_builder.append("class Foo {");
_builder.newLine();
_builder.newLine();
_builder.append("}");
_builder.newLine();
this.create("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.delete("/mypackage/Bar.java");
};
this.assertThereAreDeltas(_function, "mypackage.Bar", "mypackage.Foo");
}
Aggregations