@Test
public void testMessageGroupCountValidation() throws Exception {

    final String data = "8=FIX.4.49=22235=D49=SenderCompId56=TargetCompId34=3752=20070223-22:28:33"
            + "11=18333922=838=140=244=1248=BHP54=255=BHP59=1"
            + "60=20060223-22:38:33526=362078=079=AllocACC180=1010.1"
            + "79=AllocACC280=2020.2453=2448=8447=D452=4448=AAA35354447=D452=310=079";
    final Message message = new Message();
    final DataDictionary dd = DataDictionaryTest.getDictionary();
    message.fromString(data, dd, true);
    try {
        dd.validate(message);
        fail("No exception thrown");
    } catch (final FieldException e) {
        final String emsg = e.getMessage();
        assertNotNull("No exception message", emsg);
        assertTrue(emsg.startsWith("Incorrect NumInGroup"));
    }
}