ending = '/' + fileName; file = locator.find(thePath = (slashName + ending)); while ((file == null) && (lastSlashIndex != -1)) { slashName = slashName.substring(0, lastSlashIndex); file = locator.find(thePath = (slashName + ending)); if (file == null) { lastSlashIndex = slashName.lastIndexOf( file = locator.find(thePath = fileName);
ending = '/' + fileName; file = locator.find(thePath = (slashName + ending)); while ((file == null) && (lastSlashIndex != -1)) { slashName = slashName.substring(0, lastSlashIndex); file = locator.find(thePath = (slashName + ending)); if (file == null) { lastSlashIndex = slashName.lastIndexOf( file = locator.find(thePath = fileName);
FileObject testFO = testSession.getFileLocator().find(javacIncludes); lookup = Lookups.fixed(testFO); FileObject testFO = testSession.getFileLocator().find(testIncludes); lookup = Lookups.fixed(testFO); String testMethods = properties.getProperty("test.methods");//NOI18N if(testClass != null) { FileObject testFO = testSession.getFileLocator().find(testClass.replace('.', '/') + ".java"); //NOI18N if (testMethods != null) { SingleMethod methodSpec = new SingleMethod(testFO, testMethods); String methodName = properties.getProperty("methodname"); //NOI18N if (className != null){ FileObject testFO = testSession.getFileLocator().find(className.replace('.', '/') + ".java"); //NOI18N if (methodName != null){ SingleMethod methodSpec = new SingleMethod(testFO, methodName);
FileObject fo = locator.find(file);
FileObject testFO = getProject().getLookup().lookup(LineConvertors.FileLocator.class).find(testcase.getLocation()); if (testFO != null){ Project suiteProject = FileOwnerQuery.getOwner(testFO);
private FileObject findFile(final String path) { if (fileLocator != null) { FileObject fo = fileLocator.find(path); if (fo != null) { return fo; } } // Perhaps it's an absolute path of some sort... try to resolve those // Absolute path? Happens for stack traces in libraries and such File file = new File(path); if (file.isFile()) { return FileUtil.toFileObject(FileUtil.normalizeFile(file)); } else { LOGGER.warning("Cannot resolve file for \"" + path + "\" path."); return null; } }
public FileObject getTestcaseFileObject() { return getProject().getLookup().lookup(LineConvertors.FileLocator.class).find(testcase.getLocation()); } }
public FileObject getTestcaseFileObject() { LineConvertors.FileLocator fileLocator = getProject().getLookup().lookup(LineConvertors.FileLocator.class); if(fileLocator == null) { Logger.getLogger(MavenJUnitTestMethodNode.class.getName()).log(Level.WARNING, "no LineConvertors.FileLocator available for project {0}", getProject().getProjectDirectory()); } if(testcase == null) { Logger.getLogger(MavenJUnitTestMethodNode.class.getName()).log(Level.WARNING, "null tescase in MavenJUnitTestMethodNode for project {0}", getProject().getProjectDirectory()); } String location = testcase != null ? testcase.getLocation() : null; return fileLocator != null && location != null ? fileLocator.find(location) : null; } }