You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2010/09/29 15:15:31 UTC
svn commit: r1002609 - in /camel/trunk/components/camel-quickfix: ./
src/main/java/org/apache/camel/component/quickfixj/converter/
src/test/java/org/apache/camel/component/quickfixj/ src/test/resources/
Author: davsclaus
Date: Wed Sep 29 13:15:30 2010
New Revision: 1002609
URL: http://svn.apache.org/viewvc?rev=1002609&view=rev
Log:
CAMEL-1350: Polished and fixed CS.
Modified:
camel/trunk/components/camel-quickfix/ (props changed)
camel/trunk/components/camel-quickfix/pom.xml
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/converter/QuickfixjConverters.java
camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java
camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
camel/trunk/components/camel-quickfix/src/test/resources/log4j.properties
Propchange: camel/trunk/components/camel-quickfix/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Sep 29 13:15:30 2010
@@ -0,0 +1,9 @@
+.project
+.checkstyle
+.pmd
+.classpath
+target
+.settings
+eclipse-classes
+*.i??
+classes
Modified: camel/trunk/components/camel-quickfix/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/pom.xml?rev=1002609&r1=1002608&r2=1002609&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/pom.xml (original)
+++ camel/trunk/components/camel-quickfix/pom.xml Wed Sep 29 13:15:30 2010
@@ -29,18 +29,13 @@
</camel.osgi.export.pkg>
</properties>
- <repositories>
- <repository>
- <id>open.iona.m2-all</id>
- <name>Fuse Source Maven Repo</name>
- <url>http://repo.fusesource.com/maven2-all</url>
- </repository>
- <repository>
- <id>apache.snapshots</id>
- <name>Apache Snapshots</name>
- <url>https://repository.apache.org/content/repositories/snapshots/</url>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>open.iona.m2-all</id>
+ <name>Fusesource Dependency Repository</name>
+ <url>http://repo.fusesource.com/maven2-all</url>
+ </repository>
+ </repositories>
<dependencies>
<dependency>
@@ -50,6 +45,7 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.quickfixj</groupId>
@@ -67,6 +63,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -78,11 +75,11 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
+
</dependencies>
</project>
Modified: camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/converter/QuickfixjConverters.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/converter/QuickfixjConverters.java?rev=1002609&r1=1002608&r2=1002609&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/converter/QuickfixjConverters.java (original)
+++ camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/converter/QuickfixjConverters.java Wed Sep 29 13:15:30 2010
@@ -58,17 +58,14 @@ public final class QuickfixjConverters {
}
private static DataDictionary getDataDictionary(Exchange exchange) throws ConfigError {
- DataDictionary dataDictionary = null;
-
Object dictionaryValue = exchange.getProperties().get(QuickfixjEndpoint.DATA_DICTIONARY_KEY);
+ DataDictionary dataDictionary;
if (dictionaryValue instanceof DataDictionary) {
dataDictionary = (DataDictionary)dictionaryValue;
- }
- else if (dictionaryValue instanceof String) {
+ } else if (dictionaryValue instanceof String) {
dataDictionary = new DataDictionary((String) dictionaryValue);
- }
- else {
+ } else {
SessionID sessionID = (SessionID) exchange.getIn().getHeader(QuickfixjEndpoint.SESSION_ID_KEY);
Session session = Session.lookupSession(sessionID);
dataDictionary = session != null ? session.getDataDictionary() : null;
@@ -91,9 +88,9 @@ public final class QuickfixjConverters {
LOG.error("Message type field not found in QFJ message, continuing...");
}
}
-
- camelMessage.setBody(message);
+ camelMessage.setBody(message);
return exchange;
}
+
}
Modified: camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java?rev=1002609&r1=1002608&r2=1002609&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java (original)
+++ camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjComponentTest.java Wed Sep 29 13:15:30 2010
@@ -16,12 +16,6 @@
*/
package org.apache.camel.component.quickfixj;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -61,6 +55,11 @@ import quickfix.field.Subject;
import quickfix.field.TargetCompID;
import quickfix.fix44.Email;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
public class QuickfixjComponentTest {
private File settingsFile;
@@ -83,6 +82,7 @@ public class QuickfixjComponentTest {
}
return uri;
}
+
@Before
public void setUp() throws Exception {
settingsFile = File.createTempFile("quickfixj_test_", ".cfg");
@@ -108,7 +108,6 @@ public class QuickfixjComponentTest {
Method converterMethod = QuickfixjConverters.class.getMethod("toSessionID", new Class<?>[] {String.class});
camelContext.getTypeConverterRegistry().addTypeConverter(SessionID.class, String.class, new StaticMethodTypeConverter(converterMethod));
-
}
@After
Modified: camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java?rev=1002609&r1=1002608&r2=1002609&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java (original)
+++ camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjConvertersTest.java Wed Sep 29 13:15:30 2010
@@ -16,12 +16,6 @@
*/
package org.apache.camel.component.quickfixj;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertThat;
-
import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -52,6 +46,11 @@ import quickfix.field.HopCompID;
import quickfix.field.MsgType;
import quickfix.fix44.Message.Header.NoHops;
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
public class QuickfixjConvertersTest {
private static DefaultCamelContext camelContext;
Modified: camel/trunk/components/camel-quickfix/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/test/resources/log4j.properties?rev=1002609&r1=1002608&r2=1002609&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/src/test/resources/log4j.properties (original)
+++ camel/trunk/components/camel-quickfix/src/test/resources/log4j.properties Wed Sep 29 13:15:30 2010
@@ -1,22 +1,37 @@
-# Set root category priority to INFO and its only appender to CONSOLE.
-log4j.rootCategory=DEBUG, CONSOLE
-#log4j.rootCategory=CONSOLE, LOGFILE
+## ------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ------------------------------------------------------------------------
-log4j.category.quickfix.mina.message=INFO
-log4j.category.org.apache.camel.management=INFO
-log4j.category.org.apache.camel.processor.FilterProcessor=INFO
-log4j.category.org.apache.camel.impl.converter=INFO
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=INFO, file
-# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.Threshold=DEBUG
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%d{HH:mm:ss.SSS} %p [%t] %c{1} - %m%n
+# uncomment the following to enable camel debugging
+#log4j.logger.org.apache.camel=DEBUG
+#log4j.logger.org.apache.camel.component.quickfixj=DEBUG
-# LOGFILE is set to be a File appender using a PatternLayout.
-log4j.appender.LOGFILE=org.apache.log4j.FileAppender
-log4j.appender.LOGFILE.File=target/fixgw.log
-log4j.appender.LOGFILE.Append=true
-log4j.appender.LOGFILE.Threshold=DEBUG
-log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
-log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+# CONSOLE appender not used by default
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+#log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.file.file=target/camel-quickfix-test.log
\ No newline at end of file