);
}
private ExternalResourceDescriptor assertExternalResourceAnalysis(Operation op) {
Frame frame = createMockOperationWrapperFrame(op);
ExternalResourceDescriptor desc = analyzer.extractExternalResourceDescriptor(frame);
assertNotNull("No resource", desc);
assertSame("Mismatched frame", frame, desc.getFrame());
assertEquals("Mismatched host", op.get(TcpConnectionOperationCollector.HOST_ADDRESS_ATTR, String.class), desc.getHost());
assertEquals("Mismatched port", op.getInt(TcpConnectionOperationCollector.PORT_ATTR, (-1)), desc.getPort());
assertEquals("Mismatched type", ExternalResourceType.SERVER.name(), desc.getType());
assertFalse("Not outgoing", desc.isIncoming());
assertFalse("Unexpected parent", desc.isParent());
String uri = op.get(OperationFields.URI, String.class);
assertEquals("Mismatched name", MD5NameGenerator.getName(uri), desc.getName());
assertEquals("Mismatched label", op.getLabel() + " " + uri, desc.getLabel());
return desc;
}