use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testMakeAndDeleteFolder.
@Test
public void testMakeAndDeleteFolder() {
final Path someFolder = new Path("/foo/bar");
final Path someFile = someFolder.append("Foo.txt");
Assert.assertFalse(this.fs.exists(someFolder));
Assert.assertFalse(this.fs.isFile(someFolder));
Assert.assertFalse(this.fs.isFolder(someFolder));
this.fs.setContents(someFile, "Hello Foo");
Assert.assertFalse(this.fs.isFile(someFolder));
Assert.assertTrue(this.fs.isFolder(someFolder));
Assert.assertTrue(this.fs.exists(someFolder));
this.fs.delete(someFolder);
Assert.assertTrue(this.fs.exists(someFolder));
this.fs.delete(someFile);
this.fs.delete(someFolder);
Assert.assertFalse(this.fs.exists(someFolder));
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testGetFileChildren.
@Test
public void testGetFileChildren() {
final Path file = new Path("/foo/bar/Foo.text");
Assert.assertFalse(this.fs.exists(file));
Assert.assertEquals(0, IterableExtensions.size(this.fs.getChildren(file)));
this.fs.setContents(file, "Hello Foo");
Assert.assertTrue(this.fs.exists(file));
Assert.assertEquals(0, IterableExtensions.size(this.fs.getChildren(file)));
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testGetFolderURI.
@Test
public void testGetFolderURI() {
final Path path = new Path("/foo/bar");
Assert.assertFalse(this.fs.exists(path));
Assert.assertNotNull(this.fs.toURI(path));
Path _append = path.append("Foo.txt");
this.fs.setContents(_append, "Hello Foo");
Assert.assertTrue(this.fs.exists(path));
Assert.assertNotNull(this.fs.toURI(path));
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testGetFileURI.
@Test
public void testGetFileURI() {
final Path file = new Path("/foo/bar/Foo.text");
Assert.assertFalse(this.fs.exists(file));
Assert.assertNotNull(this.fs.toURI(file));
this.fs.setContents(file, "Hello Foo");
Assert.assertTrue(this.fs.exists(file));
this.assertToURI(file, "Hello Foo");
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testGetWorkspaceURI.
@Test
public void testGetWorkspaceURI() {
final Path path = Path.ROOT;
Assert.assertTrue(this.fs.exists(path));
Assert.assertNull(this.fs.toURI(path));
}
Aggregations