@Test public void testLocateExternalResourceName() { final String PATH = "/dummy/path/123"; Trace trace = createValidTrace(PATH); List<ExternalResourceDescriptor> externalResourceDescriptors = (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace); assertNotNull("No descriptors extracted", externalResourceDescriptors); assertEquals("Mismatched number of descriptors", 1, externalResourceDescriptors.size()); ExternalResourceDescriptor descriptor = externalResourceDescriptors.get(0); assertSame("Mismatched descriptor frame", trace.getRootFrame(), descriptor.getFrame()); assertDescriptorContents("testLocateExternalResourceName", PATH, descriptor); }
public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames) { if (ListUtil.size(frames) <= 0) { return Collections.emptyList(); } List<ExternalResourceDescriptor> descriptors = new ArrayList<ExternalResourceDescriptor>(frames.size()); for (Frame frame : frames) { Operation op = frame.getOperation(); String path = op.get(FilesTrackerDefinitions.PATH_ATTR, String.class); if (StringUtil.isEmpty(path)) { continue; } String hashString = MD5NameGenerator.getName(path); String color = colorManager.getColor(op); ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame, FilesTrackerDefinitions.TYPE.getName() + ":" + hashString, path, ExternalResourceType.FILESTORE.name(), FilesTrackerDefinitions.TYPE.getName(), color, false); descriptors.add(desc); } return descriptors; }
FilesTrackerExternalResourceAnalyzer extends AbstractExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames) { if (ListUtil.size(frames) <= 0) { return Collections.emptyList(); } List<ExternalResourceDescriptor> descriptors = new ArrayList<ExternalResourceDescriptor>(frames.size()); for (Frame frame : frames) { Operation op = frame.getOperation(); String path = op.get(FilesTrackerDefinitions.PATH_ATTR, String.class); if (StringUtil.isEmpty(path)) { continue; } String hashString = MD5NameGenerator.getName(path); String color = colorManager.getColor(op); ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame, FilesTrackerDefinitions.TYPE.getName() + ":" + hashString, path, ExternalResourceType.FILESTORE.name(), FilesTrackerDefinitions.TYPE.getName(), color, false); descriptors.add(desc); } return descriptors; } }
FilesTrackerExternalResourceAnalyzer extends AbstractExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames) { if (ListUtil.size(frames) <= 0) { return Collections.emptyList(); } List<ExternalResourceDescriptor> descriptors = new ArrayList<ExternalResourceDescriptor>(frames.size()); for (Frame frame : frames) { Operation op = frame.getOperation(); String path = op.get(FilesTrackerDefinitions.PATH_ATTR, String.class); if (StringUtil.isEmpty(path)) { continue; } String hashString = MD5NameGenerator.getName(path); String color = colorManager.getColor(op); ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame, FilesTrackerDefinitions.TYPE.getName() + ":" + hashString, path, ExternalResourceType.FILESTORE.name(), FilesTrackerDefinitions.TYPE.getName(), color, false); descriptors.add(desc); } return descriptors; } private  FilesTrackerExternalResourceAnalyzer(); }
FilesTrackerExternalResourceAnalyzer extends AbstractExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames) { if (ListUtil.size(frames) <= 0) { return Collections.emptyList(); } List<ExternalResourceDescriptor> descriptors = new ArrayList<ExternalResourceDescriptor>(frames.size()); for (Frame frame : frames) { Operation op = frame.getOperation(); String path = op.get(FilesTrackerDefinitions.PATH_ATTR, String.class); if (StringUtil.isEmpty(path)) { continue; } String hashString = MD5NameGenerator.getName(path); String color = colorManager.getColor(op); ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame, FilesTrackerDefinitions.TYPE.getName() + ":" + hashString, path, ExternalResourceType.FILESTORE.name(), FilesTrackerDefinitions.TYPE.getName(), color, false); descriptors.add(desc); } return descriptors; } private  FilesTrackerExternalResourceAnalyzer(); static final FilesTrackerExternalResourceAnalyzer getInstance(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames); }
FilesTrackerExternalResourceAnalyzer extends AbstractExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames) { if (ListUtil.size(frames) <= 0) { return Collections.emptyList(); } List<ExternalResourceDescriptor> descriptors = new ArrayList<ExternalResourceDescriptor>(frames.size()); for (Frame frame : frames) { Operation op = frame.getOperation(); String path = op.get(FilesTrackerDefinitions.PATH_ATTR, String.class); if (StringUtil.isEmpty(path)) { continue; } String hashString = MD5NameGenerator.getName(path); String color = colorManager.getColor(op); ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame, FilesTrackerDefinitions.TYPE.getName() + ":" + hashString, path, ExternalResourceType.FILESTORE.name(), FilesTrackerDefinitions.TYPE.getName(), color, false); descriptors.add(desc); } return descriptors; } private  FilesTrackerExternalResourceAnalyzer(); static final FilesTrackerExternalResourceAnalyzer getInstance(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> frames);  }