@Test public void testExactlyTwoDifferentExternalResourceNames() { final String OTHER_HOST = "127.0.0.2"; final int OTHER_PORT = 5673; Operation op1 = createOperation(TEST_HOST, TEST_PORT); KeyValPair<String, String> props1 = addOperationProps(op1, true, true, Boolean.FALSE); Operation op2 = createOperation(OTHER_HOST, OTHER_PORT); KeyValPair<String, String> props2 = addOperationProps(op2, true, false, Boolean.FALSE); Operation dummyOp = new Operation(); SimpleFrameBuilder builder = new SimpleFrameBuilder(); builder.enter(new Operation().type(OperationType.HTTP)); builder.enter(op2); builder.exit(); builder.enter(dummyOp); builder.enter(op1); builder.exit(); builder.exit(); Frame frame = builder.exit(); Trace trace = Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), frame); List<ExternalResourceDescriptor> externalResourceDescriptors = (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace); assertEquals("Mismatched number of resources", 2, externalResourceDescriptors.size()); }
public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace) { return locateExternalResourceName(trace, locateFrames(trace)); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace) { return locateExternalResourceName(trace, locateFrames(trace)); } }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace) { return locateExternalResourceName(trace, locateFrames(trace)); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace) { return locateExternalResourceName(trace, locateFrames(trace)); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); final boolean isIncomingResource(); final RabbitPluginOperationType getRabbitPluginOperationType(); OperationType getOperationType(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace); Collection<Frame> locateFrames(Trace trace); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> queueFrames); static String getFinalExchangeName(String exchange); static String getFinalRoutingKey(String routingKey); static String buildExternalResourceName(String finalExchange, String finalRoutingKey, String vhost); static String buildExternalResourceLabel(String label); static String buildLabel(String finalExchange, String finalRoutingKey); @Override String toString(); }
AbstractRabbitMQResourceAnalyzer implements ExternalResourceAnalyzer { public Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace) { return locateExternalResourceName(trace, locateFrames(trace)); } protected  AbstractRabbitMQResourceAnalyzer(RabbitPluginOperationType type, boolean incoming); final boolean isIncomingResource(); final RabbitPluginOperationType getRabbitPluginOperationType(); OperationType getOperationType(); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace); Collection<Frame> locateFrames(Trace trace); Collection<ExternalResourceDescriptor> locateExternalResourceName(Trace trace, Collection<Frame> queueFrames); static String getFinalExchangeName(String exchange); static String getFinalRoutingKey(String routingKey); static String buildExternalResourceName(String finalExchange, String finalRoutingKey, String vhost); static String buildExternalResourceLabel(String label); static String buildLabel(String finalExchange, String finalRoutingKey); @Override String toString(); static final String RABBIT; static final String NO_EXCHANGE; static final String NO_ROUTING_KEY; static final int DEFAULT_SCORE; static final String UNNAMED_TEMP_QUEUE_KEY_PREFIX; static final String UNNAMED_TEMP_QUEUE_LABEL; static final String UNNAMED_RPC_QUEUE_KEY_PREFIX; static final String UNNAMED_RPC_QUEUE_LABEL; }