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/03/27 02:11:08 UTC
svn commit: r641676 - in /activemq/camel/trunk/components/camel-spring/src:
main/java/org/apache/camel/spring/ main/java/org/apache/camel/spring/handler/
main/java/org/apache/camel/spring/remoting/
main/java/org/apache/camel/spring/spi/ main/java/org/a...
Author: ningjiang
Date: Wed Mar 26 18:11:05 2008
New Revision: 641676
URL: http://svn.apache.org/viewvc?rev=641676&view=rev
Log:
Fixed the camel-spring tons of CS errors
Modified:
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/EndpointFactoryBean.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelServiceExporter.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/util/SimpleRouteBuilder.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/dataset/SpringDataSetTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/TestBean.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainExampleTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringTestSupport.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/BeanInfoTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AutoRegisteredRouteBuilderTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/DependencyInjectCamelTemplateTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/NamespacePrefixTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/RouteBuilderRefTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/TemplateUsingBean.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/XmlConfigTestSupport.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/BeanMockTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyAggregator.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyProcessor.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringLoadBalanceTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStreamResequencerTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTransformTest.java
activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/xml/ConfiguredRouteBuilder.java
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java Wed Mar 26 18:11:05 2008
@@ -239,14 +239,14 @@
PollingConsumer pollingConsumer = endpoint.createPollingConsumer();
startService(pollingConsumer);
return pollingConsumer;
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw new RuntimeCamelException(e);
}
}
/**
- * A Factory method to create a started {@link Producer} to be injected into a POJO
+ * A Factory method to create a started {@link Producer} to be injected into
+ * a POJO
*/
protected Producer createInjectionProducer(Endpoint endpoint) {
try {
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java Wed Mar 26 18:11:05 2008
@@ -33,9 +33,9 @@
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.model.RouteBuilderRef;
import org.apache.camel.model.RouteContainer;
import org.apache.camel.model.RouteType;
-import org.apache.camel.model.RouteBuilderRef;
import org.apache.camel.model.dataformat.DataFormatType;
import org.apache.camel.spi.InstrumentationAgent;
import org.apache.commons.logging.Log;
@@ -70,10 +70,10 @@
@XmlElement(name = "package", required = false)
private String[] packages = {};
@XmlElements({
- @XmlElement(name = "beanPostProcessor", type = CamelBeanPostProcessor.class, required = false),
- @XmlElement(name = "template", type = CamelTemplateFactoryBean.class, required = false),
+ @XmlElement(name = "beanPostProcessor", type = CamelBeanPostProcessor.class, required = false),
+ @XmlElement(name = "template", type = CamelTemplateFactoryBean.class, required = false),
@XmlElement(name = "proxy", type = CamelProxyFactoryType.class, required = false),
- @XmlElement(name = "export", type = CamelServiceExporterType.class, required = false),
+ @XmlElement(name = "export", type = CamelServiceExporterType.class, required = false),
@XmlElement(name = "jmxAgent", required = false)})
private List beans;
@XmlElement(name = "routeBuilderRef", required = false)
@@ -152,8 +152,7 @@
try {
LOG.debug("Starting the context now!");
getContext().start();
- }
- catch (Exception e) {
+ } catch (Exception e) {
throw new RuntimeCamelException(e);
}
}
@@ -275,9 +274,9 @@
* Create the context
*/
protected SpringCamelContext createContext() {
- SpringCamelContext ctx = new SpringCamelContext(getApplicationContext());
- ctx.setName(getId());
- return ctx;
+ SpringCamelContext ctx = new SpringCamelContext(getApplicationContext());
+ ctx.setName(getId());
+ return ctx;
}
/**
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/EndpointFactoryBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/EndpointFactoryBean.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/EndpointFactoryBean.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/EndpointFactoryBean.java Wed Mar 26 18:11:05 2008
@@ -16,15 +16,21 @@
*/
package org.apache.camel.spring;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.Endpoint;
import org.apache.camel.NoSuchEndpointException;
import org.apache.camel.model.IdentifiedType;
-import static org.apache.camel.util.ObjectHelper.notNull;
import org.springframework.beans.factory.FactoryBean;
-import javax.xml.bind.annotation.*;
+import static org.apache.camel.util.ObjectHelper.notNull;
/**
* A {@link FactoryBean} which instantiates {@link Endpoint} objects
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java Wed Mar 26 18:11:05 2008
@@ -61,17 +61,24 @@
}
});
- addOption(new ParameterOption("a", "applicationContext", "Sets the classpath based pring ApplicationContext", "applicationContext") {
+ addOption(new ParameterOption("a", "applicationContext",
+ "Sets the classpath based pring ApplicationContext", "applicationContext") {
protected void doProcess(String arg, String parameter, LinkedList<String> remainingArgs) {
setApplicationContextUri(parameter);
}
});
- addOption(new ParameterOption("o", "outdir", "Sets the DOT output directory where the visual representations of the routes are generated", "dot") {
+ addOption(new ParameterOption("o", "outdir",
+ "Sets the DOT output directory where the visual representations of the routes are generated",
+ "dot") {
protected void doProcess(String arg, String parameter, LinkedList<String> remainingArgs) {
setDotOutputDir(parameter);
}
});
- addOption(new ParameterOption("d", "duration", "Sets the time duration that the applicaiton will run for, by default in milliseconds. You can use '10s' for 10 seconds etc", "duration") {
+ addOption(new ParameterOption(
+ "d",
+ "duration",
+ "Sets the time duration that the applicaiton will run for, by default in milliseconds. You can use '10s' for 10 seconds etc",
+ "duration") {
protected void doProcess(String arg, String parameter, LinkedList<String> remainingArgs) {
String value = parameter.toUpperCase();
if (value.endsWith("S")) {
@@ -104,8 +111,7 @@
start();
waitUntilCompleted();
stop();
- }
- catch (Exception e) {
+ } catch (Exception e) {
LOG.error("Failed: " + e, e);
}
}
@@ -131,7 +137,8 @@
System.out.println();
for (Option option : options) {
- System.out.println(" " + option.getAbbreviation() + " or " + option.getFullName() + " = " + option.getDescription());
+ System.out.println(" " + option.getAbbreviation() + " or " + option.getFullName() + " = "
+ + option.getDescription());
}
}
@@ -206,7 +213,8 @@
public abstract class ParameterOption extends Option {
private String parameterName;
- protected ParameterOption(String abbreviation, String fullName, String description, String parameterName) {
+ protected ParameterOption(String abbreviation, String fullName, String description,
+ String parameterName) {
super(abbreviation, fullName, description);
this.parameterName = parameterName;
}
@@ -216,8 +224,7 @@
System.err.println("Expected fileName for ");
showOptions();
completed();
- }
- else {
+ } else {
String parameter = remainingArgs.removeFirst();
doProcess(arg, parameter, remainingArgs);
}
@@ -253,8 +260,8 @@
}
/**
- * Sets the duration to run the application for in milliseconds until it should be terminated.
- * Defaults to -1. Any value <= 0 will run forever.
+ * Sets the duration to run the application for in milliseconds until it
+ * should be terminated. Defaults to -1. Any value <= 0 will run forever.
*
* @param duration
*/
@@ -278,9 +285,9 @@
}
/**
- * Sets the output directory of the generated DOT Files
- * to show the visual representation of the routes.
- * A null value disables the dot file generation
+ * Sets the output directory of the generated DOT Files to show the visual
+ * representation of the routes. A null value disables the dot file
+ * generation
*/
public void setDotOutputDir(String dotOutputDir) {
this.dotOutputDir = dotOutputDir;
@@ -327,12 +334,10 @@
LOG.info("Waiting for: " + duration + " " + unit);
latch.await(duration, unit);
completed.set(true);
- }
- else {
+ } else {
latch.await();
}
- }
- catch (InterruptedException e) {
+ } catch (InterruptedException e) {
LOG.debug("Caught: " + e);
}
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java Wed Mar 26 18:11:05 2008
@@ -33,21 +33,26 @@
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
-import org.springframework.context.*;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
- * A Spring aware implementation of {@link org.apache.camel.CamelContext} which will
- * automatically register itself with Springs lifecycle methods plus allows
+ * A Spring aware implementation of {@link org.apache.camel.CamelContext} which
+ * will automatically register itself with Springs lifecycle methods plus allows
* spring to be used to customize a any <a
* href="http://activemq.apache.org/camel/type-converter.html">Type Converters</a>
* as well as supporting accessing components and beans via the Spring
* {@link ApplicationContext}
- *
+ *
* @version $Revision$
*/
-public class SpringCamelContext extends DefaultCamelContext implements InitializingBean, DisposableBean, ApplicationContextAware, ApplicationListener {
+public class SpringCamelContext extends DefaultCamelContext implements InitializingBean, DisposableBean,
+ ApplicationContextAware, ApplicationListener {
private static final transient Log LOG = LogFactory.getLog(SpringCamelContext.class);
private ApplicationContext applicationContext;
private EventEndpoint eventEndpoint;
@@ -59,7 +64,8 @@
setApplicationContext(applicationContext);
}
- public static SpringCamelContext springCamelContext(ApplicationContext applicationContext) throws Exception {
+ public static SpringCamelContext springCamelContext(ApplicationContext applicationContext)
+ throws Exception {
// lets try and look up a configured camel context in the context
String[] names = applicationContext.getBeanNamesForType(SpringCamelContext.class);
if (names.length == 1) {
@@ -95,9 +101,8 @@
LOG.debug("Starting the CamelContext now that the ApplicationContext has started");
start();
} catch (RuntimeException e) {
- throw (e);
- }
- catch (Exception e) {
+ throw e;
+ } catch (Exception e) {
throw new RuntimeCamelException(e);
}
if (eventEndpoint != null) {
@@ -150,9 +155,9 @@
protected Injector createInjector() {
if (applicationContext instanceof ConfigurableApplicationContext) {
return new SpringInjector((ConfigurableApplicationContext)applicationContext);
- }
- else {
- LOG.warn("Cannot use SpringInjector as applicationContext is not a ConfigurableApplicationContext as its: " + applicationContext);
+ } else {
+ LOG.warn("Cannot use SpringInjector as applicationContext is not a ConfigurableApplicationContext as its: "
+ + applicationContext);
return super.createInjector();
}
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/SpringInstrumentationAgent.java Wed Mar 26 18:11:05 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,28 +16,21 @@
*/
package org.apache.camel.spring;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlTransient;
-import javax.management.MBeanServer;
-
import org.apache.camel.management.InstrumentationAgentImpl;
-import org.apache.camel.CamelContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
-public class SpringInstrumentationAgent extends InstrumentationAgentImpl
- implements InitializingBean, DisposableBean {
+public class SpringInstrumentationAgent extends InstrumentationAgentImpl implements InitializingBean,
+ DisposableBean {
private static final transient Log LOG = LogFactory.getLog(SpringInstrumentationAgent.class);
public void afterPropertiesSet() throws Exception {
- LOG.debug("Starting JMX agent on server: " + getMBeanServer());
+ LOG.debug("Starting JMX agent on server: " + getMBeanServer());
start();
- }
+ }
- public void destroy() throws Exception {
- }
+ public void destroy() throws Exception {
+ }
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/BeanDefinitionParser.java Wed Mar 26 18:11:05 2008
@@ -16,14 +16,16 @@
*/
package org.apache.camel.spring.handler;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.core.Conventions;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
+
/**
* A base class for a parser for a bean.
@@ -124,6 +126,7 @@
* @param element the XML element that was the source of the bean definition's metadata
*/
protected void postProcess(BeanDefinitionBuilder beanDefinition, Element element) {
- }
+
+ }
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/handler/CamelNamespaceHandler.java Wed Mar 26 18:11:05 2008
@@ -25,6 +25,10 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
import org.apache.camel.builder.xml.Namespaces;
import org.apache.camel.model.dataformat.ArtixDSDataFormat;
import org.apache.camel.model.dataformat.JaxbDataFormat;
@@ -37,8 +41,8 @@
import org.apache.camel.spi.NamespaceAware;
import org.apache.camel.spring.CamelBeanPostProcessor;
import org.apache.camel.spring.CamelContextFactoryBean;
-import org.apache.camel.spring.EndpointFactoryBean;
import org.apache.camel.spring.CamelTemplateFactoryBean;
+import org.apache.camel.spring.EndpointFactoryBean;
import org.apache.camel.spring.remoting.CamelProxyFactoryBean;
import org.apache.camel.spring.remoting.CamelServiceExporter;
import org.apache.camel.util.ObjectHelper;
@@ -49,14 +53,14 @@
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
import org.springframework.beans.factory.xml.ParserContext;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
+
public class CamelNamespaceHandler extends NamespaceHandlerSupport {
- public static final String JAXB_PACKAGES = "org.apache.camel.spring:org.apache.camel.model:org.apache.camel.model.config:org.apache.camel.model.dataformat:org.apache.camel.model.language:org.apache.camel.model.loadbalancer";
+ public static final String JAXB_PACKAGES = "org.apache.camel.spring:org.apache.camel.model:org.apache.camel.model.config:"
+ + "org.apache.camel.model.dataformat:org.apache.camel.model.language:org.apache.camel.model.loadbalancer";
protected BeanDefinitionParser endpointParser = new BeanDefinitionParser(EndpointFactoryBean.class);
- protected BeanDefinitionParser beanPostProcessorParser = new BeanDefinitionParser(CamelBeanPostProcessor.class);
+ protected BeanDefinitionParser beanPostProcessorParser = new BeanDefinitionParser(
+ CamelBeanPostProcessor.class);
protected Set<String> parserElementNames = new HashSet<String>();
private JAXBContext jaxbContext;
private Map<String, BeanDefinitionParser> parserMap = new HashMap<String, BeanDefinitionParser>();
@@ -74,12 +78,12 @@
addBeanDefinitionParser("serialization", SerializationDataFormat.class);
addBeanDefinitionParser("xmlBeans", XMLBeansDataFormat.class);
- //load balancers
+ // load balancers
addBeanDefinitionParser("roundRobin", RoundRobinLoadBalanceStrategy.class);
addBeanDefinitionParser("random", RandomLoadBalanceStrategy.class);
addBeanDefinitionParser("sticky", StickyLoadBalanceStrategy.class);
addBeanDefinitionParser("topic", TopicLoadBalanceStrategy.class);
-
+
// TODO switch to use the above mechanism?
registerParser("endpoint", endpointParser);
@@ -103,7 +107,8 @@
registerParser(elementName, new ScriptDefinitionParser(engineName));
}
- protected void registerParser(String name, org.springframework.beans.factory.xml.BeanDefinitionParser parser) {
+ protected void registerParser(String name,
+ org.springframework.beans.factory.xml.BeanDefinitionParser parser) {
parserElementNames.add(name);
registerBeanDefinitionParser(name, parser);
}
@@ -116,12 +121,12 @@
try {
binder = getJaxbContext().createBinder();
return binder.unmarshal(element);
-/*
- Unmarshaller unmarshaller = getJaxbContext().createUnmarshaller();
- return unmarshaller.unmarshal(element);
-*/
- }
- catch (JAXBException e) {
+ /*
+ * Unmarshaller unmarshaller =
+ * getJaxbContext().createUnmarshaller(); return
+ * unmarshaller.unmarshal(element);
+ */
+ } catch (JAXBException e) {
throw new BeanDefinitionStoreException("Failed to parse JAXB element: " + e, e);
}
}
@@ -158,7 +163,7 @@
// now lets parse the routes
Object value = parseUsingJaxb(element, parserContext);
if (value instanceof CamelContextFactoryBean) {
- CamelContextFactoryBean factoryBean = (CamelContextFactoryBean) value;
+ CamelContextFactoryBean factoryBean = (CamelContextFactoryBean)value;
builder.addPropertyValue("id", contextId);
builder.addPropertyValue("routes", factoryBean.getRoutes());
builder.addPropertyValue("builderRefs", factoryBean.getBuilderRefs());
@@ -174,24 +179,23 @@
for (int i = 0; i < size; i++) {
Node child = list.item(i);
if (child instanceof Element) {
- Element childElement = (Element) child;
+ Element childElement = (Element)child;
String localName = child.getLocalName();
if (localName.equals("beanPostProcessor")) {
createBeanPostProcessor(parserContext, contextId, childElement);
createdBeanPostProcessor = true;
- }
- else if (localName.equals("endpoint")) {
+ } else if (localName.equals("endpoint")) {
BeanDefinition definition = endpointParser.parse(childElement, parserContext);
String id = childElement.getAttribute("id");
if (ObjectHelper.isNotNullAndNonEmpty(id)) {
// TODO we can zap this?
- definition.getPropertyValues().addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
+ definition.getPropertyValues()
+ .addPropertyValue("camelContext", new RuntimeBeanReference(contextId));
// definition.getPropertyValues().addPropertyValue("context",
// builder.getBeanDefinition());
parserContext.registerComponent(new BeanComponentDefinition(definition, id));
}
- }
- else {
+ } else {
BeanDefinitionParser parser = parserMap.get(localName);
if (parser != null) {
BeanDefinition definition = parser.parse(childElement, parserContext);
@@ -221,10 +225,10 @@
for (int i = 0; i < size; i++) {
Node child = list.item(i);
if (child instanceof Element) {
- Element childElement = (Element) child;
+ Element childElement = (Element)child;
Object object = binder.getJAXBNode(child);
if (object instanceof NamespaceAware) {
- NamespaceAware namespaceAware = (NamespaceAware) object;
+ NamespaceAware namespaceAware = (NamespaceAware)object;
if (namespaces == null) {
namespaces = new Namespaces(element);
}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelServiceExporter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelServiceExporter.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelServiceExporter.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/remoting/CamelServiceExporter.java Wed Mar 26 18:11:05 2008
@@ -16,13 +16,13 @@
*/
package org.apache.camel.spring.remoting;
+
import org.apache.camel.CamelContext;
import org.apache.camel.CamelContextAware;
import org.apache.camel.Consumer;
import org.apache.camel.Endpoint;
import org.apache.camel.component.bean.BeanProcessor;
import org.apache.camel.util.CamelContextHelper;
-import static org.apache.camel.util.ObjectHelper.notNull;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
@@ -30,6 +30,8 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.remoting.support.RemoteExporter;
+
+import static org.apache.camel.util.ObjectHelper.notNull;
/**
* A {@link FactoryBean} to create a proxy to a service exposing a given {@link #getServiceInterface()}
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringInjector.java Wed Mar 26 18:11:05 2008
@@ -17,11 +17,7 @@
package org.apache.camel.spring.spi;
import org.apache.camel.spi.Injector;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.context.support.AbstractRefreshableApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
/**
Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/util/SimpleRouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/util/SimpleRouteBuilder.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/util/SimpleRouteBuilder.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/util/SimpleRouteBuilder.java Wed Mar 26 18:11:05 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,
@@ -123,16 +122,13 @@
if (type != null) {
if (beanMethod != null) {
route = route.bean(type, beanMethod);
- }
- else {
+ } else {
route = route.bean(type);
}
- }
- else if (beanRef != null) {
+ } else if (beanRef != null) {
if (beanMethod != null) {
route = route.beanRef(beanRef, beanMethod);
- }
- else {
+ } else {
route = route.beanRef(beanRef);
}
}
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/dataset/SpringDataSetTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/dataset/SpringDataSetTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/dataset/SpringDataSetTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/dataset/SpringDataSetTest.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/test/TestEndpointTest.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/TestBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/TestBean.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/TestBean.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/TestBean.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java Wed Mar 26 18:11:05 2008
@@ -18,9 +18,9 @@
import java.util.List;
+import org.apache.camel.Exchange;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.spring.SpringTestSupport;
-import org.apache.camel.Exchange;
import org.springframework.context.support.ClassPathXmlApplicationContext;
/**
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainExampleTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainExampleTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainExampleTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainExampleTest.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/MainTest.java Wed Mar 26 18:11:05 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,
@@ -20,9 +19,9 @@
import java.util.List;
import junit.framework.TestCase;
-import org.apache.camel.spring.util.SimpleRouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.Exchange;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.util.SimpleRouteBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -50,7 +49,7 @@
endpoint.expectedMessageCount(2);
endpoint.assertIsSatisfied();
List<Exchange> list = endpoint.getReceivedExchanges();
-
+
LOG.debug("Received: " + list);
main.stop();
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringTestSupport.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringTestSupport.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringTestSupport.java Wed Mar 26 18:11:05 2008
@@ -18,17 +18,10 @@
import java.util.List;
-import org.apache.camel.CamelTemplate;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Exchange;
-import org.apache.camel.Route;
-import org.apache.camel.TestSupport;
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
-import org.apache.camel.impl.DefaultCamelContext;
-import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.Route;
import org.apache.camel.util.ObjectHelper;
-
import org.springframework.context.support.AbstractXmlApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -56,7 +49,7 @@
}
}
-
+
/**
* Looks up the mandatory spring bean of the given name and type, failing if
* it is not present or the correct type
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/BeanInfoTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/BeanInfoTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/BeanInfoTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/bind/BeanInfoTest.java Wed Mar 26 18:11:05 2008
@@ -33,11 +33,13 @@
*/
public class BeanInfoTest extends TestCase {
private static final Log LOG = LogFactory.getLog(BeanInfoTest.class);
- private DefaultCamelContext camelContext = new DefaultCamelContext();
+ protected DefaultCamelContext camelContext = new DefaultCamelContext();
protected Exchange exchange = new DefaultExchange(camelContext);
protected DefaultParameterMappingStrategy strategy = new DefaultParameterMappingStrategy();
protected ExampleBean bean = new ExampleBean();
protected BeanInfo info;
+
+
public void testFindsSingleMethodMatchingBody() throws Throwable {
MethodInvocation invocation = info.createInvocation(bean, exchange);
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AutoRegisteredRouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AutoRegisteredRouteBuilderTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AutoRegisteredRouteBuilderTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AutoRegisteredRouteBuilderTest.java Wed Mar 26 18:11:05 2008
@@ -17,24 +17,8 @@
package org.apache.camel.spring.config;
import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
-import org.apache.camel.Processor;
-import org.apache.camel.Route;
-import org.apache.camel.TestSupport;
-import org.apache.camel.spring.config.XmlConfigTestSupport;
-import org.apache.camel.model.RouteType;
-import org.apache.camel.model.FromType;
-import org.apache.camel.model.ProcessorType;
-import org.apache.camel.impl.EventDrivenConsumerRoute;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.ClassPathResource;
-
-import java.util.List;
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/CamelContextFactoryBeanTest.java Wed Mar 26 18:11:05 2008
@@ -16,26 +16,19 @@
*/
package org.apache.camel.spring.config;
+import java.util.List;
+
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.Processor;
import org.apache.camel.Route;
-import org.apache.camel.TestSupport;
-import org.apache.camel.spring.config.XmlConfigTestSupport;
-import org.apache.camel.model.RouteType;
-import org.apache.camel.model.FromType;
-import org.apache.camel.model.ProcessorType;
import org.apache.camel.impl.EventDrivenConsumerRoute;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.ClassPathResource;
-import java.util.List;
-
/**
* @version $Revision$
*/
@@ -61,7 +54,7 @@
// lets refresh to inject the applicationContext into beans
applicationContext.refresh();
-
+
CamelContext context = (CamelContext) applicationContext.getBean("camel3");
assertValidContext(context);
}
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/DependencyInjectCamelTemplateTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/DependencyInjectCamelTemplateTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/DependencyInjectCamelTemplateTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/DependencyInjectCamelTemplateTest.java Wed Mar 26 18:11:05 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,18 +16,19 @@
*/
package org.apache.camel.spring.config;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
import org.apache.camel.CamelTemplate;
import org.apache.camel.EndpointInject;
import org.apache.camel.component.mock.MockEndpoint;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
/**
* @version $Revision: 1.1 $
*/
@ContextConfiguration
public class DependencyInjectCamelTemplateTest extends AbstractJUnit38SpringContextTests {
+ protected String body = "Hello";
@Autowired
private TemplateUsingBean bean;
@@ -36,7 +36,7 @@
@EndpointInject(uri = "mock:results")
private MockEndpoint endpoint;
- protected String body = "Hello";
+
public void testBeanHasCamelTemplateInjected() throws Exception {
assertNotNull("Bean should be injected", bean);
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/NamespacePrefixTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/NamespacePrefixTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/NamespacePrefixTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/NamespacePrefixTest.java Wed Mar 26 18:11:05 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,18 +16,19 @@
*/
package org.apache.camel.spring.config;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
import org.apache.camel.CamelTemplate;
import org.apache.camel.EndpointInject;
import org.apache.camel.component.mock.MockEndpoint;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
/**
* @version $Revision: 1.1 $
*/
@ContextConfiguration
public class NamespacePrefixTest extends AbstractJUnit38SpringContextTests {
+ protected String body = "Hello";
@Autowired
private CamelTemplate template;
@@ -36,7 +36,7 @@
@EndpointInject(uri = "mock:results")
private MockEndpoint endpoint;
- protected String body = "Hello";
+
public void testAssertThatInjectionWorks() throws Exception {
assertNotNull("Bean should be injected", template);
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/RouteBuilderRefTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/RouteBuilderRefTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/RouteBuilderRefTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/RouteBuilderRefTest.java Wed Mar 26 18:11:05 2008
@@ -17,7 +17,6 @@
package org.apache.camel.spring.config;
import org.apache.camel.CamelContext;
-import org.apache.camel.spring.config.XmlConfigTestSupport;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -25,9 +24,9 @@
* @version $Revision$
*/
public class RouteBuilderRefTest extends XmlConfigTestSupport {
-
+
public void testUsingRouteBuilderRefInCamelXml() throws Exception {
- ApplicationContext applicationContext =
+ ApplicationContext applicationContext =
new ClassPathXmlApplicationContext("org/apache/camel/spring/config/routeBuilderRef.xml");
CamelContext context = (CamelContext) applicationContext.getBean("camel5");
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/TemplateUsingBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/TemplateUsingBean.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/TemplateUsingBean.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/TemplateUsingBean.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/XmlConfigTestSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/XmlConfigTestSupport.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/XmlConfigTestSupport.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/XmlConfigTestSupport.java Wed Mar 26 18:11:05 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,12 +18,11 @@
import java.util.List;
-import org.apache.camel.TestSupport;
import org.apache.camel.CamelContext;
-import org.apache.camel.spring.config.CamelContextFactoryBeanTest;
-import org.apache.camel.model.RouteType;
+import org.apache.camel.TestSupport;
import org.apache.camel.model.FromType;
import org.apache.camel.model.ProcessorType;
+import org.apache.camel.model.RouteType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/managment/JmxInstrumentationWithConnectorTest.java Wed Mar 26 18:11:05 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,
@@ -31,11 +30,11 @@
}
@Override
- protected ClassPathXmlApplicationContext createApplicationContext() {
+ protected ClassPathXmlApplicationContext createApplicationContext() {
return new ClassPathXmlApplicationContext("org/apache/camel/spring/management/jmxInstrumentationWithConnector.xml");
- }
-
+ }
+
public void testGetContext() {
- assertNotNull(this.applicationContext.getBean("camel"));
+ assertNotNull(this.applicationContext.getBean("camel"));
}
}
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/BeanMockTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/BeanMockTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/BeanMockTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/BeanMockTest.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/mock/MyAssertions.java Wed Mar 26 18:11:05 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,
@@ -30,10 +29,10 @@
*/
// START SNIPPET: example
public class MyAssertions implements InitializingBean {
- @EndpointInject(uri="mock:matched")
+ @EndpointInject(uri = "mock:matched")
private MockEndpoint matched;
- @EndpointInject(uri="mock:notMatched")
+ @EndpointInject(uri = "mock:notMatched")
private MockEndpoint notMatched;
public void afterPropertiesSet() throws Exception {
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyAggregator.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyAggregator.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyAggregator.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyAggregator.java Wed Mar 26 18:11:05 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,
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyProcessor.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyProcessor.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/MyProcessor.java Wed Mar 26 18:11:05 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,9 +16,9 @@
*/
package org.apache.camel.spring.processor;
-import org.apache.camel.Processor;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
+import org.apache.camel.Processor;
/**
* A simple processor which transforms the input
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringFaultRouteTest.java Wed Mar 26 18:11:05 2008
@@ -6,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,9 +17,10 @@
package org.apache.camel.spring.processor;
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
import org.apache.camel.CamelContext;
import org.apache.camel.processor.FaultRouteTest;
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
/**
* The spring context test for the FaultRoute
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringLoadBalanceTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringLoadBalanceTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringLoadBalanceTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringLoadBalanceTest.java Wed Mar 26 18:11:05 2008
@@ -16,9 +16,11 @@
*/
package org.apache.camel.spring.processor;
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
import org.apache.camel.CamelContext;
import org.apache.camel.processor.LoadBalanceTest;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
public class SpringLoadBalanceTest extends LoadBalanceTest {
protected CamelContext createCamelContext() throws Exception {
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStaticRecipientListTest.java Wed Mar 26 18:11:05 2008
@@ -16,10 +16,10 @@
*/
package org.apache.camel.spring.processor;
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
import org.apache.camel.CamelContext;
import org.apache.camel.processor.StaticRecipientListTest;
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
public class SpringStaticRecipientListTest extends StaticRecipientListTest {
protected CamelContext createCamelContext() throws Exception {
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStreamResequencerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStreamResequencerTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStreamResequencerTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringStreamResequencerTest.java Wed Mar 26 18:11:05 2008
@@ -16,10 +16,11 @@
*/
package org.apache.camel.spring.processor;
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
import org.apache.camel.CamelContext;
import org.apache.camel.processor.StreamResequencerTest;
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
+
public class SpringStreamResequencerTest extends StreamResequencerTest {
protected CamelContext createCamelContext() throws Exception {
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTransformTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTransformTest.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTransformTest.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringTransformTest.java Wed Mar 26 18:11:05 2008
@@ -16,11 +16,12 @@
*/
package org.apache.camel.spring.processor;
-import org.apache.camel.ContextTestSupport;
+
import org.apache.camel.CamelContext;
-import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
-import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.ContextTestSupport;
import org.apache.camel.component.mock.MockEndpoint;
+
+import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/xml/ConfiguredRouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/xml/ConfiguredRouteBuilder.java?rev=641676&r1=641675&r2=641676&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/xml/ConfiguredRouteBuilder.java (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/xml/ConfiguredRouteBuilder.java Wed Mar 26 18:11:05 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,