Author: ningjiang
Date: Thu Feb 26 13:36:54 2009
New Revision: 748145
URL: http://svn.apache.org/viewvc?rev=748145&view=rev
Log:
CAMEL-1364 using the org.apache.camel.dataformat.bindy.model.fix.tab for the
BindySimpleKeyValuePairTabUnMarshalTest and
BindySimpleKeyValuePairTabMarshalTest
Added:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
(with props)
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
(with props)
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
(with props)
Modified:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
Modified:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java?rev=748145&r1=748144&r2=748145&view=diff
==============================================================================
---
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
(original)
+++
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabMarshallTest.java
Thu Feb 26 13:36:54 2009
@@ -27,9 +27,9 @@
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.dataformat.bindy.kvp.BindyKeyValuePairDataFormat;
-import org.apache.camel.dataformat.bindy.model.fix.simple.Header;
-import org.apache.camel.dataformat.bindy.model.fix.simple.Order;
-import org.apache.camel.dataformat.bindy.model.fix.simple.Trailer;
+import org.apache.camel.dataformat.bindy.model.fix.tab.Header;
+import org.apache.camel.dataformat.bindy.model.fix.tab.Order;
+import org.apache.camel.dataformat.bindy.model.fix.tab.Trailer;
import org.apache.camel.spring.javaconfig.SingleRouteCamelConfiguration;
import org.junit.Test;
import org.springframework.config.java.annotation.Bean;
@@ -43,7 +43,7 @@
private List<Map<String, Object>> models = new ArrayList<Map<String,
Object>>();
- private String result = "1=BE.CHM.0018=FIX
4.19=2010=22011=CHM0001-0122=434=135=048=BE000124567849=INVMGR54=156=BRKR58=this
is a camel - bindy test";
+ private String result = "1=BE.CHM.001\t8=FIX
4.1\t9=20\t10=0\t11=CHM0001-01\t22=4\t34=1\t35=0\t48=BE0001245678\t49=INVMGR\t54=1\t56=BRKR\t58=this
is a camel - bindy test\t";
@Produce(uri = "direct:start")
private ProducerTemplate template;
@@ -55,7 +55,7 @@
public void testMarshallMessage() throws Exception {
resultEndpoint.expectedBodiesReceived(result);
- template.sendBody(generateModel());
+ template.sendBody(generateModel());
resultEndpoint.assertIsSatisfied();
}
@@ -96,7 +96,7 @@
@Configuration
public static class ContextConfig extends SingleRouteCamelConfiguration {
- BindyKeyValuePairDataFormat camelDataFormat = new
BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+ BindyKeyValuePairDataFormat camelDataFormat = new
BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.tab");
@Override
@Bean
Modified:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java?rev=748145&r1=748144&r2=748145&view=diff
==============================================================================
---
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
(original)
+++
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/fix/BindySimpleKeyValuePairTabUnmarshallTest.java
Thu Feb 26 13:36:54 2009
@@ -42,7 +42,7 @@
@Configuration
public static class ContextConfig extends SingleRouteCamelConfiguration {
- BindyKeyValuePairDataFormat camelDataFormat = new
BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.simple");
+ BindyKeyValuePairDataFormat camelDataFormat = new
BindyKeyValuePairDataFormat("org.apache.camel.dataformat.bindy.model.fix.tab");
@Override
@Bean
Added:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java?rev=748145&view=auto
==============================================================================
---
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
(added)
+++
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
Thu Feb 26 13:36:54 2009
@@ -0,0 +1,98 @@
+/**
+ * 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.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.tab;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+
+...@link
+public class Header {
+
+ @KeyValuePairField(tag = 8) // Message Header
+ private String beginString;
+
+ @KeyValuePairField(tag = 9) // Checksum
+ private int bodyLength;
+
+ @KeyValuePairField(tag = 34) // Sequence number
+ private int msgSeqNum;
+
+ @KeyValuePairField(tag = 35) // Message Type
+ private String msgType;
+
+ @KeyValuePairField(tag = 49) // Company sender Id
+ private String sendCompId;
+
+ @KeyValuePairField(tag = 56) // target company id
+ private String targetCompId;
+
+ public String getBeginString() {
+ return beginString;
+ }
+
+ public void setBeginString(String beginString) {
+ this.beginString = beginString;
+ }
+
+ public int getBodyLength() {
+ return bodyLength;
+ }
+
+ public void setBodyLength(int bodyLength) {
+ this.bodyLength = bodyLength;
+ }
+
+ public int getMsgSeqNum() {
+ return msgSeqNum;
+ }
+
+ public void setMsgSeqNum(int msgSeqNum) {
+ this.msgSeqNum = msgSeqNum;
+ }
+
+ public String getMsgType() {
+ return msgType;
+ }
+
+ public void setMsgType(String msgType) {
+ this.msgType = msgType;
+ }
+
+ public String getSendCompId() {
+ return sendCompId;
+ }
+
+ public void setSendCompId(String sendCompId) {
+ this.sendCompId = sendCompId;
+ }
+
+ public String getTargetCompId() {
+ return targetCompId;
+ }
+
+ public void setTargetCompId(String targetCompId) {
+ this.targetCompId = targetCompId;
+ }
+
+ @Override
+ public String toString() {
+ return "Model : " + Header.class.getName() + ", "
+ + this.beginString + ", " + this.bodyLength + ", " + this.msgSeqNum
+ + this.msgType + ", " + this.sendCompId + ", " + this.targetCompId;
+ }
+
+}
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Header.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java?rev=748145&view=auto
==============================================================================
---
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
(added)
+++
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
Thu Feb 26 13:36:54 2009
@@ -0,0 +1,119 @@
+/**
+ * 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.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.tab;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+import org.apache.camel.dataformat.bindy.annotation.Message;
+
+...@message(keyValuePairSeparator = "=", pairSeparator = "\\u0009", type =
"FIX", version = "4.1")
+public class Order {
+
+ @Link Header header;
+
+ @Link Trailer trailer;
+
+ @KeyValuePairField(tag = 1) // Client reference
+ private String account;
+
+ @KeyValuePairField(tag = 11) // Order reference
+ private String clOrdId;
+
+ @KeyValuePairField(tag = 22) // Fund ID type (Sedol, ISIN, ...)
+ private String iDSource;
+
+ @KeyValuePairField(tag = 48) // Fund code
+ private String securityId;
+
+ @KeyValuePairField(tag = 54) // Movement type ( 1 = Buy, 2 = sell)
+ private String side;
+
+ @KeyValuePairField(tag = 58) // Free text
+ private String text;
+
+ public Header getHeader() {
+ return header;
+ }
+
+ public void setHeader(Header header) {
+ this.header = header;
+ }
+
+ public Trailer getTrailer() {
+ return trailer;
+ }
+
+ public void setTrailer(Trailer trailer) {
+ this.trailer = trailer;
+ }
+
+ public String getAccount() {
+ return account;
+ }
+
+ public void setAccount(String account) {
+ this.account = account;
+ }
+
+ public String getClOrdId() {
+ return clOrdId;
+ }
+
+ public void setClOrdId(String clOrdId) {
+ this.clOrdId = clOrdId;
+ }
+
+ public String getIDSource() {
+ return iDSource;
+ }
+
+ public void setIDSource(String source) {
+ this.iDSource = source;
+ }
+
+ public String getSecurityId() {
+ return securityId;
+ }
+
+ public void setSecurityId(String securityId) {
+ this.securityId = securityId;
+ }
+
+ public String getSide() {
+ return side;
+ }
+
+ public void setSide(String side) {
+ this.side = side;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ @Override
+ public String toString() {
+ return "Model : " + Order.class.getName() + ", " + this.account
+ + ", " + this.clOrdId + ", " + this.iDSource + ", " +
this.securityId
+ + ", " + this.side + ", " + this.text;
+ }
+
+}
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Order.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java?rev=748145&view=auto
==============================================================================
---
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
(added)
+++
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
Thu Feb 26 13:36:54 2009
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+package org.apache.camel.dataformat.bindy.model.fix.tab;
+
+import org.apache.camel.dataformat.bindy.annotation.KeyValuePairField;
+import org.apache.camel.dataformat.bindy.annotation.Link;
+
+...@link
+public class Trailer {
+
+ @KeyValuePairField(tag = 10)
+ // CheckSum
+ private int checkSum;
+
+ public int getCheckSum() {
+ return checkSum;
+ }
+
+ public void setCheckSum(int checkSum) {
+ checkSum = checkSum;
+ }
+
+ @Override
+ public String toString() {
+ return "Model : " + Trailer.class.getName() + ", " + this.checkSum;
+ }
+
+}
\ No newline at end of file
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/fix/tab/Trailer.java
------------------------------------------------------------------------------
svn:keywords = Rev Date