Hello Christoph,
1) Actually none of the fields are required, because all them are missing in the message fields section:
<messages>
<message name="TestMessage" msgtype="T" msgcat="app">
<!-- no fields defined -->
</message>
</messages>
Field 6000, test case (2, 2) fails currently, because field 6000 is not defined in message + AllowUnknownMessageFields == false:
private void checkIsInMessage(Field<?> field, String msgType) {
if (!isMsgField(msgType, field.getField()) && !allowUnknownMessageFields)
{
throw new FieldException(SessionRejectReason.TAG_NOT_DEFINED_FOR_THIS_MESSAGE_TYPE, field.getField()); // line: 779
}
}
The above check is triggered, because of CheckUserDefinedFields == true.
2) I'm not sure about test case (2,4). It would make sense to FAIL according to documentation, because
- 6000 is a user defined field
- CheckUserDefinedFields == true
- it's not defined in the message
In general I think that checks dependent on flags AllowUnknownMessageFields and CheckUserDefinedFields should be executed independently, although this is not the case at the moment.
From docoumentation. ValidateUserDefinedFields: If set to N, user defined fields will not be rejected if they are not defined in the data dictionary, or are present in messages they do not belong to.
This basically means that if value is true, then all fields >= 5000 should fail if not in message field section or global field section, which would imply that test case (2, 4) should result in FAILURE.
Additionally in my understanding of these flags:
AllowUnknownMessageFields == !CheckUserDefinedFields (however the first flag applies to fields < 5000 only, second to fields >=5000 only)
This is still an issue in version 1.5.2