示例#1
0
 private OperationResult findSimilarSubresult(OperationResult subresult) {
   OperationResult similar = null;
   for (OperationResult sub : getSubresults()) {
     if (sub == subresult) {
       continue;
     }
     if (!sub.operation.equals(subresult.operation)) {
       continue;
     }
     if (sub.status != subresult.status) {
       continue;
     }
     if (!MiscUtil.equals(sub.message, subresult.message)) {
       continue;
     }
     if (similar == null || (similar.count < sub.count)) {
       similar = sub;
     }
   }
   return similar;
 }
示例#2
0
 private void mergeMap(Map<String, Serializable> targetMap, Map<String, Serializable> sourceMap) {
   for (Entry<String, Serializable> targetEntry : targetMap.entrySet()) {
     String targetKey = targetEntry.getKey();
     Serializable targetValue = targetEntry.getValue();
     if (targetValue != null && targetValue instanceof VariousValues) {
       continue;
     }
     Serializable sourceValue = sourceMap.get(targetKey);
     if (MiscUtil.equals(targetValue, sourceValue)) {
       // Entries match, nothing to do
       continue;
     }
     // Entries do not match. The target entry needs to be marked as VariousValues
     targetEntry.setValue(new VariousValues());
   }
   for (Entry<String, Serializable> sourceEntry : sourceMap.entrySet()) {
     String sourceKey = sourceEntry.getKey();
     if (!targetMap.containsKey(sourceKey)) {
       targetMap.put(sourceKey, new VariousValues());
     }
   }
 }
 private void assertEquals(
     String message, Object expected, Object actual, OperationResult result) {
   if (!MiscUtil.equals(expected, actual)) {
     fail(message + "; expected " + expected + ", actual " + actual, result);
   }
 }