@Test public void test_ExtractMeaningfulNames_ParserReturnsTwo() throws Exception { Frame frame = mock(Frame.class); String testUri = "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.17.184.138)(PORT = boat)) " + "(ADDRESS = (PROTOCOL = TCP)(HOST = 10.17.184.139)(PORT = 1521)))"; List<ExternalResourceDescriptor> result = dbAnalyzer.extractMeaningfulNames(frame, testUri); assertEquals(2, result.size()); ExternalResourceDescriptor res = result.get(0); String tohash1 = "oracle" + "" + "10.17.184.138" + -1; assertEquals("oracle", res.getVendor()); assertEquals(null, res.getLabel()); assertEquals("10.17.184.138", res.getHost()); assertEquals(-1, res.getPort()); assertEquals("oracle:1:" + MD5NameGenerator.getName(tohash1), res.getName()); assertEquals(Boolean.FALSE, Boolean.valueOf(res.isIncoming())); res = result.get(1); String tohash2 = "oracle" + "" + "10.17.184.139" + 1521; assertEquals("oracle", res.getVendor()); assertEquals(null, res.getLabel()); assertEquals("10.17.184.139", res.getHost()); assertEquals(1521, res.getPort()); assertEquals("oracle:2:" + MD5NameGenerator.getName(tohash2), res.getName()); assertEquals(Boolean.FALSE, Boolean.valueOf(res.isIncoming())); }
public List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString) { List<ExternalResourceDescriptor> parserRecognizedDescriptors = getParserRecognizedDescriptors(frame, connectionString); if (ListUtil.size(parserRecognizedDescriptors) > 0) { return parserRecognizedDescriptors; } return getFallbackDescriptor(frame, connectionString); }
DatabaseJDBCURIAnalyzer extends AbstractExternalResourceAnalyzer { public List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString) { List<ExternalResourceDescriptor> parserRecognizedDescriptors = getParserRecognizedDescriptors(frame, connectionString); if (ListUtil.size(parserRecognizedDescriptors) > 0) { return parserRecognizedDescriptors; } return getFallbackDescriptor(frame, connectionString); } }
DatabaseJDBCURIAnalyzer extends AbstractExternalResourceAnalyzer { public List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString) { List<ExternalResourceDescriptor> parserRecognizedDescriptors = getParserRecognizedDescriptors(frame, connectionString); if (ListUtil.size(parserRecognizedDescriptors) > 0) { return parserRecognizedDescriptors; } return getFallbackDescriptor(frame, connectionString); } protected  DatabaseJDBCURIAnalyzer(OperationType type); }
DatabaseJDBCURIAnalyzer extends AbstractExternalResourceAnalyzer { public List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString) { List<ExternalResourceDescriptor> parserRecognizedDescriptors = getParserRecognizedDescriptors(frame, connectionString); if (ListUtil.size(parserRecognizedDescriptors) > 0) { return parserRecognizedDescriptors; } return getFallbackDescriptor(frame, connectionString); } protected  DatabaseJDBCURIAnalyzer(OperationType type); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> dbFrames); List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString); }
DatabaseJDBCURIAnalyzer extends AbstractExternalResourceAnalyzer { public List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString) { List<ExternalResourceDescriptor> parserRecognizedDescriptors = getParserRecognizedDescriptors(frame, connectionString); if (ListUtil.size(parserRecognizedDescriptors) > 0) { return parserRecognizedDescriptors; } return getFallbackDescriptor(frame, connectionString); } protected  DatabaseJDBCURIAnalyzer(OperationType type); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> dbFrames); List<ExternalResourceDescriptor> extractMeaningfulNames(Frame frame, String connectionString);  }