@Test public void testGroupCreate() throws Exception { new ExpectedTestFailure(IllegalArgumentException.class, "unknown") { protected void execute() throws Throwable { factory.create("unknown", MsgType.NEWS, LinesOfText.FIELD); } }.run(); assertEquals(quickfix.fix40.News.LinesOfText.class, factory.create(BEGINSTRING_FIX40, MsgType.NEWS, LinesOfText.FIELD).getClass()); assertEquals(quickfix.fix41.News.LinesOfText.class, factory.create(BEGINSTRING_FIX41, MsgType.NEWS, LinesOfText.FIELD).getClass()); assertEquals(quickfix.fix42.News.LinesOfText.class, factory.create(BEGINSTRING_FIX42, MsgType.NEWS, LinesOfText.FIELD).getClass()); assertEquals(quickfix.fix43.News.LinesOfText.class, factory.create(BEGINSTRING_FIX43, MsgType.NEWS, LinesOfText.FIELD).getClass()); assertEquals(quickfix.fix44.News.LinesOfText.class, factory.create(BEGINSTRING_FIX44, MsgType.NEWS, LinesOfText.FIELD).getClass()); assertEquals(quickfix.fix50.News.NoLinesOfText.class, factory.create(FIX50, MsgType.NEWS, NoLinesOfText.FIELD).getClass()); assertNull("if group can't be created return null", factory.create(BEGINSTRING_FIX40, MsgType.MARKET_DATA_SNAPSHOT_FULL_REFRESH, NoMDEntries.FIELD)); }
public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); Message create(String beginString, String msgType); Group create(String beginString, String msgType, int correspondingFieldID); }
DefaultMessageFactory implements MessageFactory { public Message create(String beginString, String msgType) { MessageFactory messageFactory = messageFactories.get(beginString); if (beginString.equals(BEGINSTRING_FIXT11)) { if (!MessageUtils.isAdminMessage(msgType)) { messageFactory = messageFactories.get(FIX50); } } if (messageFactory != null) { return messageFactory.create(beginString, msgType); } Message message = new Message(); message.getHeader().setString(MsgType.FIELD, msgType); return message; } DefaultMessageFactory(); Message create(String beginString, String msgType); Group create(String beginString, String msgType, int correspondingFieldID);  }