use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class JavaIoFileSystemTest method testMakeAndDeleteFile.
@Test
public void testMakeAndDeleteFile() {
final Path path = new Path("/foo/src/my/pack/Foo.txt");
Assert.assertFalse(this.fs.exists(path));
this.fs.setContents(path, "Hello Foo");
Assert.assertTrue(this.fs.exists(path));
Assert.assertEquals("Hello Foo", this.fs.getContents(path));
Assert.assertTrue(this.fs.isFile(path));
Assert.assertFalse(this.fs.isFolder(path));
this.fs.delete(path);
Assert.assertFalse(this.fs.exists(path));
Assert.assertFalse(this.fs.isFile(path));
Assert.assertFalse(this.fs.isFolder(path));
}
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 ChangeListenerAddingFileSystemSupportTest method setup.
@Before
public void setup() {
UIResourceChangeRegistry _uIResourceChangeRegistry = new UIResourceChangeRegistry();
this.registry = _uIResourceChangeRegistry;
this.uri = org.eclipse.emf.common.util.URI.createPlatformResourceURI("myProject/src/com/acme/C.xtend", true);
ChangeListenerAddingFileSystemSupportTest.NoopFileSystemSupport _noopFileSystemSupport = new ChangeListenerAddingFileSystemSupportTest.NoopFileSystemSupport();
ChangeListenerAddingFileSystemSupport _changeListenerAddingFileSystemSupport = new ChangeListenerAddingFileSystemSupport(this.uri, _noopFileSystemSupport, this.registry);
this.fsa = _changeListenerAddingFileSystemSupport;
Path _path = new Path("a");
this.path = _path;
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class ChangeListenerAddingFileSystemSupportTest method discardCreateAndModifyInformation.
@Test
public void discardCreateAndModifyInformation() {
this.fsa.mkdir(this.path);
Path _path = new Path("b");
this.fsa.mkdir(_path);
Assert.assertTrue(this.registry.getChangesNotRelevantListeners().containsEntry(this.path.toString(), this.uri));
Assert.assertTrue(this.registry.getChangesNotRelevantListeners().containsEntry("b", this.uri));
this.registry.discardCreateOrModifyInformation(this.uri);
Assert.assertTrue(this.registry.getChangesNotRelevantListeners().isEmpty());
}
use of org.eclipse.xtend.lib.macro.file.Path in project xtext-xtend by eclipse.
the class EclipseFileSystemTest method testIssue383.
@Test
public void testIssue383() {
if ((this.fs instanceof AbstractFileSystemSupport)) {
final AbstractFileSystemSupport afs = ((AbstractFileSystemSupport) this.fs);
final IProject px = this.createProject("px");
this.createProject("py");
final ResourceSet rs = this.resourceSetProvider.get(px);
final Resource rx = rs.createResource(URI.createPlatformResourceURI("px/foo/xxxx", true));
final Resource rxb = rs.createResource(URI.createPlatformResourceURI("px/bar/yyyy", true));
final Resource ry = rs.createResource(URI.createPlatformResourceURI("py/bar/xxxx", true));
Path pathx = afs.getPath(rx);
Assert.assertEquals("/px/foo/xxxx", pathx.toString());
Path pathxb = afs.getPath(rxb);
Assert.assertEquals("/px/bar/yyyy", pathxb.toString());
Path pathy = afs.getPath(ry);
Assert.assertEquals("/py/bar/xxxx", pathy.toString());
} else {
Assert.fail("fs is no AbstractFileSystemSupport");
}
}
Aggregations