You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2008/12/02 17:45:55 UTC
svn commit: r722521 - in /activemq/camel/trunk/components/camel-rss: ./ src/
src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/camel/ src/main/java/org/apache/camel/component/
src/main/java/org/apache/camel/...
Author: janstey
Date: Tue Dec 2 08:45:54 2008
New Revision: 722521
URL: http://svn.apache.org/viewvc?rev=722521&view=rev
Log:
CAMEL-1101 - Intial stab at getting RSS support in Camel
Added:
activemq/camel/trunk/components/camel-rss/
activemq/camel/trunk/components/camel-rss/pom.xml (with props)
activemq/camel/trunk/components/camel-rss/src/
activemq/camel/trunk/components/camel-rss/src/main/
activemq/camel/trunk/components/camel-rss/src/main/java/
activemq/camel/trunk/components/camel-rss/src/main/java/org/
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java (with props)
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java (with props)
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java (with props)
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java (with props)
activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java (with props)
activemq/camel/trunk/components/camel-rss/src/main/resources/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/
activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/rss
activemq/camel/trunk/components/camel-rss/src/test/
activemq/camel/trunk/components/camel-rss/src/test/data/
activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml (with props)
activemq/camel/trunk/components/camel-rss/src/test/java/
activemq/camel/trunk/components/camel-rss/src/test/java/org/
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java (with props)
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java (with props)
activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java (with props)
activemq/camel/trunk/components/camel-rss/src/test/resources/
activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties (with props)
Added: activemq/camel/trunk/components/camel-rss/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/pom.xml?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/pom.xml (added)
+++ activemq/camel/trunk/components/camel-rss/pom.xml Tue Dec 2 08:45:54 2008
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>components</artifactId>
+ <groupId>org.apache.camel</groupId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-rss</artifactId>
+ <packaging>bundle</packaging>
+ <name>Camel :: RSS</name>
+ <description>Camel RSS support</description>
+
+ <properties>
+ <camel.osgi.export.pkg>org.apache.camel.component.rss.*</camel.osgi.export.pkg>
+ </properties>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>rome</groupId>
+ <artifactId>rome</artifactId>
+ <version>0.9</version>
+ </dependency>
+
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- to allow Spring annotations (jmx) to be tested -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <optional>true</optional>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <optional>true</optional>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Propchange: activemq/camel/trunk/components/camel-rss/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,36 @@
+/**
+ * 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.rss;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.impl.DefaultComponent;
+
+import java.util.Map;
+
+/**
+ * An <a href="http://activemq.apache.org/camel/rss.html">RSS Component</a>.
+ * <p/>
+ * Camel uses <a href="https://rome.dev.java.net/">ROME</a> as the RSS implementation.
+ *
+ */
+public class RssComponent extends DefaultComponent {
+
+ protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+ return new RssEndpoint(uri, this, remaining);
+ }
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,50 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.io.FeedException;
+import com.sun.syndication.io.SyndFeedInput;
+import com.sun.syndication.io.XmlReader;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.apache.camel.Processor;
+import org.apache.camel.impl.ScheduledPollConsumer;
+
+/**
+ * Base class for consuming RSS feeds.
+ */
+public abstract class RssConsumerSupport extends ScheduledPollConsumer {
+ public static final long DEFAULT_CONSUMER_DELAY = 60 * 1000L;
+ protected final RssEndpoint endpoint;
+
+ public RssConsumerSupport(RssEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ this.endpoint = endpoint;
+ }
+
+ protected SyndFeed createFeed() throws IOException, MalformedURLException, FeedException {
+ InputStream in = new URL(endpoint.getRssUri()).openStream();
+ SyndFeedInput input = new SyndFeedInput();
+ SyndFeed feed = input.build(new XmlReader(in));
+ return feed;
+ }
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssConsumerSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,102 @@
+/**
+ * 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.rss;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.camel.impl.ScheduledPollConsumer;
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndFeed;
+import com.sun.syndication.io.SyndFeedInput;
+import com.sun.syndication.io.XmlReader;
+
+/**
+ * An <a href="http://activemq.apache.org/camel/rss.html">RSS Endpoint</a>.
+ *
+ */
+public class RssEndpoint extends DefaultPollingEndpoint {
+ /**
+ * Header key for the {@link com.sun.syndication.feed.synd.SyndFeed} object is stored on the in message on the exchange.
+ */
+ public static final String HEADER_RSS_FEED = "org.apache.camel.component.rss.feed";
+ private String rssUri;
+ private boolean splitEntries = true;
+
+ public RssEndpoint(String uri, RssComponent component, String rssUri) {
+ super(uri, component);
+ this.setRssUri(rssUri);
+ }
+
+ public Producer createProducer() throws Exception {
+ throw new UnsupportedOperationException("RssProducer is not implemented");
+ }
+
+ public Consumer createConsumer(Processor processor) throws Exception {
+ RssConsumerSupport answer;
+ if (isSplitEntries()) {
+ answer = new RssEntryPollingConsumer(this, processor);
+ } else {
+ answer = new RssPollingConsumer(this, processor);
+ }
+ // ScheduledPollConsumer default delay is 500 millis and that is too often for polling a feed,
+ // so we override with a new default value. End user can override this value by providing a consumer.delay parameter
+ answer.setDelay(RssConsumerSupport.DEFAULT_CONSUMER_DELAY);
+ configureConsumer(answer);
+ return answer;
+ }
+
+ public Exchange createExchange(SyndFeed feed) {
+ Exchange exchange = createExchange();
+ exchange.getIn().setBody(feed.getEntries());
+ exchange.getIn().setHeader(HEADER_RSS_FEED, feed);
+ return exchange;
+ }
+
+ public Exchange createExchange(SyndFeed feed, SyndEntry entry) {
+ Exchange exchange = createExchange();
+ exchange.getIn().setBody(entry);
+ exchange.getIn().setHeader(HEADER_RSS_FEED, feed);
+ return exchange;
+ }
+
+ public boolean isSingleton() {
+ return true;
+ }
+
+ public void setRssUri(String rssUri) {
+ this.rssUri = rssUri;
+ }
+
+ public String getRssUri() {
+ return rssUri;
+ }
+
+ public void setSplitEntries(boolean splitEntries) {
+ this.splitEntries = splitEntries;
+ }
+
+ public boolean isSplitEntries() {
+ return splitEntries;
+ }
+
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,67 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndFeed;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+
+/**
+ * Consumer to poll RSS feeds and return each entry from the feed step by step.
+ *
+ */
+public class RssEntryPollingConsumer extends RssPollingConsumer {
+ private int entryIndex;
+ private List<SyndEntry> list;
+
+ public RssEntryPollingConsumer(RssEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ }
+
+ public void poll() throws Exception {
+ SyndFeed feed = createFeed();
+ populateList(feed);
+
+ while (hasNextEntry()) {
+ SyndEntry entry = list.get(entryIndex--);
+ Exchange exchange = endpoint.createExchange(feed, entry);
+ getProcessor().process(exchange);
+ // return and wait for the next poll to continue from last time (this consumer is stateful)
+ return;
+ }
+
+ list = null;
+ }
+
+ private void populateList(SyndFeed feed) {
+ if (list == null) {
+ list = feed.getEntries();
+ entryIndex = list.size() - 1;
+ }
+ }
+
+ private boolean hasNextEntry() {
+ return entryIndex >= 0;
+ }
+
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssEntryPollingConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,40 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndFeed;
+
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+
+/**
+ * Consumer to poll RSS feeds and return the full feed.
+ */
+public class RssPollingConsumer extends RssConsumerSupport {
+
+ public RssPollingConsumer(RssEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ }
+
+ protected void poll() throws Exception {
+ SyndFeed feed = createFeed();
+ Exchange exchange = endpoint.createExchange(feed);
+ getProcessor().process(exchange);
+ }
+
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/main/java/org/apache/camel/component/rss/RssPollingConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/rss
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/rss?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/rss (added)
+++ activemq/camel/trunk/components/camel-rss/src/main/resources/META-INF/services/org/apache/camel/component/rss Tue Dec 2 08:45:54 2008
@@ -0,0 +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.
+#
+
+class=org.apache.camel.component.rss.RssComponent
Added: activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml (added)
+++ activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml Tue Dec 2 08:45:54 2008
@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?>
+<rss version="2.0">
+ <channel>
+ <title>Jon Anstey's Blog</title>
+ <link>http://janstey.blogspot.com/</link>
+ <description></description>
+ <language>en</language>
+ <managingEditor>noreply@blogger.com (Jonathan Anstey)</managingEditor>
+ <lastBuildDate>Wed, 12 Nov 2008 08:08:35 -0600</lastBuildDate>
+ <generator>Blogger http://www.blogger.com</generator>
+ <openSearch:totalResults
+ xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
+ 10
+ </openSearch:totalResults>
+ <openSearch:startIndex
+ xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
+ 1
+ </openSearch:startIndex>
+ <openSearch:itemsPerPage
+ xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">
+ 25
+ </openSearch:itemsPerPage>
+ <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self"
+ href="http://feeds.feedburner.com/JonAnsteysBlog"
+ type="application/rss+xml" />
+ <item>
+ <title>How do you use your Apache Camel?</title>
+ <link>
+ http://janstey.blogspot.com/2008/11/how-do-you-use-your-apache-camel.html
+ </link>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Wed, 12 Nov 2008 08:08:35 -0600</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-2482225272893952676
+ </guid>
+ <description>
+ <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e)
+ {}"
+ href="http://1.bp.blogspot.com/_JZEz3zQ95mA/SRri_qOWMCI/AAAAAAAAADI/PBAuk1poLDw/s1600-h/apache-camel-6.png"><img
+ style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width:
+ 232px; height: 108px;"
+ src="http://1.bp.blogspot.com/_JZEz3zQ95mA/SRri_qOWMCI/AAAAAAAAADI/PBAuk1poLDw/s400/apache-camel-6.png"
+ alt="" id="BLOGGER_PHOTO_ID_5267772297457315874" border="0"
+ /></a><br />The Apache Camel project has been growing by
+ leaps and bounds lately it seems. Much of this growth has been driven by
+ a vibrant community (many thanks to all users! :) ). Its typically hard
+ though to know what kind of applications Camel is being used in. We
+ don't have much visibility into the cool stuff people are doing with
+ Camel. In particular, in would be nice to know what other applications
+ are being used with Camel... eg. CMSs, DBs, ESBs, App Servers, web
+ frameworks, other frameworks, etc etc<br /><br />I've
+ started a thread <a
+ href="http://www.nabble.com/-TO-USERS--How-do-you-use-your-Apache-Camel--tt20460957s22882.html">here</a>
+ trying to capture how folks are using Camel. Please, if you're a user of
+ Camel, take a minute to share how it is being used on the thread or
+ here. This will only help us make Camel better and more useful in the
+ future. No confidential info allowed, of course ;)
+ </description>
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/"
+ url="http://1.bp.blogspot.com/_JZEz3zQ95mA/SRri_qOWMCI/AAAAAAAAADI/PBAuk1poLDw/s72-c/apache-camel-6.png"
+ height="72" width="72" />
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 0
+ </thr:total>
+ </item>
+ <item>
+ <title>Creating Apache Camel projects with m2eclipse</title>
+ <link>
+ http://janstey.blogspot.com/2008/11/creating-apache-camel-projects-with.html
+ </link>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Wed, 05 Nov 2008 11:20:18 -0600</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-5257226557237229806
+ </guid>
+ <description>
+ I just noticed today that <a
+ href="http://activemq.apache.org/camel">Apache Camel</a> shows
+ up by default in the <a
+ href="http://m2eclipse.sonatype.org/">m2eclipse</a> <a
+ href="http://www.sonatype.com/book/reference/eclipse.html#sect-m2e-create-archetype">New
+ Maven Project</a> dialog. No extra fooling around is required
+ anymore. Very cool!<br /><br /><a onblur="try
+ {parent.deselectBloggerImageGracefully();} catch(e) {}"
+ href="http://4.bp.blogspot.com/_JZEz3zQ95mA/SRHTlIaMwPI/AAAAAAAAADA/h3aTEao9fSg/s1600-h/newmavenproject.png"><img
+ style="margin: 0px auto 10px; display: block; text-align: center;
+ cursor: pointer; width: 400px; height: 286px;"
+ src="http://4.bp.blogspot.com/_JZEz3zQ95mA/SRHTlIaMwPI/AAAAAAAAADA/h3aTEao9fSg/s400/newmavenproject.png"
+ alt="" id="BLOGGER_PHOTO_ID_5265222074238812402" border="0"
+ /></a><br />This is by far the easiest way to get started
+ with Apache Camel - you don't even have to leave your IDE.
+ </description>
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/"
+ url="http://4.bp.blogspot.com/_JZEz3zQ95mA/SRHTlIaMwPI/AAAAAAAAADA/h3aTEao9fSg/s72-c/newmavenproject.png"
+ height="72" width="72" />
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 3
+ </thr:total>
+ </item>
+ <item>
+ <title>Apache Camel 1.5.0 Released!</title>
+ <link>
+ http://janstey.blogspot.com/2008/10/apache-camel-150-released.html
+ </link>
+ <category>Apache Camel</category>
+ <category>Open Source</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Fri, 31 Oct 2008 12:02:21 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-6738685122661677555
+ </guid>
+ <description>
+ <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e)
+ {}"
+ href="http://1.bp.blogspot.com/_JZEz3zQ95mA/SQs3Y9gcT2I/AAAAAAAAACo/9fliISzJtHg/s1600-h/apache-camel-6.png"><img
+ style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width:
+ 232px; height: 108px;"
+ src="http://1.bp.blogspot.com/_JZEz3zQ95mA/SQs3Y9gcT2I/AAAAAAAAACo/9fliISzJtHg/s400/apache-camel-6.png"
+ alt="" id="BLOGGER_PHOTO_ID_5263361491479580514" border="0"
+ /></a><br />Several months and 266 fixes later (a new
+ record!), the <a href="http://activemq.apache.org/camel/">Apache
+ Camel</a> team is proud to present version 1.5.0!<br
+ /><br />Go ahead, take a look at the <a
+ href="http://activemq.apache.org/camel/camel-150-release.html">release
+ notes</a> and grab it <a
+ href="http://activemq.apache.org/camel/download.html">here</a>.
+ Its still pretty fresh so it may take a few hours before the release
+ propagates to all Apache download mirrors (try <a
+ href="http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/camel/apache-camel/1.5.0/">here</a>
+ otherwise).
+ </description>
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/"
+ url="http://1.bp.blogspot.com/_JZEz3zQ95mA/SQs3Y9gcT2I/AAAAAAAAACo/9fliISzJtHg/s72-c/apache-camel-6.png"
+ height="72" width="72" />
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 0
+ </thr:total>
+ </item>
+ <item>
+ <title>Repeatable Maven Builds</title>
+ <link>
+ http://janstey.blogspot.com/2008/10/repeatable-maven-builds.html
+ </link>
+ <category>Nexus</category>
+ <category>Open Source</category>
+ <category>Maven</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Tue, 14 Oct 2008 17:51:57 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-2808091344275336113
+ </guid>
+ <description>
+ A typical problem folks have with Maven seems to be <a
+ href="http://aidan-skinner.livejournal.com/229584.html?thread=615632#t615632">getting
+ repeatable builds</a>. If you've encountered this, you know the
+ pain: an older release needs to be built but now fails with the dreaded
+ "Failed to resolve artifact" error. You can't really depend on most
+ Maven repos to be there indefinitely. I'm sure repos like
+ http://repo1.maven.org are pretty safe but AFAIK the maintainers are
+ under no legal obligation to keep around the artifacts forever. You most
+ likely DO have obligations to customers and thus need to ensure builds
+ are repeatable.<br /><br />You get repeatability for free
+ when you use a repository manager like <a
+ href="http://nexus.sonatype.org/">Nexus</a> - it keeps
+ downloaded artifacts around forever by default. If you don't want to use
+ a repository manager, you're going to have to save those artifacts some
+ other (manual) way. One approach would be to just tar up your local m2
+ repo after each release and store it somewhere safe (like in SVN). Of
+ course, since local repos tend to get huge over time, you should always
+ start from an empty local repo before a release.<br /><br
+ />Hope this helps.
+ </description>
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 0
+ </thr:total>
+ </item>
+ <item>
+ <title>Why drop Maven?</title>
+ <link>http://janstey.blogspot.com/2008/10/why-drop-maven.html</link>
+ <category>Open Source</category>
+ <category>Maven</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Tue, 14 Oct 2008 17:52:03 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-2951217751083066805
+ </guid>
+ <description>
+ Recently I've noticed projects dropping Maven in favour of some other
+ build tool... Apache Qpid comes to mind in this case. I'm wondering, is
+ there a real good technical reason that folks do not like Maven? It has
+ its quirks... but really, what tool doesn't? I've been using it for
+ years now and like it better that any other build tool out there.
+ </description>
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 2
+ </thr:total>
+ </item>
+ <item>
+ <title>Nexus indices added for FUSE</title>
+ <link>
+ http://janstey.blogspot.com/2008/09/nexus-indices-added-for-fuse.html
+ </link>
+ <category>m2eclipse</category>
+ <category>Nexus</category>
+ <category>Maven</category>
+ <category>FUSE</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Fri, 19 Sep 2008 16:28:48 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-8495762864343317713
+ </guid>
+ <description>
+ I've added <a href="http://nexus.sonatype.org/">Nexus</a>
+ repository indices for the <a
+ href="http://open.iona.com/">FUSE</a> Maven repositories. You
+ can find instructions on how to add these to your <a
+ href="http://m2eclipse.sonatype.org/">m2eclipse</a>
+ installation <a
+ href="http://open.iona.com/wiki/display/ProdInfo/Adding+FUSE+Maven+repos+to+m2eclipse"><span
+ style="text-decoration:
+ underline;">here</span></a>.<br /><br />Why
+ should you care? Well, among many other things, this enables you:<br
+ /><br />1. <a
+ href="http://www.sonatype.com/book/reference/eclipse.html#sect-m2e-create-archetype">Create</a>
+ new projects based on Camel archetypes<br />2. <a
+ href="http://www.sonatype.com/book/reference/eclipse.html#d0e18331">Search</a>
+ for classes in all FUSE artifacts<br />3. <a
+ href="http://www.sonatype.com/book/reference/eclipse.html#d0e18191">Add</a>
+ FUSE dependencies to your project's POM
+ </description>
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 0
+ </thr:total>
+ </item>
+ <item>
+ <title>Nexus config for Apache Camel</title>
+ <link>
+ http://janstey.blogspot.com/2008/09/nexus-config-for-apache-camel.html
+ </link>
+ <category>Nexus</category>
+ <category>Apache Camel</category>
+ <category>Open Source</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Tue, 09 Sep 2008 18:41:22 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-8110068338407384585
+ </guid>
+ <description>
+ Some folks have been having issues getting all the Maven repositories
+ set up properly in <a
+ href="http://nexus.sonatype.org/">Nexus</a> for <a
+ href="http://activemq.apache.org/camel/">Apache Camel</a>.
+ Here's my working Nexus config and settings.xml - hope it helps!<br
+ /><a
+ href="http://people.apache.org/%7Ejanstey/blog_stuff/camel_nexus_config/nexus.xml"><br
+ />Nexus config</a> (admittedly polluted with repos from other
+ projects...)<br /><br /><a
+ href="http://people.apache.org/%7Ejanstey/blog_stuff/camel_nexus_config/settings.xml">settings.xml</a><br
+ /><br />I found my Nexus config in
+ /opt/sonatype-work/nexus/conf. I'm not sure what happens when you copy
+ in a new Nexus config file so you should probably make a copy of the
+ sonatype-work directory first :)
+ </description>
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 2
+ </thr:total>
+ </item>
+ <item>
+ <title>I'm an Apache Camel committer!</title>
+ <link>
+ http://janstey.blogspot.com/2008/09/im-apache-camel-committer.html
+ </link>
+ <category>Apache Camel</category>
+ <category>Open Source</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Thu, 04 Sep 2008 10:32:53 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-8954622480986228001
+ </guid>
+ <description>
+ <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e)
+ {}"
+ href="http://1.bp.blogspot.com/_JZEz3zQ95mA/SL__VwjctTI/AAAAAAAAACg/ytJRqteOmNI/s1600-h/apache-camel-6.png"><img
+ style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;"
+ src="http://1.bp.blogspot.com/_JZEz3zQ95mA/SL__VwjctTI/AAAAAAAAACg/ytJRqteOmNI/s200/apache-camel-6.png"
+ alt="" id="BLOGGER_PHOTO_ID_5242189240558466354" border="0"
+ /></a><br />Over the past few months I've been hacking
+ away on various parts of <a
+ href="http://activemq.apache.org/camel/">Apache Camel</a>. It
+ was initially just for fun, but quickly turned into my day job :) With
+ over 40 fixes contributed, the Camel team decided to vote me in as a
+ committer!<br /><br />This is my first committer status on
+ any Apache project so its pretty exciting. I've traditionally been
+ involved with closed source projects only.<br /><br
+ />Looking forward to more Camel hacking!<br /><br />BTW
+ for those who are interesting in contributing to the growing Camel
+ project, <a
+ href="http://icodebythesea.blogspot.com/">Jamie</a> posted a
+ good guide to Apache process <a
+ href="http://icodebythesea.blogspot.com/2008/09/responses-how-to-contribute-to-apache.html">here</a>.
+ </description>
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/"
+ url="http://1.bp.blogspot.com/_JZEz3zQ95mA/SL__VwjctTI/AAAAAAAAACg/ytJRqteOmNI/s72-c/apache-camel-6.png"
+ height="72" width="72" />
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 3
+ </thr:total>
+ </item>
+ <item>
+ <title>Nexus == easy</title>
+ <link>http://janstey.blogspot.com/2008/08/nexus-easy.html</link>
+ <category>Nexus</category>
+ <category>Apache Camel</category>
+ <category>Open Source</category>
+ <category>Maven</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Wed, 27 Aug 2008 18:43:27 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-1016140995124806496
+ </guid>
+ <description>
+ I must admit, the <a
+ href="http://maven.apache.org/">Maven</a> setup at work has me
+ a bit spoiled. Direct LAN access to a bunch of Maven mirrors makes for
+ some pretty fast builds. Problem is, when I go off site I have to suffer
+ through slow builds again...<br /><br />Thanks to <a
+ href="http://bsnyderblog.blogspot.com/">Bruce</a> I now have
+ wicked fast builds off site too!! A local instance of <a
+ href="http://nexus.sonatype.org/">Nexus</a> is the answer.
+ Seriously, go take a look at <a
+ href="http://bsnyderblog.blogspot.com/2008/08/do-you-use-maven-if-so-you-need-nexus.html">the
+ steps Bruce posted</a>. It took me like 30 minutes to setup and
+ add about <span style="font-weight: bold;">twenty</span>
+ mirrors - now thats freakin' easy.<br /><br />Heres the best
+ part (I'm building <a
+ href="http://activemq.apache.org/camel">Apache Camel</a> here
+ with a clean local repo):<br /><br />No mirroring<br
+ /><span style="font-family:courier new;">[INFO] Total time: 31
+ minutes 18 seconds</span><br /><br />Custom internal
+ mirrors<br />[INFO] Total time: 7 minutes 52 seconds<br
+ /><br />Nexus mirroring<br />[INFO] Total time: 3 minutes
+ 3 seconds<br /><br />Anyway, bottom line is that I'm
+ impressed. Great work Maven guys!
+ </description>
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 1
+ </thr:total>
+ </item>
+ <item>
+ <title>Eclipse Templates for Apache Camel</title>
+ <link>
+ http://janstey.blogspot.com/2008/08/eclipse-templates-for-apache-camel.html
+ </link>
+ <category>Apache Camel</category>
+ <category>Open Source</category>
+ <author>noreply@blogger.com (Jonathan Anstey)</author>
+ <pubDate>Wed, 27 Aug 2008 08:09:43 -0500</pubDate>
+ <guid isPermaLink="false">
+ tag:blogger.com,1999:blog-7653570007295451610.post-7161378749124824806
+ </guid>
+ <description>
+ If you didn't know already, Eclipse allows you to define custom
+ templates for commonly used code snippets. Its a very neat feature for
+ those of us who are memory challenged or don't like typing things
+ twice!<br /><br />I think that Apache Camel users could
+ really benefit from having predefined templates for doing Camel routing.
+ I also hear a lot of requests like "I have this Java DSL route, how do I
+ do this in the Spring XML DSL?" so having both Java and XML templates
+ for the same thing is essential.<br /><br />You can find the
+ templates I did up <a
+ href="http://issues.apache.org/activemq/secure/attachment/16910/camel_java_templates.xml">here</a>
+ &amp; <a
+ href="http://issues.apache.org/activemq/secure/attachment/16911/camel_xml_templates.xml">here</a>.
+ To import these browse to the template screens defined at:<br
+ /><br />Window -> Preferences -> Java -> Editor ->
+ Templates<br />and<br />Window -> Preferences -> Web
+ and XML -> XML Files -> Templates.<br /><br />Once
+ imported, you can type Ctrl + Space and then type 'camel' to search for
+ the camel templates. You should see something like this in the Java and
+ XML editors:<br /><br /><a onblur="try
+ {parent.deselectBloggerImageGracefully();} catch(e) {}"
+ href="http://2.bp.blogspot.com/_JZEz3zQ95mA/SLSnY6Y4TjI/AAAAAAAAAB4/iLfLvi1ljtE/s1600-h/java_template_selection.png"><img
+ style="margin: 0px auto 10px; display: block; text-align: center;
+ cursor: pointer;"
+ src="http://2.bp.blogspot.com/_JZEz3zQ95mA/SLSnY6Y4TjI/AAAAAAAAAB4/iLfLvi1ljtE/s320/java_template_selection.png"
+ alt="" id="BLOGGER_PHOTO_ID_5238996312971038258" border="0"
+ /></a><a onblur="try
+ {parent.deselectBloggerImageGracefully();} catch(e) {}"
+ href="http://4.bp.blogspot.com/_JZEz3zQ95mA/SLSnZd9AEfI/AAAAAAAAACA/qy6BVcAG6_U/s1600-h/xml_template_selection.png"><img
+ style="margin: 0px auto 10px; display: block; text-align: center;
+ cursor: pointer;"
+ src="http://4.bp.blogspot.com/_JZEz3zQ95mA/SLSnZd9AEfI/AAAAAAAAACA/qy6BVcAG6_U/s320/xml_template_selection.png"
+ alt="" id="BLOGGER_PHOTO_ID_5238996322517783026" border="0"
+ /></a><br />When you select, say a Content Based Router,
+ you'll get a route something like this in the Java and XML
+ editors:<br /><br /><a onblur="try
+ {parent.deselectBloggerImageGracefully();} catch(e) {}"
+ href="http://4.bp.blogspot.com/_JZEz3zQ95mA/SLSphdkYyDI/AAAAAAAAACY/_mqBSr3uJpU/s1600-h/java_template.png"><img
+ style="margin: 0px auto 10px; display: block; text-align: center;
+ cursor: pointer;"
+ src="http://4.bp.blogspot.com/_JZEz3zQ95mA/SLSphdkYyDI/AAAAAAAAACY/_mqBSr3uJpU/s400/java_template.png"
+ alt="" id="BLOGGER_PHOTO_ID_5238998658876753970" border="0"
+ /></a><br /><a onblur="try
+ {parent.deselectBloggerImageGracefully();} catch(e) {}"
+ href="http://3.bp.blogspot.com/_JZEz3zQ95mA/SLSn-w1dxdI/AAAAAAAAACQ/-gE7mDXagzM/s1600-h/xml_template.png"><img
+ style="margin: 0px auto 10px; display: block; text-align: center;
+ cursor: pointer; width: 381px; height: 201px;"
+ src="http://3.bp.blogspot.com/_JZEz3zQ95mA/SLSn-w1dxdI/AAAAAAAAACQ/-gE7mDXagzM/s320/xml_template.png"
+ alt="" id="BLOGGER_PHOTO_ID_5238996963241608658" border="0"
+ /></a><br />The formatting was a bit wonky for these
+ Eclipse templates so you might want to pretty up your routes before
+ showing anyone else :)<br /><br />Let me know what you
+ think!
+ </description>
+ <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/"
+ url="http://2.bp.blogspot.com/_JZEz3zQ95mA/SLSnY6Y4TjI/AAAAAAAAAB4/iLfLvi1ljtE/s72-c/java_template_selection.png"
+ height="72" width="72" />
+ <thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">
+ 2
+ </thr:total>
+ </item>
+ </channel>
+</rss>
Propchange: activemq/camel/trunk/components/camel-rss/src/test/data/rss20.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,45 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndFeed;
+
+import java.util.List;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+public class RssEntryPollingConsumerTest extends ContextTestSupport {
+
+ public void testListOfEntriesIsSplitIntoPieces() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(10);
+ mock.assertIsSatisfied();
+ }
+
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("rss:file:src/test/data/rss20.xml?splitEntries=true&consumer.delay=100").to("mock:result");
+ }
+ };
+ }
+
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,80 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndEntry;
+import com.sun.syndication.feed.synd.SyndFeed;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.TimeZone;
+
+import javax.naming.Context;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.util.jndi.JndiContext;
+
+public class RssEntryPollingConsumerWithFilterTest extends ContextTestSupport {
+
+ public void testListOfEntriesIsSplitIntoPieces() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ // two entries were published after Fri, 31 Oct 2008 12:02:21 -0500
+ mock.expectedMessageCount(2);
+ mock.assertIsSatisfied();
+ }
+
+ @Override
+ protected Context createJndiContext() throws Exception {
+ JndiContext answer = new JndiContext();
+
+ // timestamp from the feed to use as base
+ // Fri, 31 Oct 2008 12:02:21 -0500
+ Calendar cal = GregorianCalendar.getInstance(TimeZone.getTimeZone("GMT-5:00"));
+ cal.set(2008, Calendar.OCTOBER, 31, 12, 02, 21);
+
+ answer.bind("myBean", new MyBean(cal.getTime()));
+ return answer;
+ }
+
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("rss:file:src/test/data/rss20.xml?splitEntries=true&consumer.delay=500").
+ filter().method("myBean", "isAfterDate").to("mock:result");
+ }
+ };
+ }
+
+ public static class MyBean {
+ private final Date time;
+
+ public MyBean(Date time) {
+ this.time = time;
+ }
+
+ public boolean isAfterDate(Exchange ex) {
+ SyndEntry entry = ex.getIn().getBody(SyndEntry.class);
+ return entry.getPublishedDate().after(time);
+ }
+ }
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssEntryPollingConsumerWithFilterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java (added)
+++ activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java Tue Dec 2 08:45:54 2008
@@ -0,0 +1,57 @@
+/**
+ * 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.rss;
+
+import com.sun.syndication.feed.synd.SyndFeed;
+
+import java.util.List;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+public class RssPollingConsumerTest extends ContextTestSupport {
+
+ public void testGrabbingListOfEntries() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(1);
+ mock.assertIsSatisfied();
+
+ Exchange exchange = mock.getExchanges().get(0);
+ Message in = exchange.getIn();
+ assertNotNull(in);
+ assertTrue(in.getBody() instanceof List);
+ assertTrue(in.getHeader(RssEndpoint.HEADER_RSS_FEED) instanceof SyndFeed);
+
+ SyndFeed feed = in.getHeader(RssEndpoint.HEADER_RSS_FEED, SyndFeed.class);
+ assertTrue(feed.getAuthor().contains("Jonathan Anstey"));
+
+ List entries = in.getBody(List.class);
+ assertEquals(10, entries.size());
+ }
+
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() throws Exception {
+ from("rss:file:src/test/data/rss20.xml?splitEntries=false").to("mock:result");
+ }
+ };
+ }
+
+}
Propchange: activemq/camel/trunk/components/camel-rss/src/test/java/org/apache/camel/component/rss/RssPollingConsumerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties?rev=722521&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties (added)
+++ activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties Tue Dec 2 08:45:54 2008
@@ -0,0 +1,40 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see debug output on the console.
+#
+log4j.rootLogger=INFO, file
+
+#log4j.logger.org.apache.activemq=DEBUG
+#log4j.logger.org.apache.camel=DEBUG
+#log4j.logger.org.apache.camel.component.rss=DEBUG
+
+log4j.logger.org.apache.camel.impl.converter=INFO
+
+# 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-atom-test.log
+log4j.appender.file.append=true
Propchange: activemq/camel/trunk/components/camel-rss/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native