Repository: camel Updated Branches: refs/heads/master 7d5704d5b -> fa707dc3c
Fixed the CS errors in camel-syslog Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fa707dc3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fa707dc3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fa707dc3 Branch: refs/heads/master Commit: fa707dc3c2c3b54d3650917864e36ca8a7c50c93 Parents: 7d5704d Author: Willem Jiang <willem.ji...@gmail.com> Authored: Sun Sep 7 16:35:34 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Sun Sep 7 16:35:34 2014 +0800 ---------------------------------------------------------------------- .../component/syslog/Rfc5424SyslogMessage.java | 13 +++++++++++++ .../component/syslog/netty/Rfc5425Encoder.java | 13 +++++++++++++ .../syslog/netty/Rfc5425FrameDecoder.java | 13 +++++++++++++ .../syslog/NettyRfc5425LongMessageTest.java | 17 ++++++++++++++--- 4 files changed, 53 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/fa707dc3/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/Rfc5424SyslogMessage.java ---------------------------------------------------------------------- diff --git a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/Rfc5424SyslogMessage.java b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/Rfc5424SyslogMessage.java index d52b471..52dc5e3 100644 --- a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/Rfc5424SyslogMessage.java +++ b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/Rfc5424SyslogMessage.java @@ -1,5 +1,18 @@ /** + * 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.component.syslog; http://git-wip-us.apache.org/repos/asf/camel/blob/fa707dc3/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425Encoder.java ---------------------------------------------------------------------- diff --git a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425Encoder.java b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425Encoder.java index 1d39e51..38eb574 100644 --- a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425Encoder.java +++ b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425Encoder.java @@ -1,5 +1,18 @@ /** + * 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.component.syslog.netty; http://git-wip-us.apache.org/repos/asf/camel/blob/fa707dc3/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425FrameDecoder.java ---------------------------------------------------------------------- diff --git a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425FrameDecoder.java b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425FrameDecoder.java index 340b0e0..15b2b5a 100644 --- a/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425FrameDecoder.java +++ b/components/camel-syslog/src/main/java/org/apache/camel/component/syslog/netty/Rfc5425FrameDecoder.java @@ -1,5 +1,18 @@ /** + * 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.component.syslog.netty; http://git-wip-us.apache.org/repos/asf/camel/blob/fa707dc3/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/NettyRfc5425LongMessageTest.java ---------------------------------------------------------------------- diff --git a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/NettyRfc5425LongMessageTest.java b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/NettyRfc5425LongMessageTest.java index 16af90a..54b2c9d 100644 --- a/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/NettyRfc5425LongMessageTest.java +++ b/components/camel-syslog/src/test/java/org/apache/camel/component/syslog/NettyRfc5425LongMessageTest.java @@ -34,7 +34,18 @@ public class NettyRfc5425LongMessageTest extends CamelTestSupport { private static String uri; private static int serverPort; - private final String message = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - Lorem ipsum dolor sit amet, tempor democritum vix ad, est partiendo laboramus ei. Munere laudem commune vis ad, et qui altera singulis. Ut assum deleniti sit, vix constituto assueverit appellantur at, et meis voluptua usu. Quem imperdiet in ius, mei ex dictas mandamus, ut pri tation appetere oportere. Et est harum dictas. \n Omnis quaestio mel te, ex duo autem molestie. Ei sed dico minim, nominavi facilisis evertitur quo an, te adipiscing contentiones his. Cum partem deseruisse at, ne iuvaret mediocritatem pro. Ex prima utinam convenire usu, volumus legendos nec et, natum putant quo ne. Invidunt necessitatibus at ius, ne eum wisi dicat mediocrem. \n Cu usu odio labores sententiae. Ex eos duis singulis necessitatibus, dico omittam vix at. Sit iudico option detracto an, sit no modus exerci oportere. Vix dicta munere at, no vis feugiat omnesque convenire. Duo at quod illum dolor, nec am et tantas iisque no, mei quod graece volutpat ea.\n Ornatus legendos theophrastus id mei. Cum alia assum abhorreant et, nam indoctum intellegebat ei. Unum constituto quo cu. Vero tritani sit ei, ea commodo menandri usu, ponderum hendrerit voluptatibus sed te. \n Semper aliquid fabulas ei mel. Vix ei nullam malorum bonorum, movet nemore scaevola cu vel. Quo ut esse dictas incorrupte, ex denique splendide nec, mei dicit doming omnium no. Nulla putent nec id, vis vide ignota eligendi in."; + private static final String MESSAGE = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - " + + "Lorem ipsum dolor sit amet, tempor democritum vix ad, est partiendo laboramus ei. " + + "Munere laudem commune vis ad, et qui altera singulis. Ut assum deleniti sit, vix constituto assueverit appellantur at, et meis voluptua usu. " + + "Quem imperdiet in ius, mei ex dictas mandamus, ut pri tation appetere oportere. Et est harum dictas. \n Omnis quaestio mel te, ex duo autem molestie. " + + "Ei sed dico minim, nominavi facilisis evertitur quo an, te adipiscing contentiones his. Cum partem deseruisse at, ne iuvaret mediocritatem pro. " + + "Ex prima utinam convenire usu, volumus legendos nec et, natum putant quo ne. Invidunt necessitatibus at ius, ne eum wisi dicat mediocrem. " + + "\n Cu usu odio labores sententiae. Ex eos duis singulis necessitatibus, dico omittam vix at. Sit iudico option detracto an, sit no modus exerci oportere. " + + "Vix dicta munere at, no vis feugiat omnesque convenire. Duo at quod illum dolor, nec amet tantas iisque no, mei quod graece volutpat ea.\n " + + "Ornatus legendos theophrastus id mei. Cum alia assum abhorreant et, nam indoctum intellegebat ei. Unum constituto quo cu. " + + "Vero tritani sit ei, ea commodo menandri usu, ponderum hendrerit voluptatibus sed te. " + + "\n Semper aliquid fabulas ei mel. Vix ei nullam malorum bonorum, movet nemore scaevola cu vel. " + + "Quo ut esse dictas incorrupte, ex denique splendide nec, mei dicit doming omnium no. Nulla putent nec id, vis vide ignota eligendi in."; @BeforeClass public static void initPort() { @@ -57,9 +68,9 @@ public class NettyRfc5425LongMessageTest extends CamelTestSupport { MockEndpoint mock2 = getMockEndpoint("mock:syslogReceiver2"); mock.expectedMessageCount(1); mock2.expectedMessageCount(1); - mock2.expectedBodiesReceived(message); + mock2.expectedBodiesReceived(MESSAGE); - template.sendBody(uri, new BigEndianHeapChannelBuffer(message.getBytes("UTF8"))); + template.sendBody(uri, new BigEndianHeapChannelBuffer(MESSAGE.getBytes("UTF8"))); assertMockEndpointsSatisfied(); }