use of org.eclipse.jdt.internal.core.NonJavaResource in project xtext-eclipse by eclipse.
the class Storage2UriMapperJdtImplTest method testBug463258_04.
@Test
public void testBug463258_04() throws Exception {
IFolder externalFolder = createExternalFolder("externalFolder");
IJavaProject project = createJavaProject("foo");
addExternalFolderToClasspath(project, externalFolder);
Storage2UriMapperJavaImpl impl = getStorage2UriMapper();
IPackageFragmentRoot root = project.getPackageFragmentRoot(externalFolder);
IPackageFragment foo = root.getPackageFragment("foo");
NonJavaResource fileInFolder = new NonJavaResource(foo, externalFolder.getFile("foo/does.notexist"));
externalFolder.delete(true, null);
URI uri = impl.getUri(fileInFolder);
assertNull(uri);
}
use of org.eclipse.jdt.internal.core.NonJavaResource in project xtext-eclipse by eclipse.
the class JavaClassPathResourceForIEditorInputFactoryTest method testBug463258_04.
@Test(expected = CoreException.class)
public void testBug463258_04() throws Throwable {
IFolder externalFolder = createExternalFolder("externalFolder");
IJavaProject project = createJavaProject("foo");
addExternalFolderToClasspath(project, externalFolder);
IPackageFragmentRoot root = project.getPackageFragmentRoot(externalFolder);
IPackageFragment foo = root.getPackageFragment("foo");
NonJavaResource fileInFolder = new NonJavaResource(foo, externalFolder.getFile("foo/doesNotExist.testlanguage"));
externalFolder.delete(true, null);
XtextReadonlyEditorInput editorInput = new XtextReadonlyEditorInput(fileInFolder);
try {
factory.createResource(editorInput);
} catch (WrappedException e) {
throw e.getCause();
}
}
Aggregations