for (Object c : editor.getDiagramEditPart().getConnections()) {
if (c instanceof ConnectionNodeEditPart) {
ConnectionNodeEditPart connection = (ConnectionNodeEditPart) c;
EObject element = connection.resolveSemanticElement();
if (element instanceof SimpleCondition) {
SimpleCondition w = (SimpleCondition) element;
if (connection.getSource().equals(source) &&
connection.getTarget().equals(target) && w.getName().equals(name))
return connection; // found it
found += ", " + w.getName();
}
}
}
fail("assertHasRunInstanceWire: no connection found between '" + source + "' and '" + target + "' with name '" + name + "'. found: " + found);