use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.
the class AbstractFSSynchronizationTest method testCleanProjectAsOutput.
@Test
public void testCleanProjectAsOutput() {
final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
it.setOutputDirectory("./");
it.setCanClearOutputDirectory(true);
it.setCleanUpDerivedResources(false);
};
final Procedure0 _function_1 = () -> {
try {
final File projectDirectory = this.project.getLocation().toFile();
final int initialSize = ((List<File>) Conversions.doWrapArray(projectDirectory.listFiles())).size();
Assert.assertNotEquals(0, initialSize);
IResourcesSetupUtil.createFile(this.project.getFile(("src/Foo" + this.F_EXT)).getFullPath(), "object Foo");
IResourcesSetupUtil.reallyWaitForAutoBuild();
final int expectedSize = ((List<File>) Conversions.doWrapArray(projectDirectory.listFiles())).size();
Assert.assertNotEquals(initialSize, expectedSize);
IResourcesSetupUtil.cleanBuild();
Assert.assertEquals(expectedSize, ((List<File>) Conversions.doWrapArray(projectDirectory.listFiles())).size());
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
};
this.withOutputConfiguration(_function, _function_1);
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.
the class AbstractFSSynchronizationTest method testDeleteTraceFileWithProjectAsOutput.
@Test
public void testDeleteTraceFileWithProjectAsOutput() {
final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
it.setOutputDirectory("./");
};
final Procedure0 _function_1 = () -> {
this.testDeleteTraceFile(this.project);
};
this.withOutputConfiguration(_function, _function_1);
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-eclipse by eclipse.
the class AbstractFSSynchronizationTest method testCleanUpProjectDerivedResourcesWithUpdateDerived.
@Test
public void testCleanUpProjectDerivedResourcesWithUpdateDerived() {
final Procedure1<OutputConfiguration> _function = (OutputConfiguration it) -> {
it.setOutputDirectory("./");
};
final Procedure0 _function_1 = () -> {
this.testCleanUpDerivedResourcesWithUpdateDerived(this.project);
};
this.withOutputConfiguration(_function, _function_1);
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class CheckMutableClassDeclarationProcessor method doRegisterGlobals.
@Override
public void doRegisterGlobals(final ClassDeclaration annotatedClass, @Extension final RegisterGlobalsContext context) {
final Procedure1<String> _function = (String qualifiedName) -> {
context.registerClass(qualifiedName);
};
MutableAssert.assertValidQualifiedName("qualifiedName", "foo.Bar", _function);
final Procedure0 _function_1 = () -> {
context.registerClass("foo.Bar");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "The type \'foo.Bar\' has already been registered.", _function_1);
final Procedure1<String> _function_2 = (String qualifiedName) -> {
context.registerAnnotationType(qualifiedName);
};
MutableAssert.assertValidQualifiedName("qualifiedName", "foo.Bar2", _function_2);
final Procedure0 _function_3 = () -> {
context.registerAnnotationType("foo.Bar2");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "The type \'foo.Bar2\' has already been registered.", _function_3);
final Procedure1<String> _function_4 = (String qualifiedName) -> {
context.registerEnumerationType(qualifiedName);
};
MutableAssert.assertValidQualifiedName("qualifiedName", "foo.Bar3", _function_4);
final Procedure0 _function_5 = () -> {
context.registerEnumerationType("foo.Bar3");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "The type \'foo.Bar3\' has already been registered.", _function_5);
final Procedure1<String> _function_6 = (String qualifiedName) -> {
context.registerInterface(qualifiedName);
};
MutableAssert.assertValidQualifiedName("qualifiedName", "foo.Bar4", _function_6);
final Procedure0 _function_7 = () -> {
context.registerInterface("foo.Bar4");
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "The type \'foo.Bar4\' has already been registered.", _function_7);
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class CheckMutableEnumerationTypeDeclarationProcessor method doTransform.
@Override
public void doTransform(final List<? extends MutableEnumerationTypeDeclaration> annotatedTargetElements, @Extension final TransformationContext context) {
for (final MutableEnumerationTypeDeclaration enumeration : annotatedTargetElements) {
{
final Procedure1<String> _function = (String identifier) -> {
final Procedure1<MutableEnumerationValueDeclaration> _function_1 = (MutableEnumerationValueDeclaration it) -> {
};
enumeration.addValue(identifier, _function_1).remove();
};
MutableAssert.assertValidJavaIdentifier("name", _function);
final Procedure0 _function_1 = () -> {
enumeration.addValue("foo", null);
};
MutableAssert.<IllegalArgumentException>assertThrowable(IllegalArgumentException.class, "initializer cannot be null", _function_1);
final Procedure0 _function_2 = () -> {
final Procedure1<MutableEnumerationValueDeclaration> _function_3 = (MutableEnumerationValueDeclaration it) -> {
};
enumeration.addValue("A", _function_3).setVisibility(Visibility.PRIVATE);
};
MutableAssert.<UnsupportedOperationException>assertThrowable(UnsupportedOperationException.class, "It is not possible to change visibility of enumeration value.", _function_2);
}
}
}
Aggregations