test_class.declarator: messageUtil = new MessageUtil()
test_class.modifier: private final
test_class.original_string: private final MessageUtil messageUtil = new MessageUtil();
test_class.type: MessageUtil
test_class.var_name: messageUtil
test_class.file: BackEnd/Core/sailfish-core/src/test/java/com/exactpro/sf/actions/TestMessageUtil.java
test_class.identifier: TestMessageUtil
test_case.body: @Test
      public void testFindGroup() {
          try {
              messageUtil.FindGroup(null, null, null);
              Assert.fail("Null list");
          } catch (EPSCommonException e) {
              e.printStackTrace();
          }
  
          List<IMessage> list = new ArrayList<IMessage>();
  
          try {
              messageUtil.FindGroup(list, null, null);
              Assert.fail("Null field name");
          } catch (EPSCommonException e) {
              e.printStackTrace();
          }
  
          String fieldName = "field";
  
          IMessage msg = new MapMessage("namespace", "name");
          msg.addField("f1", "v1");
          list.add(msg);
  
          Assert.assertEquals(msg, messageUtil.FindGroup(list, fieldName, null));
  
          Object value = 1;
  
          msg = new MapMessage("namespace", "name");
          msg.addField(fieldName, Integer.valueOf(1));
          list.add(msg);
  
          Assert.assertEquals(msg, messageUtil.FindGroup(list, fieldName, value));
      }
test_case.class_method_signature: TestMessageUtil.testFindGroup()
test_case.full_signature: @Test public void testFindGroup()
test_case.identifier: testFindGroup
test_case.invocations: FindGroup fail printStackTrace FindGroup fail printStackTrace addField add assertEquals FindGroup addField valueOf add assertEquals FindGroup
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindGroup()
focal_class.file: BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/actions/MessageUtil.java
focal_class.identifier: MessageUtil
focal_class.class_method_signature: MessageUtil.FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)
focal_class.full_signature: @Description("Finds a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>return</b> - a message matched by the field name and value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindGroup(groups, fieldName, fieldValue)}") @UtilityMethod public IMessage FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)
focal_class.identifier: FindGroup
focal_class.modifiers: @Description("Finds a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>return</b> - a message matched by the field name and value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindGroup(groups, fieldName, fieldValue)}") @UtilityMethod public
focal_class.parameters: (List<IMessage> groups, String fieldName, Object fieldValue)
focal_class.return: IMessage
focal_class.signature: IMessage FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)
focal_class.class_method_signature: MessageUtil.FindField(List<IMessage> groups, String fieldName, Object fieldValue, String targetFieldName)
focal_class.full_signature: @Description("Finds the value of the target field for a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>targetFieldName</b> – the target field name." + "<b>return</b> - the target field value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindField(groups, fieldName, fieldValue, targetFieldName)}") @UtilityMethod public Object FindField(List<IMessage> groups, String fieldName, Object fieldValue, String targetFieldName)
focal_class.identifier: FindField
focal_class.modifiers: @Description("Finds the value of the target field for a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>targetFieldName</b> – the target field name." + "<b>return</b> - the target field value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindField(groups, fieldName, fieldValue, targetFieldName)}") @UtilityMethod public
focal_class.parameters: (List<IMessage> groups, String fieldName, Object fieldValue, String targetFieldName)
focal_class.return: Object
focal_class.signature: Object FindField(List<IMessage> groups, String fieldName, Object fieldValue, String targetFieldName)
focal_class.class_method_signature: MessageUtil.Any()
focal_class.full_signature: @Description("Returns the special object representing any value.<br/>" + "This value can be used instead of '*' and referred to from other filters.<br/>" + "Example:<br/>" + "#{Any()} returns \"ANY\"") @UtilityMethod public Object Any()
focal_class.identifier: Any
focal_class.modifiers: @Description("Returns the special object representing any value.<br/>" + "This value can be used instead of '*' and referred to from other filters.<br/>" + "Example:<br/>" + "#{Any()} returns \"ANY\"") @UtilityMethod public
focal_class.parameters: ()
focal_class.return: Object
focal_class.signature: Object Any()
focal_class.class_method_signature: MessageUtil.Empty()
focal_class.full_signature: @Description("Returns the special object representing an empty value.<br/>" + "This value can be used instead of '#' and referred to from other filters.<br/>"+ "Example:<br/>" + "#{Empty()} returns \"EMPTY\"") @UtilityMethod public Object Empty()
focal_class.identifier: Empty
focal_class.modifiers: @Description("Returns the special object representing an empty value.<br/>" + "This value can be used instead of '#' and referred to from other filters.<br/>"+ "Example:<br/>" + "#{Empty()} returns \"EMPTY\"") @UtilityMethod public
focal_class.parameters: ()
focal_class.return: Object
focal_class.signature: Object Empty()
focal_class.class_method_signature: MessageUtil.Regex(String pattern)
focal_class.full_signature: @Description("Returns the regex filter object for specified pattern.<br/>" + "Example: #{Regex(\".*\")}") @UtilityMethod public IFilter Regex(String pattern)
focal_class.identifier: Regex
focal_class.modifiers: @Description("Returns the regex filter object for specified pattern.<br/>" + "Example: #{Regex(\".*\")}") @UtilityMethod public
focal_class.parameters: (String pattern)
focal_class.return: IFilter
focal_class.signature: IFilter Regex(String pattern)
focal_class.superclass: extends AbstractCaller
focal_method.body: @Description("Finds a message within the list, matching the specified field.<br/>" +
              "<b>fieldName</b> - the field name for the matching group.<br/>" +
              "<b>fieldValue</b> - the field value for the matching group.<br/>" +
              "<b>return</b> - a message matched by the field name and value.<br/>" +
              "Considering the above said, the final syntax is:<br/>" +
              "#{FindGroup(groups, fieldName, fieldValue)}")
      @UtilityMethod
      public IMessage FindGroup(List<IMessage> groups, String fieldName, Object fieldValue) {
          if (groups != null && !groups.isEmpty()) {
              fieldName = fieldName != null ? fieldName.trim() : null;
              if (fieldName != null && !fieldName.isEmpty()) {
                  for (IMessage msg : groups) {
                      if (msg.isFieldSet(fieldName) && msg.getField(fieldName).equals(fieldValue)
                              || !msg.isFieldSet(fieldName) && fieldValue == null) {
                          return msg;
                      }
                  }
                  throw new EPSCommonException("Group with " + fieldName + " == " + fieldValue + " not found");
              }
              throw new EPSCommonException("Field name is null or empty");
          }
          throw new EPSCommonException("List groups is null or empty");
      }
focal_method.class_method_signature: MessageUtil.FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)
focal_method.full_signature: @Description("Finds a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>return</b> - a message matched by the field name and value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindGroup(groups, fieldName, fieldValue)}") @UtilityMethod public IMessage FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)
focal_method.identifier: FindGroup
focal_method.invocations: isEmpty trim isEmpty isFieldSet equals getField isFieldSet
focal_method.modifiers: @Description("Finds a message within the list, matching the specified field.<br/>" + "<b>fieldName</b> - the field name for the matching group.<br/>" + "<b>fieldValue</b> - the field value for the matching group.<br/>" + "<b>return</b> - a message matched by the field name and value.<br/>" + "Considering the above said, the final syntax is:<br/>" + "#{FindGroup(groups, fieldName, fieldValue)}") @UtilityMethod public
focal_method.parameters: (List<IMessage> groups, String fieldName, Object fieldValue)
focal_method.return: IMessage
focal_method.signature: IMessage FindGroup(List<IMessage> groups, String fieldName, Object fieldValue)