@Test
public void testMessageDataDictionaryMismatch() throws Exception {

    final quickfix.fix43.NewOrderSingle newSingle = new quickfix.fix43.NewOrderSingle(
            new ClOrdID("123"), new HandlInst(HandlInst.MANUAL_ORDER_BEST_EXECUTION), new Side(Side.BUY), new TransactTime(), new OrdType(
                    OrdType.LIMIT));
    newSingle.setField(new OrderQty(42));
    newSingle.setField(new Price(42.37));
    newSingle.setField(new Symbol("QFJ"));
    newSingle.setField(new TimeInForce(TimeInForce.DAY));
    newSingle.setField(new Account("testAccount"));
    final DataDictionary dd = getDictionary();
    new ExpectedTestFailure(UnsupportedVersion.class,
            "Message version 'FIX.4.3' does not match the data dictionary version 'FIX.4.4'") {
        @Override
        protected void execute() throws Throwable {
            dd.validate(newSingle);
        }
    }.run();
    // TODO: This is unexpected for pre-FIX 5.0 messages:
    //   If bodyOnly is true, the correct data dictionary is not checked.
    dd.validate(newSingle, true);
}