use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class ResourceStorageTest method testShouldLoadFromStorage.
@Test
public void testShouldLoadFromStorage() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package mypack");
_builder.newLine();
_builder.newLine();
_builder.append("class MyClass {");
_builder.newLine();
_builder.append("\t");
_builder.append("public def void foo() {");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("}");
_builder.newLine();
final IFile file = this.helper.createFile("mypack/MyClass.xtend", _builder.toString());
IResourcesSetupUtil.waitForBuild();
final URI uri = this.uriMapper.getUri(file);
final ResourceSet resourceSet = this.resourceSetProvider.get(file.getProject());
SourceLevelURIsAdapter.setSourceLevelUris(resourceSet, Collections.<URI>unmodifiableList(CollectionLiterals.<URI>newArrayList()));
Resource _createResource = resourceSet.createResource(uri);
final StorageAwareResource resource = ((StorageAwareResource) _createResource);
final Procedure0 _function = () -> {
Assert.assertTrue(resource.getResourceStorageFacade().shouldLoadFromStorage(resource));
};
this.doWorkInJob(_function);
NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
file.delete(true, _nullProgressMonitor);
IResourcesSetupUtil.waitForBuild();
final Procedure0 _function_1 = () -> {
Assert.assertFalse(resource.getResourceStorageFacade().shouldLoadFromStorage(resource));
};
this.doWorkInJob(_function_1);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method createPrimaryAndNestedTypes.
@Test
public void createPrimaryAndNestedTypes() {
final Procedure0 _function = () -> {
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());
};
this.assertThereAreDeltas(_function, "Bar$Foo$Foo3", "Bar$Foo", "Bar$Foo2", "Bar");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method createPrimaryType2.
@Test
public void createPrimaryType2() {
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();
this.create("/mypackage/Bar.java", _builder.toString());
};
this.assertThereAreDeltas(_function, "mypackage.Bar");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method deletePrimaryType.
@Test
public void deletePrimaryType() {
this.create("Bar.java", "public class Bar {}");
final Procedure0 _function = () -> {
this.delete("Bar.java");
};
this.assertThereAreDeltas(_function, "Bar");
}
use of org.eclipse.xtext.xbase.lib.Procedures.Procedure0 in project xtext-xtend by eclipse.
the class TypesChangingQueuedBuildDataTest method deletePrimaryType2.
@Test
public void deletePrimaryType2() {
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();
this.create("/mypackage/Bar.java", _builder.toString());
final Procedure0 _function = () -> {
this.delete("/mypackage/Bar.java");
};
this.assertThereAreDeltas(_function, "mypackage.Bar");
}
Aggregations