I'm trying to write some unit tests for my NetBeans module, but i'm unable to get an instance of the FileObject class:
@Before
public void setup() throws URISyntaxException{
URL url = this.getClass().getResource("/project-template/");
file = new File(url.toURI());
}
@Test
public void testIsProject() throws URISyntaxException {
FileObject fo = FileUtil.toFileObject(file);
MyProjectFactory instance = new MyProjectFactory();
assertTrue( instance.isProject(fo));
}
The "project-template" folder, under the resources directory contains a valid project,
and altouhg the file
is correct,
FileObject fo
is always null.