test_class.declarator: uncheckedFields = new HashSet<>()
test_class.modifier: private static final
test_class.original_string: private static final Set<String> uncheckedFields = new HashSet<>();
test_class.type: Set<String>
test_class.var_name: uncheckedFields
test_class.declarator: messageFactory
test_class.modifier: private
test_class.original_string: private IMessageFactory messageFactory;
test_class.type: IMessageFactory
test_class.var_name: messageFactory
test_class.file: BackEnd/Core/sailfish-core/src/test/java/com/exactpro/sf/comparison/TestMessageComparator.java
test_class.identifier: TestMessageComparator
test_class.superclass: extends AbstractTest
test_case.body: @Test
      public void compareMessages() throws IOException, ProtocolCodecException
      {
          IMessage msg1 = new MapMessage("MarketDataSnapshotFullRefresh", "namespace");
          IMessage msg2 = new MapMessage("MarketDataSnapshotFullRefresh", "namespace");
  
          List<IMessage> list = new ArrayList<>();
          IMessage group = new MapMessage("MDEntries", "namespace");
          group.addField("269", '1');
          group.addField("270", 20.01D);
          group.addField("271", 40.01D);
  
          list.add(group);
          group = new MapMessage("MDEntries", "namespace");
  
          group.addField("269", '2');
          group.addField("270", 20.01D);
          group.addField("271", 40.01D);
  
          list.add(group);
          msg1.addField("MDEntries", list);
  
          list = new ArrayList<>();
          list.add(group);
          msg2.addField("MDEntries", list);
  
          ComparatorSettings compSettings = new ComparatorSettings();
  
          long startTime = System.currentTimeMillis();
          ComparisonResult comparisonResult = MessageComparator.compare(msg1, msg2, compSettings);
          System.out.printf("diff %d\n", System.currentTimeMillis() - startTime);
          System.out.println(comparisonResult);
          Assert.assertEquals(0, ComparisonUtil.getResultCount(comparisonResult, StatusType.FAILED));
      }
test_case.class_method_signature: TestMessageComparator.compareMessages()
test_case.full_signature: @Test public void compareMessages()
test_case.identifier: compareMessages
test_case.invocations: addField addField addField add addField addField addField add addField add addField currentTimeMillis compare printf currentTimeMillis println assertEquals getResultCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void compareMessages()
focal_class.declarator: COMPARISON_PRECISION = pow(10, -10)
focal_class.modifier: public static
focal_class.original_string: public static double COMPARISON_PRECISION = pow(10, -10);
focal_class.type: double
focal_class.var_name: COMPARISON_PRECISION
focal_class.declarator: DUMMY = "DUMMY"
focal_class.modifier: private static final
focal_class.original_string: private static final String DUMMY = "DUMMY";
focal_class.type: String
focal_class.var_name: DUMMY
focal_class.file: BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/comparison/MessageComparator.java
focal_class.identifier: MessageComparator
focal_class.class_method_signature: MessageComparator.compare(IMessage actual, IMessage expected, ComparatorSettings settings)
focal_class.full_signature: public static ComparisonResult compare(IMessage actual, IMessage expected, ComparatorSettings settings)
focal_class.identifier: compare
focal_class.modifiers: public static
focal_class.parameters: (IMessage actual, IMessage expected, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compare(IMessage actual, IMessage expected, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.compare(IMessage actual, IMessage expected, ComparatorSettings settings, boolean checkNames)
focal_class.full_signature: @SuppressWarnings("deprecation") public static ComparisonResult compare(IMessage actual, IMessage expected, ComparatorSettings settings, boolean checkNames)
focal_class.identifier: compare
focal_class.modifiers: @SuppressWarnings("deprecation") public static
focal_class.parameters: (IMessage actual, IMessage expected, ComparatorSettings settings, boolean checkNames)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compare(IMessage actual, IMessage expected, ComparatorSettings settings, boolean checkNames)
focal_class.class_method_signature: MessageComparator.compareValues(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.full_signature: protected static ComparisonResult compareValues(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.identifier: compareValues
focal_class.modifiers: protected static
focal_class.parameters: (String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compareValues(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.compareObjects(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.full_signature: private static ComparisonResult compareObjects(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.identifier: compareObjects
focal_class.modifiers: private static
focal_class.parameters: (String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compareObjects(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.compareLists(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.full_signature: private static ComparisonResult compareLists(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.identifier: compareLists
focal_class.modifiers: private static
focal_class.parameters: (String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compareLists(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.full_signature: private static ComparisonResult compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.identifier: compareMessages
focal_class.modifiers: private static
focal_class.parameters: (String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.initialComparison(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.full_signature: private static ComparisonResult initialComparison(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.identifier: initialComparison
focal_class.modifiers: private static
focal_class.parameters: (String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult initialComparison(String name, Object actual, Object expected, boolean unchecked, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_class.class_method_signature: MessageComparator.addToResult(Object object, ComparisonResult result, StatusType status, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings, boolean actual)
focal_class.full_signature: private static ComparisonResult addToResult(Object object, ComparisonResult result, StatusType status, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings, boolean actual)
focal_class.identifier: addToResult
focal_class.modifiers: private static
focal_class.parameters: (Object object, ComparisonResult result, StatusType status, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings, boolean actual)
focal_class.return: ComparisonResult
focal_class.signature: ComparisonResult addToResult(Object object, ComparisonResult result, StatusType status, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings, boolean actual)
focal_class.class_method_signature: MessageComparator.getMetaContainers(List<MetaContainer> metaContainers, int index, boolean removeInheritedKeyFields)
focal_class.full_signature: private static List<MetaContainer> getMetaContainers(List<MetaContainer> metaContainers, int index, boolean removeInheritedKeyFields)
focal_class.identifier: getMetaContainers
focal_class.modifiers: private static
focal_class.parameters: (List<MetaContainer> metaContainers, int index, boolean removeInheritedKeyFields)
focal_class.return: List<MetaContainer>
focal_class.signature: List<MetaContainer> getMetaContainers(List<MetaContainer> metaContainers, int index, boolean removeInheritedKeyFields)
focal_class.class_method_signature: MessageComparator.getMetaContainers(List<MetaContainer> metaContainers, String name, boolean removeInheritedKeyFields)
focal_class.full_signature: private static List<MetaContainer> getMetaContainers(List<MetaContainer> metaContainers, String name, boolean removeInheritedKeyFields)
focal_class.identifier: getMetaContainers
focal_class.modifiers: private static
focal_class.parameters: (List<MetaContainer> metaContainers, String name, boolean removeInheritedKeyFields)
focal_class.return: List<MetaContainer>
focal_class.signature: List<MetaContainer> getMetaContainers(List<MetaContainer> metaContainers, String name, boolean removeInheritedKeyFields)
focal_class.class_method_signature: MessageComparator.checkTypes(Object actual, Object expected, Class<?> clazz, IFieldStructure structure)
focal_class.full_signature: private static boolean checkTypes(Object actual, Object expected, Class<?> clazz, IFieldStructure structure)
focal_class.identifier: checkTypes
focal_class.modifiers: private static
focal_class.parameters: (Object actual, Object expected, Class<?> clazz, IFieldStructure structure)
focal_class.return: boolean
focal_class.signature: boolean checkTypes(Object actual, Object expected, Class<?> clazz, IFieldStructure structure)
focal_class.class_method_signature: MessageComparator.checkStructureType(Class<?> clazz, IFieldStructure structure)
focal_class.full_signature: private static Exception checkStructureType(Class<?> clazz, IFieldStructure structure)
focal_class.identifier: checkStructureType
focal_class.modifiers: private static
focal_class.parameters: (Class<?> clazz, IFieldStructure structure)
focal_class.return: Exception
focal_class.signature: Exception checkStructureType(Class<?> clazz, IFieldStructure structure)
focal_class.class_method_signature: MessageComparator.isObject(Object value)
focal_class.full_signature: private static boolean isObject(Object value)
focal_class.identifier: isObject
focal_class.modifiers: private static
focal_class.parameters: (Object value)
focal_class.return: boolean
focal_class.signature: boolean isObject(Object value)
focal_class.class_method_signature: MessageComparator.isCollection(IFieldStructure structure)
focal_class.full_signature: private static boolean isCollection(IFieldStructure structure)
focal_class.identifier: isCollection
focal_class.modifiers: private static
focal_class.parameters: (IFieldStructure structure)
focal_class.return: boolean
focal_class.signature: boolean isCollection(IFieldStructure structure)
focal_class.class_method_signature: MessageComparator.getExpectedList(Object expected, List<?> embeddedListFilter)
focal_class.full_signature: private static List<?> getExpectedList(Object expected, List<?> embeddedListFilter)
focal_class.identifier: getExpectedList
focal_class.modifiers: private static
focal_class.parameters: (Object expected, List<?> embeddedListFilter)
focal_class.return: List<?>
focal_class.signature: List<?> getExpectedList(Object expected, List<?> embeddedListFilter)
focal_class.class_method_signature: MessageComparator.getValue(Object wrapper)
focal_class.full_signature: private static Object getValue(Object wrapper)
focal_class.identifier: getValue
focal_class.modifiers: private static
focal_class.parameters: (Object wrapper)
focal_class.return: Object
focal_class.signature: Object getValue(Object wrapper)
focal_class.class_method_signature: MessageComparator.getCount(ComparisonResult result, StatusType statusType)
focal_class.full_signature: private static int getCount(ComparisonResult result, StatusType statusType)
focal_class.identifier: getCount
focal_class.modifiers: private static
focal_class.parameters: (ComparisonResult result, StatusType statusType)
focal_class.return: int
focal_class.signature: int getCount(ComparisonResult result, StatusType statusType)
focal_class.class_method_signature: MessageComparator.invertResults(ComparisonResult result, Map<String, Boolean> negativeMap)
focal_class.full_signature: protected static void invertResults(ComparisonResult result, Map<String, Boolean> negativeMap)
focal_class.identifier: invertResults
focal_class.modifiers: protected static
focal_class.parameters: (ComparisonResult result, Map<String, Boolean> negativeMap)
focal_class.return: void
focal_class.signature: void invertResults(ComparisonResult result, Map<String, Boolean> negativeMap)
focal_method.body: private static ComparisonResult compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings) {
          ComparisonResult result = initialComparison(name, actual, expected, unchecked, structure, metaContainers, settings);
  
          if(result.getStatus() != null) {
              return result;
          }
  
          IMessage actualMessage = (IMessage)actual;
          IMessage expectedMessage = (IMessage)expected;
          Collection<String> fieldNames = null;
          Map<String, Boolean> keyFields = keyFieldsOnly ? metaContainers.get(0).getKeyFields() : Collections.emptyMap();
  
          if (keyFieldsOnly) {
              fieldNames = keyFields.keySet();
          } else if (structure != null) {
              fieldNames = structure.getFields().keySet();
          } else {
              fieldNames = new LinkedHashSet<>();
              fieldNames.addAll(actualMessage.getFieldNames());
              fieldNames.addAll(expectedMessage.getFieldNames());
          }
  
          for(String fieldName : fieldNames) {
              Object actualValue = actualMessage.getField(fieldName);
              Object expectedValue = expectedMessage.getField(fieldName);
  
              if(actualValue == null && expectedValue == null) {
                  continue;
              }
  
              boolean uncheckedField = unchecked || settings.getUncheckedFields().contains(fieldName);
              boolean checkKeyFieldsOnly = keyFieldsOnly && keyFields.get(fieldName);
              IFieldStructure fieldStructure = structure != null ? structure.getFields().get(fieldName) : null;
              List<MetaContainer> subMetaContainers = getMetaContainers(metaContainers, fieldName, checkKeyFieldsOnly);
  
              result.addResult(compareValues(fieldName, actualValue, expectedValue, uncheckedField, checkKeyFieldsOnly, fieldStructure, subMetaContainers, settings));
          }
  
          return result;
      }
focal_method.class_method_signature: MessageComparator.compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_method.full_signature: private static ComparisonResult compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_method.identifier: compareMessages
focal_method.invocations: initialComparison getStatus getKeyFields get emptyMap keySet keySet getFields addAll getFieldNames addAll getFieldNames getField getField contains getUncheckedFields get get getFields getMetaContainers addResult compareValues
focal_method.modifiers: private static
focal_method.parameters: (String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)
focal_method.return: ComparisonResult
focal_method.signature: ComparisonResult compareMessages(String name, Object actual, Object expected, boolean unchecked, boolean keyFieldsOnly, IFieldStructure structure, List<MetaContainer> metaContainers, ComparatorSettings settings)