Author: ningjiang Date: Mon Oct 24 12:20:33 2011 New Revision: 1188111 URL: http://svn.apache.org/viewvc?rev=1188111&view=rev Log: Merged revisions 1188070,1188074,1188085 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk
........ r1188070 | ningjiang | 2011-10-24 17:53:26 +0800 (Mon, 24 Oct 2011) | 1 line CAMEL-4568 camel-quickfix should throw exception if the user configure the JdbcDriver and SLF4jLog together ........ r1188074 | ningjiang | 2011-10-24 18:18:12 +0800 (Mon, 24 Oct 2011) | 1 line CAMEL-4568 fixed the test error ........ r1188085 | ningjiang | 2011-10-24 18:37:42 +0800 (Mon, 24 Oct 2011) | 1 line CAMEL-4568 polish the code ........ Modified: camel/branches/camel-2.8.x/ (props changed) camel/branches/camel-2.8.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java camel/branches/camel-2.8.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java Propchange: camel/branches/camel-2.8.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Oct 24 12:20:33 2011 @@ -1 +1 @@ -/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893 +/camel/trunk:1186106,1186625,1186772,1187221,1187485,1187882,1187893,1188070-1188085 Propchange: camel/branches/camel-2.8.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.8.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java?rev=1188111&r1=1188110&r2=1188111&view=diff ============================================================================== --- camel/branches/camel-2.8.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java (original) +++ camel/branches/camel-2.8.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java Mon Oct 24 12:20:33 2011 @@ -295,8 +295,8 @@ public class QuickfixjEngine { Set<LogFactory> impliedLogFactories = new HashSet<LogFactory>(); isFileLog(settings, impliedLogFactories); isScreenLog(settings, impliedLogFactories); - isJdbcLog(settings, impliedLogFactories); isSL4JLog(settings, impliedLogFactories); + isJdbcLog(settings, impliedLogFactories); if (impliedLogFactories.size() > 1) { throw new ConfigError("Ambiguous log factory implied in configuration"); } @@ -326,19 +326,17 @@ public class QuickfixjEngine { } private void isJdbcLog(SessionSettings settings, Set<LogFactory> impliedLogFactories) { - if (impliedLogFactories.size() == 0 && settings.isSetting(JdbcSetting.SETTING_JDBC_DRIVER)) { + if (settings.isSetting(JdbcSetting.SETTING_JDBC_DRIVER) && settings.isSetting(JdbcSetting.SETTING_LOG_EVENT_TABLE)) { impliedLogFactories.add(new JdbcLogFactory(settings)); } } private void isSL4JLog(SessionSettings settings, Set<LogFactory> impliedLogFactories) { - if (impliedLogFactories.size() == 0) { - for (Object key : settings.getDefaultProperties().keySet()) { - if (key.toString().startsWith("SLF4J")) { - impliedLogFactories.add(new SLF4JLogFactory(settings)); - return; - } - } + for (Object key : settings.getDefaultProperties().keySet()) { + if (key.toString().startsWith("SLF4J")) { + impliedLogFactories.add(new SLF4JLogFactory(settings)); + return; + } } } Modified: camel/branches/camel-2.8.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java?rev=1188111&r1=1188110&r2=1188111&view=diff ============================================================================== --- camel/branches/camel-2.8.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java (original) +++ camel/branches/camel-2.8.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java Mon Oct 24 12:20:33 2011 @@ -215,7 +215,10 @@ public class QuickfixjEngineTest { @Test public void inferJdbcStoreAndLog() throws Exception { + // If there is a setting of the LOG_EVENT_TABLE, we should create a jdbcLogFactory for it settings.setString(JdbcSetting.SETTING_JDBC_DRIVER, "driver"); + settings.setString(JdbcSetting.SETTING_LOG_EVENT_TABLE, "table"); + settings.setString(sessionID, SessionFactory.SETTING_CONNECTION_TYPE, SessionFactory.INITIATOR_CONNECTION_TYPE); writeSettings(); @@ -247,7 +250,7 @@ public class QuickfixjEngineTest { settings.setString(sessionID, SessionFactory.SETTING_CONNECTION_TYPE, SessionFactory.INITIATOR_CONNECTION_TYPE); writeSettings(); - + quickfixjEngine = new QuickfixjEngine("quickfix:test", settingsFile.getName(), false); assertThat(quickfixjEngine.getInitiator(), notNullValue());