arugal commented on issue #3990: [test/e2e] Enhancement TopoMatcher
URL: https://github.com/apache/skywalking/pull/3990#issuecomment-560250962
 
 
   @wu-sheng  Hi, look at these two.
   
https://github.com/apache/skywalking/blob/3cb622daed914761cbb791d34d78ea7d9b8e5d5f/test/e2e/e2e-base/src/main/java/org/apache/skywalking/e2e/topo/CallMatcher.java#L38-L43
   
   ```java
       private static void convertNodeId(List<CallMatcher> callMatchers, 
List<Node> nodes) {
           for (CallMatcher callMatcher : callMatchers) {
               Node sourceNode = 
VariableExpressParser.parse(callMatcher.getSource(), nodes, Node::getName);
               Node targetNode = 
VariableExpressParser.parse(callMatcher.getTarget(), nodes, Node::getName);
   
               boolean convert = false;
               if (nonNull(sourceNode)) {
                   callMatcher.setSource(sourceNode.getId());
                   convert = true;
               }
               if (nonNull(targetNode)) {
                   callMatcher.setTarget(targetNode.getId());
                   convert = true;
               }
   
               if (convert) {
                   callMatcher.setId(String.join("_", callMatcher.getSource(), 
callMatcher.getTarget()));
               }
           }
       }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to