Return-Path: Delivered-To: apmail-activemq-camel-commits-archive@locus.apache.org Received: (qmail 79141 invoked from network); 6 Aug 2008 05:45:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2008 05:45:18 -0000 Received: (qmail 82737 invoked by uid 500); 6 Aug 2008 05:45:17 -0000 Delivered-To: apmail-activemq-camel-commits-archive@activemq.apache.org Received: (qmail 82720 invoked by uid 500); 6 Aug 2008 05:45:17 -0000 Mailing-List: contact camel-commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-commits@activemq.apache.org Received: (qmail 82711 invoked by uid 99); 6 Aug 2008 05:45:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Aug 2008 22:45:17 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Aug 2008 05:44:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DC77B238898B; Tue, 5 Aug 2008 22:44:56 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r683115 - in /activemq/camel/trunk/components/camel-mina/src: main/java/org/apache/camel/component/mina/MinaConsumer.java test/java/org/apache/camel/component/mina/MinaConsumerTest.java Date: Wed, 06 Aug 2008 05:44:56 -0000 To: camel-commits@activemq.apache.org From: davsclaus@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080806054456.DC77B238898B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davsclaus Date: Tue Aug 5 22:44:55 2008 New Revision: 683115 URL: http://svn.apache.org/viewvc?rev=683115&view=rev Log: CAMEL-783: INFO logging for mina consumer so we can see what services camel exposes at startup. Added wiki samples. Added: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java (with props) Modified: activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java Modified: activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java?rev=683115&r1=683114&r2=683115&view=diff ============================================================================== --- activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java (original) +++ activemq/camel/trunk/components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java Tue Aug 5 22:44:55 2008 @@ -51,8 +51,8 @@ @Override protected void doStart() throws Exception { super.doStart(); - if (LOG.isDebugEnabled()) { - LOG.debug("Binding to server address: " + address + " using acceptor: " + acceptor); + if (LOG.isInfoEnabled()) { + LOG.info("Binding to server address: " + address + " using acceptor: " + acceptor); } IoHandler handler = new ReceiveHandler(); @@ -61,8 +61,8 @@ @Override protected void doStop() throws Exception { - if (LOG.isDebugEnabled()) { - LOG.debug("Unbinding from server address: " + address + " using acceptor: " + acceptor); + if (LOG.isInfoEnabled()) { + LOG.info("Unbinding from server address: " + address + " using acceptor: " + acceptor); } acceptor.unbind(address); super.doStop(); Added: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java?rev=683115&view=auto ============================================================================== --- activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java (added) +++ activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java Tue Aug 5 22:44:55 2008 @@ -0,0 +1,50 @@ +package org.apache.camel.component.mina; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.Processor; +import org.apache.camel.Exchange; +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; + +/** + * Unit test for wiki documentation + */ +public class MinaConsumerTest extends ContextTestSupport { + + public void testSendTextlineText() throws Exception { + // START SNIPPET: e2 + MockEndpoint mock = getMockEndpoint("mock:result"); + mock.expectedBodiesReceived("Hello World"); + + template.sendBody("mina:tcp://localhost:6200?textline=true", "Hello World\n"); + + assertMockEndpointsSatisifed(); + // END SNIPPET: e2 + } + + public void testSendTextlineSyncText() throws Exception { + // START SNIPPET: e4 + String response = (String)template.sendBody("mina:tcp://localhost:6201?textline=true&sync=true", "World\n"); + assertEquals("Bye World", response); + // END SNIPPET: e4 + } + + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + public void configure() throws Exception { + // START SNIPPET: e1 + from("mina:tcp://localhost:6200?textline=true").to("mock:result"); + // END SNIPPET: e1 + + // START SNIPPET: e3 + from("mina:tcp://localhost:6201?textline=true&sync=true").process(new Processor() { + public void process(Exchange exchange) throws Exception { + String body = exchange.getIn().getBody(String.class); + exchange.getOut().setBody("Bye " + body + "\n"); + } + }); + // END SNIPPET: e3 + } + }; + } +} Propchange: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaConsumerTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date