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 2015/01/04 07:33:57 UTC

[1/3] camel git commit: CAMEL-8174 Polish the unit test of MyInflightRepositoryTest

Repository: camel
Updated Branches:
  refs/heads/master 033bc8eec -> d29a54aae


CAMEL-8174 Polish the unit test of MyInflightRepositoryTest


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6cb50425
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6cb50425
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6cb50425

Branch: refs/heads/master
Commit: 6cb504252967d4e178bb27b84569a79844195c86
Parents: 033bc8e
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Jan 4 14:26:56 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Jan 4 14:26:56 2015 +0800

----------------------------------------------------------------------
 .../test/blueprint/CamelContextSetter.java      | 34 --------------------
 .../test/blueprint/MyInflightRepositoryTest.xml |  7 ++--
 2 files changed, 3 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6cb50425/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/CamelContextSetter.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/CamelContextSetter.java b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/CamelContextSetter.java
deleted file mode 100644
index e39e3f9..0000000
--- a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/CamelContextSetter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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.test.blueprint;
-
-import org.apache.camel.CamelContext;
-
-public class CamelContextSetter {
-    
-    public void setCamelContext(CamelContext camelContext) throws Exception {
-        MyInflightRepository repository = new MyInflightRepository();
-        repository.setWaitTime(100);
-        repository.setTimeout(100);
-        // Just add the repository into CamelContex as a service
-        camelContext.addService(repository);
-        // Setup the inflightRepository to the camel context
-        camelContext.setInflightRepository(repository);
-    }
-
-    
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/6cb50425/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MyInflightRepositoryTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MyInflightRepositoryTest.xml b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MyInflightRepositoryTest.xml
index d13e5f9..dcccd0e 100644
--- a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MyInflightRepositoryTest.xml
+++ b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MyInflightRepositoryTest.xml
@@ -24,10 +24,9 @@
 
   <bean id="async" class="org.apache.camel.processor.async.MyAsyncComponent" />
   
-  <bean id="injector" class="org.apache.camel.test.blueprint.CamelContextSetter" >
-     <property name="camelContext">
-           <ref component-id="myCamelContext"/>
-      </property>
+  <bean id="myInflightRepository" class="org.apache.camel.test.blueprint.MyInflightRepository">
+     <property name="waitTime" value="100" />
+     <property name="timeout" value="100" />
   </bean>
 
   <camelContext id="myCamelContext" xmlns="http://camel.apache.org/schema/blueprint">


[2/3] camel git commit: CAMEL-8201 Fixed the CS error of the unit test

Posted by ni...@apache.org.
CAMEL-8201 Fixed the CS error of the unit test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/4e2d5efc
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4e2d5efc
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4e2d5efc

Branch: refs/heads/master
Commit: 4e2d5efc31c1ff0ba7cc526f630f53208c58c63d
Parents: 6cb5042
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Jan 4 14:28:31 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Jan 4 14:28:31 2015 +0800

----------------------------------------------------------------------
 .../builder/script/RubyScriptTextTest.java      | 23 +++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4e2d5efc/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyScriptTextTest.java
----------------------------------------------------------------------
diff --git a/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyScriptTextTest.java b/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyScriptTextTest.java
index 875f309..6bfb354 100755
--- a/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyScriptTextTest.java
+++ b/components/camel-script/src/test/java/org/apache/camel/builder/script/RubyScriptTextTest.java
@@ -1,19 +1,30 @@
+/**
+ * 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.builder.script;
 
 
-import java.util.HashSet;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import org.junit.Assert;
-import org.junit.Ignore;
 import org.apache.camel.EndpointInject;
 import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class RubyScriptTextTest extends CamelTestSupport {


[3/3] camel git commit: CAMEL-8173 Revert "CAMEL-8173 Support to set InflightRepository from Camel XML DSL"

Posted by ni...@apache.org.
CAMEL-8173 Revert "CAMEL-8173 Support to set InflightRepository from Camel XML DSL"

This reverts commit d3d3161b408a12349d55a26277590fcafc49c99f.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d29a54aa
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d29a54aa
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d29a54aa

Branch: refs/heads/master
Commit: d29a54aaeece1d18313eef3bcf1bac584a0e637c
Parents: 4e2d5ef
Author: Willem Jiang <wi...@gmail.com>
Authored: Sun Jan 4 14:29:17 2015 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Sun Jan 4 14:29:17 2015 +0800

----------------------------------------------------------------------
 .../blueprint/CamelContextFactoryBean.java      | 10 -----
 .../xml/AbstractCamelContextFactoryBean.java    | 11 ------
 .../camel/spring/CamelContextFactoryBean.java   | 12 +-----
 .../spring/config/MyInflightRepositoryTest.java | 39 -------------------
 .../spring/config/myInflightRepository.xml      | 40 --------------------
 5 files changed, 1 insertion(+), 111 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d29a54aa/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
index d89f2d8..56f1fba 100644
--- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
+++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/CamelContextFactoryBean.java
@@ -107,8 +107,6 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Blu
     @XmlAttribute(required = false)
     private String threadNamePattern;
     @XmlAttribute(required = false)
-    private String inflightRepositoryRef;
-    @XmlAttribute(required = false)
     private Boolean useBlueprintPropertyResolver;
     @XmlAttribute(required = false)
     private ShutdownRoute shutdownRoute;
@@ -379,14 +377,6 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Blu
         this.threadNamePattern = threadNamePattern;
     }
 
-    public String getInflightRepositoryRef() {
-        return inflightRepositoryRef;
-    }
-
-    public void setInflightRepositoryRef(String inflightRepositoryRef) {
-        this.inflightRepositoryRef = inflightRepositoryRef;
-    }
-
     @Deprecated
     public Boolean getLazyLoadTypeConverters() {
         // use false by default

http://git-wip-us.apache.org/repos/asf/camel/blob/d29a54aa/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
index 9e6890f..28d0e08 100644
--- a/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
+++ b/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
@@ -24,7 +24,6 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlTransient;
@@ -673,8 +672,6 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
     public abstract List<RestContextRefDefinition> getRestRefs();
 
     public abstract String getErrorHandlerRef();
-   
-    public abstract String getInflightRepositoryRef();
 
     public abstract DataFormatsDefinition getDataFormats();
 
@@ -718,14 +715,6 @@ public abstract class AbstractCamelContextFactoryBean<T extends ModelCamelContex
         if (getErrorHandlerRef() != null) {
             ctx.setErrorHandlerBuilder(new ErrorHandlerBuilderRef(getErrorHandlerRef()));
         }
-        if (getInflightRepositoryRef() != null) {
-            InflightRepository repository = ctx.getRegistry().lookupByNameAndType(getInflightRepositoryRef(), InflightRepository.class);
-            if (repository == null) {
-                throw new IllegalArgumentException("Cannot not find InflightRepository instance from CamelContext registry with " + getInflightRepositoryRef());
-            }
-            ctx.addService(repository);
-            ctx.setInflightRepository(repository);
-        }
         if (getAutoStartup() != null) {
             ctx.setAutoStartup(CamelContextHelper.parseBoolean(getContext(), getAutoStartup()));
         }

http://git-wip-us.apache.org/repos/asf/camel/blob/d29a54aa/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
index 859b963..0a39e2a 100644
--- a/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
+++ b/components/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java
@@ -19,7 +19,6 @@ package org.apache.camel.spring;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlAttribute;
@@ -71,6 +70,7 @@ import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ApplicationEvent;
 import org.springframework.context.ApplicationListener;
 import org.springframework.context.event.ContextRefreshedEvent;
+
 import static org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException;
 
 /**
@@ -118,8 +118,6 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr
     @XmlAttribute(required = false)
     private String threadNamePattern;
     @XmlAttribute(required = false)
-    private String inflightRepositoryRef;
-    @XmlAttribute(required = false)
     private ShutdownRoute shutdownRoute;
     @XmlAttribute(required = false)
     private ShutdownRunningTask shutdownRunningTask;
@@ -632,14 +630,6 @@ public class CamelContextFactoryBean extends AbstractCamelContextFactoryBean<Spr
         this.threadNamePattern = threadNamePattern;
     }
 
-    public String getInflightRepositoryRef() {
-        return inflightRepositoryRef;
-    }
-
-    public void setInflightRepositoryRef(String inflightRepositoryRef) {
-        this.inflightRepositoryRef = inflightRepositoryRef;
-    }
-
     @Deprecated
     public Boolean getLazyLoadTypeConverters() {
         return lazyLoadTypeConverters;

http://git-wip-us.apache.org/repos/asf/camel/blob/d29a54aa/components/camel-spring/src/test/java/org/apache/camel/spring/config/MyInflightRepositoryTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/config/MyInflightRepositoryTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/config/MyInflightRepositoryTest.java
deleted file mode 100644
index 53c19e2..0000000
--- a/components/camel-spring/src/test/java/org/apache/camel/spring/config/MyInflightRepositoryTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 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.spring.config;
-
-import org.apache.camel.impl.DefaultInflightRepository;
-import org.apache.camel.spring.SpringCamelContext;
-import org.apache.camel.spring.SpringTestSupport;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class MyInflightRepositoryTest extends SpringTestSupport {
-    protected AbstractXmlApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/camel/spring/config/myInflightRepository.xml");
-    }
-
-    public void testEndpointConfiguration() throws Exception {
-        SpringCamelContext context = applicationContext.getBeansOfType(SpringCamelContext.class).values().iterator().next();
-        assertTrue("Get a wrong inflight repository", context.getInflightRepository() instanceof MyInflightRepository);
-    }
-    
-    public static class MyInflightRepository extends DefaultInflightRepository {
-        
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/d29a54aa/components/camel-spring/src/test/resources/org/apache/camel/spring/config/myInflightRepository.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/config/myInflightRepository.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/config/myInflightRepository.xml
deleted file mode 100644
index 3536ccf..0000000
--- a/components/camel-spring/src/test/resources/org/apache/camel/spring/config/myInflightRepository.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
-    ">
-
-
-    <camelContext inflightRepositoryRef="myinflightRepository" xmlns="http://camel.apache.org/schema/spring">
-        <jmxAgent id="agent" disabled="true"/>
-        <route>
-            <from uri="seda:a"/>
-            <to uri="seda:b"/>
-        </route>
-        <route>
-            <from uri="direct:c"/>
-            <to uri="direct:d"/>
-        </route>
-    </camelContext>
-
-    <bean id="myinflightRepository" class="org.apache.camel.spring.config.MyInflightRepositoryTest$MyInflightRepository" />
-
-</beans>