Search in sources :

Example 1 with AbstractFileSystemSupport

use of org.eclipse.xtend.core.macro.AbstractFileSystemSupport 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");
    }
}
Also used : Path(org.eclipse.xtend.lib.macro.file.Path) AbstractFileSystemSupport(org.eclipse.xtend.core.macro.AbstractFileSystemSupport) Resource(org.eclipse.emf.ecore.resource.Resource) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test) JavaIoFileSystemTest(org.eclipse.xtend.ide.tests.macros.JavaIoFileSystemTest)

Aggregations

IProject (org.eclipse.core.resources.IProject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 AbstractFileSystemSupport (org.eclipse.xtend.core.macro.AbstractFileSystemSupport)1 JavaIoFileSystemTest (org.eclipse.xtend.ide.tests.macros.JavaIoFileSystemTest)1 Path (org.eclipse.xtend.lib.macro.file.Path)1 Test (org.junit.Test)1