You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/05/15 15:33:38 UTC
svn commit: r656656 - in /activemq/camel/trunk:
camel-core/src/main/java/org/apache/camel/component/bean/
camel-core/src/main/java/org/apache/camel/component/file/
camel-core/src/main/java/org/apache/camel/converter/
camel-core/src/test/java/org/apache...
Author: ningjiang
Date: Thu May 15 06:33:37 2008
New Revision: 656656
URL: http://svn.apache.org/viewvc?rev=656656&view=rev
Log:
Fixed some CS errors, also get the BeanEndpointFactory's getObjectType return BeanEndpoint
Modified:
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/PredicateAsBeanTest.java
activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomConverter.java
activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEntryPollingConsumer.java
activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java
activemq/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntryPollingConsumerTest.java
activemq/camel/trunk/components/camel-hamcrest/src/main/java/org/apache/camel/hamcrest/Assertions.java
activemq/camel/trunk/components/camel-hamcrest/src/test/java/org/apache/camel/hamcrest/AssertionsTest.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/factory/BeanEndpointFactory.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/file/SpringFileRouteTest.java
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -109,8 +108,7 @@
RegistryBean registryBean = new RegistryBean(getCamelContext(), beanName);
if (cache) {
holder = registryBean.createCacheHolder();
- }
- else {
+ } else {
holder = registryBean;
}
}
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/FileEndpoint.java Thu May 15 06:33:37 2008
@@ -23,11 +23,11 @@
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
-import org.apache.camel.util.ObjectHelper;
import org.apache.camel.component.file.strategy.FileProcessStrategyFactory;
import org.apache.camel.component.file.strategy.FileProcessStrategySupport;
import org.apache.camel.component.file.strategy.NoOpFileProcessStrategy;
import org.apache.camel.impl.ScheduledPollEndpoint;
+import org.apache.camel.util.ObjectHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/CamelConverter.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -18,11 +17,11 @@
package org.apache.camel.converter;
import org.apache.camel.Converter;
-import org.apache.camel.Processor;
-import org.apache.camel.Predicate;
import org.apache.camel.Exchange;
-import org.apache.camel.Message;
import org.apache.camel.Expression;
+import org.apache.camel.Message;
+import org.apache.camel.Predicate;
+import org.apache.camel.Processor;
/**
* Some useful converters for Camel APIs such as to convert a {@link Predicate} or {@link Expression}
@@ -44,7 +43,7 @@
};
}
-
+
@Converter
public Processor toProcessor(final Expression<Exchange> expresion) {
return new Processor() {
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/PredicateAsBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/PredicateAsBeanTest.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/PredicateAsBeanTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/bean/PredicateAsBeanTest.java Thu May 15 06:33:37 2008
@@ -16,7 +16,8 @@
*/
package org.apache.camel.component.bean;
-import org.apache.camel.Body;
+import javax.naming.Context;
+
import org.apache.camel.ContextTestSupport;
import org.apache.camel.Exchange;
import org.apache.camel.Predicate;
@@ -26,8 +27,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.naming.Context;
-
/**
* @version $Revision: 1.1 $
*/
Modified: activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomConverter.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomConverter.java (original)
+++ activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomConverter.java Thu May 15 06:33:37 2008
@@ -31,6 +31,10 @@
public static final String DATE_PATTERN_NO_TIMEZONE = "yyyy-MM-dd'T'HH:mm:ss";
+ private AtomConverter() {
+ //Helper class
+ }
+
@Converter
public static Date toDate(String text) throws ParseException {
DateFormat sdf = new SimpleDateFormat(DATE_PATTERN_NO_TIMEZONE);
Modified: activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEntryPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEntryPollingConsumer.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEntryPollingConsumer.java (original)
+++ activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomEntryPollingConsumer.java Thu May 15 06:33:37 2008
@@ -17,8 +17,8 @@
package org.apache.camel.component.atom;
import java.io.IOException;
-import java.util.List;
import java.util.Date;
+import java.util.List;
import org.apache.abdera.model.Document;
import org.apache.abdera.model.Entry;
Modified: activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java (original)
+++ activemq/camel/trunk/components/camel-atom/src/main/java/org/apache/camel/component/atom/AtomUtils.java Thu May 15 06:33:37 2008
@@ -29,7 +29,11 @@
/**
* Atom utilities.
*/
-public class AtomUtils {
+public final class AtomUtils {
+
+ private AtomUtils() {
+ // Helper class
+ }
/**
* Gets the Atom parser.
@@ -40,7 +44,7 @@
/**
* Parses the given uri and returns the response as a atom feed document.
- *
+ *
* @param uri the uri for the atom feed.
* @return the document
* @throws IOException is thrown if error reading from the uri
Modified: activemq/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntryPollingConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntryPollingConsumerTest.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntryPollingConsumerTest.java (original)
+++ activemq/camel/trunk/components/camel-atom/src/test/java/org/apache/camel/component/atom/AtomEntryPollingConsumerTest.java Thu May 15 06:33:37 2008
@@ -17,11 +17,11 @@
package org.apache.camel.component.atom;
import org.apache.camel.ContextTestSupport;
-import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
/**
- * Unit test for AtomEntryPollingConsumer
+ * Unit test for AtomEntryPollingConsumer
*/
public class AtomEntryPollingConsumerTest extends ContextTestSupport {
@@ -49,7 +49,7 @@
from("atom:file:src/test/data/feed.atom?splitEntries=true").to("mock:result1");
from("atom:file:src/test/data/feed.atom?splitEntries=true&filter=false").to("mock:result2");
-
+
from("atom:file:src/test/data/feed.atom?splitEntries=true&filter=true&lastUpdate=2007-11-13T14:35:00").to("mock:result3");
}
};
Modified: activemq/camel/trunk/components/camel-hamcrest/src/main/java/org/apache/camel/hamcrest/Assertions.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-hamcrest/src/main/java/org/apache/camel/hamcrest/Assertions.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-hamcrest/src/main/java/org/apache/camel/hamcrest/Assertions.java (original)
+++ activemq/camel/trunk/components/camel-hamcrest/src/main/java/org/apache/camel/hamcrest/Assertions.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -22,10 +21,13 @@
/**
* A set of useful assertions you can use when testing
- *
+ *
* @version $Revision$
*/
-public class Assertions {
+public final class Assertions {
+ private Assertions() {
+ // Helper class
+ }
/**
* Performs the assertion that the given value is an instance of the specified type
Modified: activemq/camel/trunk/components/camel-hamcrest/src/test/java/org/apache/camel/hamcrest/AssertionsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-hamcrest/src/test/java/org/apache/camel/hamcrest/AssertionsTest.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-hamcrest/src/test/java/org/apache/camel/hamcrest/AssertionsTest.java (original)
+++ activemq/camel/trunk/components/camel-hamcrest/src/test/java/org/apache/camel/hamcrest/AssertionsTest.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -36,8 +35,7 @@
try {
String value = Assertions.assertInstanceOf(123, String.class);
fail("Should not return a value: " + value);
- }
- catch (AssertionError e) {
+ } catch (AssertionError e) {
LOG.info("Caught expected exception: " + e, e);
}
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/factory/BeanEndpointFactory.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/factory/BeanEndpointFactory.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/factory/BeanEndpointFactory.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/factory/BeanEndpointFactory.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -17,12 +16,8 @@
*/
package org.apache.camel.spring.factory;
-import java.io.File;
-
-import org.springframework.beans.factory.FactoryBean;
-import org.apache.camel.component.file.FileEndpoint;
import org.apache.camel.component.bean.BeanEndpoint;
-import org.apache.camel.util.ObjectHelper;
+import org.springframework.beans.factory.FactoryBean;
/**
* @version $Revision: 1.1 $
@@ -35,7 +30,7 @@
}
public Class getObjectType() {
- return FileEndpoint.class;
+ return BeanEndpoint.class;
}
public boolean isSingleton() {
@@ -48,6 +43,6 @@
// Properties
//-------------------------------------------------------------------------
-
-
+
+
}
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -19,11 +18,11 @@
import javax.annotation.Resource;
-import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.beans.factory.annotation.Autowired;
import org.apache.camel.CamelTemplate;
import org.apache.camel.Endpoint;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
/**
* @version $Revision: 1.1 $
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/file/SpringFileRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/file/SpringFileRouteTest.java?rev=656656&r1=656655&r2=656656&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/file/SpringFileRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/file/SpringFileRouteTest.java Thu May 15 06:33:37 2008
@@ -1,5 +1,4 @@
/**
- *
* 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.
@@ -7,7 +6,7 @@
* (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
+ * 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,
@@ -23,8 +22,8 @@
import org.apache.camel.Endpoint;
import org.apache.camel.EndpointInject;
import org.apache.camel.TestSupport;
-import org.apache.camel.hamcrest.Assertions;
import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.hamcrest.Assertions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
@@ -43,7 +42,7 @@
protected MockEndpoint result;
public void testMocksAreValid() throws Exception {
- // lets check that our injected endpoint is valid
+ // lets check that our injected endpoint is valid
FileEndpoint fileEndpoint = Assertions.assertInstanceOf(inputFile, FileEndpoint.class);
assertEquals("File", new File("target/test-default-inbox"), fileEndpoint.getFile());