@Override public LineConvertor newLineConvertor() { LineConvertor[] lineConvertors = new LineConvertor[PhpInterpreter.LINE_PATTERNS.length]; int i = 0; for (Pattern linePattern : PhpInterpreter.LINE_PATTERNS) { lineConvertors[i++] = LineConvertors.filePattern(null, linePattern, null, 1, 2); } return LineConvertors.proxy(lineConvertors); } }
@Override public LineConvertor newLineConvertor() { return LineConvertors.proxy(LineConvertors.filePattern(null, Pattern.compile("^file://([^:]*[^ ])(:)([0-9]*).*"), null, 1, 3), // NOI18N LineConvertors.httpUrl()); } }
public Results(String line, OutputListener listener){ result.add(ConvertedLine.forText(line, listener)); } public void add(String line, OutputListener listener) {
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; } }
/** * Gets the standard convertors. * * @param locator the locator for the convertors to use. * @return */ public static List<LineConvertor> getStandardConvertors(FileLocator locator) { List<LineConvertor> result = new ArrayList<LineConvertor>(4); result.add(new ShortCircuitConvertor(TIME_MATCHER)); result.add(new ShortCircuitConvertor(URL_MATCHER)); result.add(LineConvertors.filePattern(locator, RAILS_RECOGNIZER, null, 1, 2)); result.add(LineConvertors.filePattern(locator, RUBY_COMPILER_WIN_MY, null, 1, 2)); result.add(LineConvertors.filePattern(locator, JRUBY_COMPILER, null, 1, 2)); result.add(LineConvertors.filePattern(locator, RUBY_COMPILER, null, 1, 2)); result.add(LineConvertors.filePattern(locator, RUBY_COMPILER_WIN, null, 1, 2)); return result; }
public LineConvertor newLineConvertor() { final List<LineConvertor> convertorList = new ArrayList<LineConvertor>(); if (convertors != null) { for (LineConvertor each : convertors) { if (each != null) { convertorList.add(each); } } } if (stdConvertors) { convertorList.addAll(getStandardConvertors(locator)); } return LineConvertors.proxy(convertorList.toArray(new LineConvertor[convertorList.size()])); }
private synchronized List<ConvertedLine> convert(String line) { if (outputListener != null) { try { outputListener.write(line); outputListener.write("\n"); // NOI18N } catch (IOException ex) { Exceptions.printStackTrace(ex); } } if (lineConvertor != null) { return lineConvertor.convert(line); } return null; } }
public void add(String line, OutputListener listener) { result.add(ConvertedLine.forText(line, listener)); } @Override
public FileObject getTestcaseFileObject() { return getProject().getLookup().lookup(LineConvertors.FileLocator.class).find(testcase.getLocation()); } }
private synchronized List<ConvertedLine> convert(String line) { if (outputListener != null) { try { outputListener.write(line); outputListener.write("\n"); // NOI18N } catch (IOException ex) { Exceptions.printStackTrace(ex); } } if (lineConvertor != null) { return lineConvertor.convert(line); } return null; } }
@Override public List<ConvertedLine> converted() { List<ConvertedLine> lines = new ArrayList<>(); lines.add(ConvertedLine.forText(line, new OutputListenerBuildTrace(execEnv, project))); return lines; } };
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; } }
@Override public List<ConvertedLine> converted() { List<ConvertedLine> lines = new ArrayList<>(); lines.add(ConvertedLine.forText(line, new OutputListenerRfs(execEnv))); return lines; } };
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);
public List<ConvertedLine> convert(String line) { if (line.indexOf("(See full trace by running task with --trace)") != -1) { // NOI18N return Collections.<ConvertedLine>singletonList( ConvertedLine.forText( NbBundle.getMessage(RakeRunner.class, "RakeSupport.RerunRakeWithTrace"), new OutputListener() { public void outputLineSelected(OutputEvent ev) { } public void outputLineAction(OutputEvent ev) { RubyProcessCreator rpc = new RubyProcessCreator(buildDescriptor(), charsetName); ExecutionService.newService(rpc, template.toExecutionDescriptor(), displayName).run(); } private RubyExecutionDescriptor buildDescriptor() { // copy the old args from template String[] existing = template.getAdditionalArgs() != null ? template.getAdditionalArgs() : new String[0]; String[] args = new String[existing.length + 1]; for (int i = 0; i < existing.length; i++) { args[i] = existing[i]; } args[args.length - 1] = "--trace"; //NOI18N return new RubyExecutionDescriptor(template).additionalArgs(args); } public void outputLineCleared(OutputEvent ev) { } })); } return null; }
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);
public List<ConvertedLine> convert(final String line) { // Don't try to match lines that are too long - the java.util.regex library // throws stack exceptions (101234) if (line.length() > 400) { return null; } Matcher matcher = linePattern.matcher(line); if(matcher.find()) { if(LOGGER.isLoggable(Level.FINEST)) { StringBuilder builder = new StringBuilder(line.length()); builder.append("[ "); for(int i = 1; i < matcher.groupCount(); i++) { String match = matcher.group(i); if(match != null) { if(builder.length() > 2) { builder.append(", "); } builder.append(match); } } builder.append(" ]"); LOGGER.log(Level.FINEST, "ShortCircuitConvertor matched {0}.", builder.toString()); } return Collections.<ConvertedLine>singletonList(ConvertedLine.forText(line, null)); } return null; } }
ConvertedLine.forText(line, new FindFileListener(file, lineno, locator)));