use of org.eclipse.xtext.ui.resource.Storage2UriMapperImpl in project xtext-eclipse by eclipse.
the class Storage2UriMapperTest method testSimpleFileInProject.
@Test
public void testSimpleFileInProject() throws Exception {
createProject("foo");
IFile file = createFile("foo/bar/baz.txt", "");
Storage2UriMapperImpl mapper = new Storage2UriMapperImpl() {
@Override
public boolean isValidUri(URI uri, IStorage storage) {
return true;
}
};
mapper.setUriValidator(new UriValidator() {
@Override
public boolean isValid(URI uri, IStorage storage) {
return true;
}
@Override
public boolean isPossiblyManaged(IStorage storage) {
return true;
}
});
URI uri = mapper.getUri(file);
assertEquals(URI.createPlatformResourceURI(file.getFullPath().toString(), true), uri);
assertEquals(file, mapper.getStorages(uri).iterator().next().getFirst());
}
Aggregations