diff --git a/artio-codecs/src/test/java/uk/co/real_logic/artio/dictionary/generation/AbstractDecoderGeneratorTest.java b/artio-codecs/src/test/java/uk/co/real_logic/artio/dictionary/generation/AbstractDecoderGeneratorTest.java index 6cb11281b4..5630d8481a 100644 --- a/artio-codecs/src/test/java/uk/co/real_logic/artio/dictionary/generation/AbstractDecoderGeneratorTest.java +++ b/artio-codecs/src/test/java/uk/co/real_logic/artio/dictionary/generation/AbstractDecoderGeneratorTest.java @@ -838,6 +838,16 @@ public void shouldReasonablyValidateGroupNumbersLessThanTheNumberOfElementsInThe assertInvalid(decoder, INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, 120); } + //TODO this test was added to guide the bugfix + @Test + public void shouldReasonablyValidateGroupNumbersLessThanTheNumberOfElementsInTheGroupList() throws Exception + { + final Decoder decoder = decodeHeartbeatWithRejectingUnknownFields( + REPEATING_GROUP_MESSAGE_WITH_THREE, REPEATING_GROUP_MESSAGE_WITH_TOO_HIGH_NUMBER_FIELD); + +// assertInvalid(decoder, INCORRECT_NUMINGROUP_COUNT_FOR_REPEATING_GROUP, 120); + } + @Test public void shouldSupportGroupNumbersGreaterThanTheNumberOfElementsInTheNestedGroup() throws Exception { @@ -1879,6 +1889,15 @@ Decoder decodeHeartbeatWithoutValidation(final String example) throws Exception return decoder; } + private Decoder decodeHeartbeatWithRejectingUnknownFields(final String... example) throws Exception + { + final Decoder decoder = (Decoder)heartbeatWithRejectingUnknownFields.getConstructor().newInstance(); + for (String s : example) { + decode(s, decoder); + } + return decoder; + } + private Decoder decodeHeartbeatWithRejectingUnknownFields(final String example) throws Exception { final Decoder decoder = (Decoder)heartbeatWithRejectingUnknownFields.getConstructor().newInstance();