You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/07/10 12:21:24 UTC
[1/4] git commit: CAME-6524: camel-test-blueprint - Using
isMockEndpointsAndSkip doesnt work
Updated Branches:
refs/heads/camel-2.11.x 81830bf1a -> 82130fd49
refs/heads/master bca343009 -> d7956a246
CAME-6524: camel-test-blueprint - Using isMockEndpointsAndSkip doesnt work
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cb6ccacb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cb6ccacb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cb6ccacb
Branch: refs/heads/master
Commit: cb6ccacb4fd2b828459a0be5b65f3a62394f9612
Parents: bca3430
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 10 07:59:04 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 10 11:26:59 2013 +0200
----------------------------------------------------------------------
.../camel/blueprint/BlueprintCamelContext.java | 29 ++++++++++--
.../core/osgi/OsgiCamelContextPublisher.java | 45 +++++++++++++------
.../blueprint/CamelBlueprintTestSupport.java | 12 ++++-
.../blueprint/MockEndpointsAndSkipTest.java | 42 ++++++++++++++++++
.../test/blueprint/MockEndpointsAndSkipTest.xml | 34 +++++++++++++++
.../test/issues/MockEndpointsAndSkipTest.java | 46 ++++++++++++++++++++
.../test/issues/MockEndpointsAndSkipTest.xml | 35 +++++++++++++++
7 files changed, 226 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
----------------------------------------------------------------------
diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
index 60f0b4d..f92d5e0 100644
--- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
+++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
@@ -22,11 +22,13 @@ import java.util.Properties;
import org.apache.camel.TypeConverter;
import org.apache.camel.core.osgi.OsgiCamelContextHelper;
+import org.apache.camel.core.osgi.OsgiCamelContextPublisher;
import org.apache.camel.core.osgi.OsgiFactoryFinderResolver;
import org.apache.camel.core.osgi.OsgiTypeConverter;
import org.apache.camel.core.osgi.utils.BundleContextUtils;
import org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spi.EventNotifier;
import org.apache.camel.spi.FactoryFinder;
import org.apache.camel.spi.Registry;
import org.apache.camel.util.LoadPropertiesException;
@@ -40,6 +42,9 @@ import org.osgi.service.blueprint.container.BlueprintListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * OSGi Blueprint based {@link CamelContext}.
+ */
public class BlueprintCamelContext extends DefaultCamelContext implements ServiceListener, BlueprintListener {
private static final transient Logger LOG = LoggerFactory.getLogger(BlueprintCamelContext.class);
@@ -177,8 +182,28 @@ public class BlueprintCamelContext extends DefaultCamelContext implements Servic
private void maybeStart() throws Exception {
LOG.trace("maybeStart: {}", this);
+
+ // allow to regsiter the BluerintCamelContext eager in the OSGi Service Registry, which ex is needed
+ // for unit testing with camel-test-blueprint
+ boolean eager = "true".equalsIgnoreCase(System.getProperty("registerBlueprintCamelContextEager"));
+ if (eager) {
+ for (EventNotifier notifer : getManagementStrategy().getEventNotifiers()) {
+ if (notifer instanceof OsgiCamelContextPublisher) {
+ OsgiCamelContextPublisher publisher = (OsgiCamelContextPublisher) notifer;
+ publisher.registerCamelContext(this);
+ break;
+ }
+ }
+ }
+
// for example from unit testing we want to start Camel later and not
// when blueprint loading the bundle
+ boolean skip = "true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"));
+ if (skip) {
+ LOG.trace("maybeStart: {} is skipping as System property skipStartingCamelContext is set", this);
+ return;
+ }
+
if (!isStarted() && !isStarting()) {
LOG.debug("Starting {}", this);
start();
@@ -186,8 +211,6 @@ public class BlueprintCamelContext extends DefaultCamelContext implements Servic
// ignore as Camel is already started
LOG.trace("Ignoring maybeStart() as {} is already started", this);
}
-
}
-
-
+
}
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index b542d19..7c9ed17 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -24,11 +24,14 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.camel.CamelContext;
import org.apache.camel.management.event.CamelContextStartedEvent;
+import org.apache.camel.management.event.CamelContextStartingEvent;
import org.apache.camel.management.event.CamelContextStoppingEvent;
import org.apache.camel.support.EventNotifierSupport;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.Version;
@@ -52,18 +55,7 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
public void notify(EventObject event) throws Exception {
if (event instanceof CamelContextStartedEvent) {
CamelContext context = ((CamelContextStartedEvent) event).getContext();
-
- Dictionary<String, Object > props = new Hashtable<String, Object>();
- props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
- props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
- props.put(CONTEXT_NAME_PROPERTY, context.getName());
-
- if (log.isDebugEnabled()) {
- log.debug("Registering CamelContext [{}] of in OSGi registry", context.getName());
- }
-
- ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(), context, props);
- registrations.put(context, reg);
+ registerCamelContext(context);
} else if (event instanceof CamelContextStoppingEvent) {
CamelContext context = ((CamelContextStoppingEvent) event).getContext();
ServiceRegistration reg = registrations.remove(context);
@@ -81,7 +73,10 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
}
public boolean isEnabled(EventObject event) {
- return true;
+ if (event instanceof CamelContextStartedEvent || event instanceof CamelContextStoppingEvent) {
+ return true;
+ }
+ return false;
}
@Override
@@ -97,9 +92,33 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
registrations.clear();
}
+ public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
+ // avoid registering the same service again
+ ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(), "(camel.context.symbolicname=" + bundleContext.getBundle().getSymbolicName() + ")");
+ if (refs == null) {
+ Dictionary<String, Object > props = new Hashtable<String, Object>();
+ props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
+ props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
+ props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Registering CamelContext [{}] of in OSGi registry", camelContext.getName());
+ }
+
+ ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(), camelContext, props);
+ if (reg != null) {
+ registrations.put(camelContext, reg);
+ }
+ return reg;
+ } else {
+ return null;
+ }
+ }
+
public static Version getBundleVersion(Bundle bundle) {
Dictionary<?, ?> headers = bundle.getHeaders();
String version = (String) headers.get(Constants.BUNDLE_VERSION);
return (version != null) ? Version.parseVersion(version) : Version.emptyVersion;
}
+
}
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
index eb970f5..bbd0b7d 100644
--- a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
+++ b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
@@ -80,6 +80,9 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
@Before
@Override
public void setUp() throws Exception {
+ System.setProperty("skipStartingCamelContext", "true");
+ System.setProperty("registerBlueprintCamelContextEager", "true");
+
String symbolicName = getClass().getSimpleName();
if (isCreateCamelContextPerClass()) {
// test is per class, so only setup once (the first time)
@@ -93,6 +96,11 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
}
super.setUp();
+
+ // start context when we are ready
+ log.debug("Staring CamelContext: {}", context.getName());
+ context.start();
+
// must wait for blueprint container to be published then the namespace parser is complete and we are ready for testing
log.debug("Waiting for BlueprintContainer to be published with symbolicName: {}", symbolicName);
getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")");
@@ -121,6 +129,8 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
@After
@Override
public void tearDown() throws Exception {
+ System.clearProperty("skipStartingCamelContext");
+ System.clearProperty("registerBlueprintCamelContextEager");
super.tearDown();
if (isCreateCamelContextPerClass()) {
// we tear down in after class
@@ -181,8 +191,8 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
/**
* Gets the bundle directives.
+ * <p/>
* Modify this method if you wish to add some directives.
- * @return
*/
protected String getBundleDirectives() {
return null;
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
new file mode 100644
index 0000000..1b16711
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
@@ -0,0 +1,42 @@
+/**
+ * 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.junit.Test;
+
+public class MockEndpointsAndSkipTest extends CamelBlueprintTestSupport {
+
+ @Override
+ public String isMockEndpointsAndSkip() {
+ return "seda*";
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
new file mode 100644
index 0000000..38be1b8
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:foo"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
new file mode 100644
index 0000000..d1bf95e
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class MockEndpointsAndSkipTest extends CamelSpringTestSupport {
+
+ @Override
+ protected AbstractApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml");
+ }
+
+ @Override
+ public String isMockEndpointsAndSkip() {
+ return "seda*";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/cb6ccacb/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
new file mode 100644
index 0000000..81b9093
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
@@ -0,0 +1,35 @@
+<?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"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:foo"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ </camelContext>
+
+</beans>
\ No newline at end of file
[2/4] git commit: Removed ehcache jms replication test due ehcache
upgrade no longer providing jms out of the box in main module.
Posted by da...@apache.org.
Removed ehcache jms replication test due ehcache upgrade no longer providing jms out of the box in main module.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8feaa4e7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8feaa4e7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8feaa4e7
Branch: refs/heads/master
Commit: 8feaa4e78ae263e880c4009f2c123f59c0026d86
Parents: cb6ccac
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 10 11:48:59 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 10 11:48:59 2013 +0200
----------------------------------------------------------------------
.../cache/replication/CacheReplicationTest.java | 75 -------------
.../replication/TestingCacheManagerFactory.java | 84 ---------------
.../replication/WrappedJMSCacheLoader.java | 106 -------------------
.../cache/replication/JMSReplicationCache1.xml | 75 -------------
.../cache/replication/JMSReplicationCache2.xml | 75 -------------
.../cache/replication/JMSReplicationCache3.xml | 75 -------------
.../replication/JMSReplicationCamelContext.xml | 100 -----------------
.../osgi/cache/replication/ehcache_jms_test.xml | 44 --------
8 files changed, 634 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/CacheReplicationTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/CacheReplicationTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/CacheReplicationTest.java
deleted file mode 100644
index a1bfaf3..0000000
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/CacheReplicationTest.java
+++ /dev/null
@@ -1,75 +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.itest.osgi.cache.replication;
-
-import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
-
-import static org.ops4j.pax.exam.CoreOptions.scanFeatures;
-import static org.ops4j.pax.exam.OptionUtils.combine;
-
-@RunWith(JUnit4TestRunner.class)
-@Ignore("Fix me")
-public class CacheReplicationTest extends OSGiIntegrationSpringTestSupport {
-
- @Override
- protected OsgiBundleXmlApplicationContext createApplicationContext() {
- return new OsgiBundleXmlApplicationContext(new String[]{
- "org/apache/camel/itest/osgi/cache/replication/JMSReplicationCamelContext.xml"});
- }
-
- @Test
- public void testCache() throws Exception {
- getMockEndpoint("mock:result1").expectedBodiesReceived("Am I replicated?");
- getMockEndpoint("mock:result2").expectedBodiesReceived("Am I replicated?");
-
- // do some routes to let everything be initialized
- template.sendBody("direct:getRoute1", "Let initialize the route");
- template.sendBody("direct:getRoute2", "Let initialize the route");
- template.sendBody("direct:addRoute", "Am I replicated?");
-
- // give some time to make replication
- Thread.sleep(300);
-
- template.sendBody("direct:getRoute1", "Will I get replicated cache");
- template.sendBody("direct:getRoute2", "Will I get replicated cache");
-
- assertMockEndpointsSatisfied();
- }
-
- @Configuration
- public static Option[] configure() throws Exception {
- Option[] options = combine(
- // Default karaf environment
- getDefaultCamelKarafOptions(),
- // using the features to install the camel components
- loadCamelFeatures("jetty", "camel-jms", "camel-cache"),
-
- // using the features to install AMQ
- scanFeatures("mvn:org.apache.activemq/activemq-karaf/5.5.0/xml/features",
- "activemq"));
-
- return options;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/TestingCacheManagerFactory.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/TestingCacheManagerFactory.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/TestingCacheManagerFactory.java
deleted file mode 100644
index b010f56..0000000
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/TestingCacheManagerFactory.java
+++ /dev/null
@@ -1,84 +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.itest.osgi.cache.replication;
-
-import java.io.InputStream;
-
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.distribution.jms.AcknowledgementMode;
-import net.sf.ehcache.distribution.jms.JMSCacheManagerPeerProvider;
-
-import org.apache.camel.component.cache.CacheManagerFactory;
-
-public class TestingCacheManagerFactory extends CacheManagerFactory {
- private String xmlName;
-
- //Only for testing purpose, normally not needed
- private CacheManager cacheManager;
-
- private Topic replicationTopic;
-
- private Queue getQueue;
-
- private TopicConnection replicationTopicConnection;
-
- private QueueConnection getQueueConnection;
-
- public TestingCacheManagerFactory(String xmlName,
- TopicConnection replicationTopicConnection, Topic replicationTopic,
- QueueConnection getQueueConnection, Queue getQueue) {
- this.xmlName = xmlName;
- this.replicationTopicConnection = replicationTopicConnection;
- this.replicationTopic = replicationTopic;
- this.getQueue = getQueue;
- this.getQueueConnection = getQueueConnection;
- }
-
- @Override
- protected synchronized CacheManager createCacheManagerInstance() {
- //Singleton- only for testing purpose, normally not needed
- if (cacheManager == null) {
- cacheManager = new WrappedCacheManager(getClass().getResourceAsStream(xmlName));
- }
-
- return cacheManager;
- }
-
- public CacheManager getCacheManager() {
- return cacheManager;
- }
-
- public class WrappedCacheManager extends CacheManager {
- public WrappedCacheManager(InputStream xmlConfig) {
- super(xmlConfig);
- JMSCacheManagerPeerProvider jmsCMPP = new JMSCacheManagerPeerProvider(this,
- replicationTopicConnection,
- replicationTopic,
- getQueueConnection,
- getQueue,
- AcknowledgementMode.AUTO_ACKNOWLEDGE,
- true);
- cacheManagerPeerProviders.put(jmsCMPP.getScheme(), jmsCMPP);
- jmsCMPP.init();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/WrappedJMSCacheLoader.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/WrappedJMSCacheLoader.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/WrappedJMSCacheLoader.java
deleted file mode 100644
index ebef96b..0000000
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/replication/WrappedJMSCacheLoader.java
+++ /dev/null
@@ -1,106 +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.itest.osgi.cache.replication;
-
-import java.util.Collection;
-import java.util.Map;
-
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-
-import net.sf.ehcache.CacheException;
-import net.sf.ehcache.Ehcache;
-import net.sf.ehcache.Status;
-import net.sf.ehcache.distribution.jms.AcknowledgementMode;
-import net.sf.ehcache.distribution.jms.JMSCacheLoader;
-import net.sf.ehcache.loader.CacheLoader;
-
-import org.apache.camel.component.cache.CacheLoaderWrapper;
-
-public class WrappedJMSCacheLoader implements CacheLoaderWrapper {
-
- private JMSCacheLoader jmsCacheLoader;
- private String defaultLoaderArgument = "";
- private QueueConnection getQueueConnection;
- private Queue getQueue;
- private AcknowledgementMode acknowledgementMode;
- private int timeoutMillis;
-
- public WrappedJMSCacheLoader(QueueConnection getQueueConnection,
- Queue getQueue, AcknowledgementMode acknowledgementMode,
- int timeoutMillis) {
- this.getQueueConnection = getQueueConnection;
- this.getQueue = getQueue;
- this.acknowledgementMode = acknowledgementMode;
- this.timeoutMillis = timeoutMillis;
- }
-
- @Override
- public CacheLoader clone(Ehcache arg0) throws CloneNotSupportedException {
- return jmsCacheLoader.clone(arg0);
- }
-
- @Override
- public void dispose() throws CacheException {
- jmsCacheLoader.dispose();
- }
-
- @Override
- public String getName() {
- return jmsCacheLoader.getName();
- }
-
- @Override
- public Status getStatus() {
- return jmsCacheLoader.getStatus();
- }
-
- @Override
- public void init() {
- jmsCacheLoader.init();
- }
-
- @Override
- public Object load(Object arg0) throws CacheException {
- return jmsCacheLoader.load(arg0);
- }
-
- @Override
- public Object load(Object arg0, Object arg1) {
- return jmsCacheLoader.load(arg0, arg1);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Map loadAll(Collection arg0) {
- return jmsCacheLoader.loadAll(arg0);
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Map loadAll(Collection arg0, Object arg1) {
- return jmsCacheLoader.loadAll(arg0, arg1);
- }
-
- @Override
- public void init(Ehcache cache) {
- jmsCacheLoader = new JMSCacheLoader(cache, defaultLoaderArgument,
- getQueueConnection, getQueue, acknowledgementMode,
- timeoutMillis);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache1.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache1.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache1.xml
deleted file mode 100644
index de1bfd8..0000000
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache1.xml
+++ /dev/null
@@ -1,75 +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"
- xmlns:camel="http://camel.apache.org/schema/spring"
- 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">
-
- <bean id="queueConnection1" factory-bean="amqCF" factory-method="createQueueConnection" class="javax.jms.QueueConnection" />
- <bean id="topicConnection1" factory-bean="amqCF" factory-method="createTopicConnection" class="javax.jms.TopicConnection" />
- <bean id="queue1" class="org.apache.activemq.command.ActiveMQQueue">
- <constructor-arg ref="getQueue" />
- </bean>
- <bean id="topic1" class="org.apache.activemq.command.ActiveMQTopic">
- <constructor-arg ref="getTopic" />
- </bean>
-
- <bean id="jmsListener1" class="net.sf.ehcache.distribution.jms.JMSCacheReplicator">
- <constructor-arg index="0" value="true" />
- <constructor-arg index="1" value="true" />
- <constructor-arg index="2" value="true" />
- <constructor-arg index="3" value="true" />
- <constructor-arg index="4" value="false" />
- <constructor-arg index="5" value="0" />
- </bean>
-
- <bean id="jmsLoader1" class="org.apache.camel.itest.osgi.cache.replication.WrappedJMSCacheLoader">
- <constructor-arg index="0" ref="queueConnection1" />
- <constructor-arg index="1" ref="queue1" />
- <constructor-arg index="2" value="AUTO_ACKNOWLEDGE" />
- <constructor-arg index="3" value="30000" />
- </bean>
-
- <bean id="cacheManagerFactory1" class="org.apache.camel.itest.osgi.cache.replication.TestingCacheManagerFactory">
- <constructor-arg index="0" value="ehcache_jms_test.xml" />
- <constructor-arg index="1" ref="topicConnection1" />
- <constructor-arg index="2" ref="topic1" />
- <constructor-arg index="3" ref="queueConnection1" />
- <constructor-arg index="4" ref="queue1" />
- </bean>
-
- <bean id="eventListenerRegistry1" class="org.apache.camel.component.cache.CacheEventListenerRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsListener1" />
- </list>
- </constructor-arg>
- </bean>
-
- <bean id="cacheLoaderRegistry1" class="org.apache.camel.component.cache.CacheLoaderRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsLoader1"/>
- </list>
- </constructor-arg>
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache2.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache2.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache2.xml
deleted file mode 100644
index 3a7bbd1..0000000
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache2.xml
+++ /dev/null
@@ -1,75 +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"
- xmlns:camel="http://camel.apache.org/schema/spring"
- 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">
-
- <bean id="queueConnection2" factory-bean="amqCF" factory-method="createQueueConnection" class="javax.jms.QueueConnection" />
- <bean id="topicConnection2" factory-bean="amqCF" factory-method="createTopicConnection" class="javax.jms.TopicConnection" />
- <bean id="queue2" class="org.apache.activemq.command.ActiveMQQueue">
- <constructor-arg ref="getQueue" />
- </bean>
- <bean id="topic2" class="org.apache.activemq.command.ActiveMQTopic">
- <constructor-arg ref="getTopic" />
- </bean>
-
- <bean id="jmsListener2" class="net.sf.ehcache.distribution.jms.JMSCacheReplicator">
- <constructor-arg index="0" value="true" />
- <constructor-arg index="1" value="true" />
- <constructor-arg index="2" value="true" />
- <constructor-arg index="3" value="true" />
- <constructor-arg index="4" value="false" />
- <constructor-arg index="5" value="0" />
- </bean>
-
- <bean id="jmsLoader2" class="org.apache.camel.itest.osgi.cache.replication.WrappedJMSCacheLoader">
- <constructor-arg index="0" ref="queueConnection2" />
- <constructor-arg index="1" ref="queue2" />
- <constructor-arg index="2" value="AUTO_ACKNOWLEDGE" />
- <constructor-arg index="3" value="30000" />
- </bean>
-
- <bean id="cacheManagerFactory2" class="org.apache.camel.itest.osgi.cache.replication.TestingCacheManagerFactory">
- <constructor-arg index="0" value="ehcache_jms_test.xml" />
- <constructor-arg index="1" ref="topicConnection2" />
- <constructor-arg index="2" ref="topic2" />
- <constructor-arg index="3" ref="queueConnection2" />
- <constructor-arg index="4" ref="queue2" />
- </bean>
-
- <bean id="eventListenerRegistry2" class="org.apache.camel.component.cache.CacheEventListenerRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsListener2" />
- </list>
- </constructor-arg>
- </bean>
-
- <bean id="cacheLoaderRegistry2" class="org.apache.camel.component.cache.CacheLoaderRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsLoader2"/>
- </list>
- </constructor-arg>
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache3.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache3.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache3.xml
deleted file mode 100644
index 78a7318..0000000
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCache3.xml
+++ /dev/null
@@ -1,75 +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"
- xmlns:camel="http://camel.apache.org/schema/spring"
- 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">
-
- <bean id="queueConnection3" factory-bean="amqCF" factory-method="createQueueConnection" class="javax.jms.QueueConnection" />
- <bean id="topicConnection3" factory-bean="amqCF" factory-method="createTopicConnection" class="javax.jms.TopicConnection" />
- <bean id="queue3" class="org.apache.activemq.command.ActiveMQQueue">
- <constructor-arg ref="getQueue" />
- </bean>
- <bean id="topic3" class="org.apache.activemq.command.ActiveMQTopic">
- <constructor-arg ref="getTopic" />
- </bean>
-
- <bean id="jmsListener3" class="net.sf.ehcache.distribution.jms.JMSCacheReplicator">
- <constructor-arg index="0" value="true" />
- <constructor-arg index="1" value="true" />
- <constructor-arg index="2" value="true" />
- <constructor-arg index="3" value="true" />
- <constructor-arg index="4" value="false" />
- <constructor-arg index="5" value="0" />
- </bean>
-
- <bean id="jmsLoader3" class="org.apache.camel.itest.osgi.cache.replication.WrappedJMSCacheLoader">
- <constructor-arg index="0" ref="queueConnection3" />
- <constructor-arg index="1" ref="queue3" />
- <constructor-arg index="2" value="AUTO_ACKNOWLEDGE" />
- <constructor-arg index="3" value="30000" />
- </bean>
-
- <bean id="cacheManagerFactory3" class="org.apache.camel.itest.osgi.cache.replication.TestingCacheManagerFactory">
- <constructor-arg index="0" value="ehcache_jms_test.xml" />
- <constructor-arg index="1" ref="topicConnection3" />
- <constructor-arg index="2" ref="topic3" />
- <constructor-arg index="3" ref="queueConnection3" />
- <constructor-arg index="4" ref="queue3" />
- </bean>
-
- <bean id="eventListenerRegistry3" class="org.apache.camel.component.cache.CacheEventListenerRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsListener3" />
- </list>
- </constructor-arg>
- </bean>
-
- <bean id="cacheLoaderRegistry3" class="org.apache.camel.component.cache.CacheLoaderRegistry">
- <constructor-arg>
- <list>
- <ref bean="jmsLoader3"/>
- </list>
- </constructor-arg>
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCamelContext.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCamelContext.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCamelContext.xml
deleted file mode 100644
index 06f7244..0000000
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/JMSReplicationCamelContext.xml
+++ /dev/null
@@ -1,100 +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"
- xmlns:camel="http://camel.apache.org/schema/spring"
- 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">
-
- <bean id="getQueue" class="java.lang.String">
- <constructor-arg value="replicationGetQueue" />
- </bean>
-
- <bean id="getTopic" class="java.lang.String">
- <constructor-arg value="replicationTopic" />
- </bean>
-
- <import resource="JMSReplicationCache1.xml"/>
- <import resource="JMSReplicationCache2.xml"/>
- <import resource="JMSReplicationCache3.xml"/>
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- <camel:endpoint id="fooCache1" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory1&eventListenerRegistry=#eventListenerRegistry1&cacheLoaderRegistry=#cacheLoaderRegistry1"/>
- <camel:endpoint id="fooCache2" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory2&eventListenerRegistry=#eventListenerRegistry2&cacheLoaderRegistry=#cacheLoaderRegistry2"/>
- <camel:endpoint id="fooCache3" uri="cache:foo?cacheManagerFactory=#cacheManagerFactory3&eventListenerRegistry=#eventListenerRegistry3&cacheLoaderRegistry=#cacheLoaderRegistry3"/>
-
- <camel:route>
- <camel:from uri="direct:addRoute"/>
- <camel:setHeader headerName="CamelCacheOperation">
- <camel:constant>CamelCacheAdd</camel:constant>
- </camel:setHeader>
- <camel:setHeader headerName="CamelCacheKey">
- <camel:constant>foo</camel:constant>
- </camel:setHeader>
- <camel:to ref="fooCache1"/>
- </camel:route>
-
- <camel:route>
- <camel:from uri="direct:getRoute1"/>
- <camel:setHeader headerName="CamelCacheOperation">
- <camel:constant>CamelCacheGet</camel:constant>
- </camel:setHeader>
- <camel:setHeader headerName="CamelCacheKey">
- <camel:constant>foo</camel:constant>
- </camel:setHeader>
- <camel:to ref="fooCache2"/>
- <camel:choice>
- <camel:when>
- <camel:simple>${in.header.CamelCacheElementWasFound} != null</camel:simple>
- <camel:to uri="mock:result1" />
- </camel:when>
- </camel:choice>
- </camel:route>
-
- <camel:route>
- <camel:from uri="direct:getRoute2"/>
- <camel:setHeader headerName="CamelCacheOperation">
- <camel:constant>CamelCacheGet</camel:constant>
- </camel:setHeader>
- <camel:setHeader headerName="CamelCacheKey">
- <camel:constant>foo</camel:constant>
- </camel:setHeader>
- <camel:to ref="fooCache3"/>
- <camel:choice>
- <camel:when>
- <camel:simple>${in.header.CamelCacheElementWasFound} != null</camel:simple>
- <camel:to uri="mock:result2" />
- </camel:when>
- </camel:choice>
- </camel:route>
-
- </camelContext>
-
- <bean id="amqCF" class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL" value="vm://localhost?broker.persistent=false"/>
- </bean>
-
- <bean id="activemq" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory">
- <ref bean="amqCF"/>
- </property>
- </bean>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/8feaa4e7/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/ehcache_jms_test.xml
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/ehcache_jms_test.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/ehcache_jms_test.xml
deleted file mode 100644
index a1543bd..0000000
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cache/replication/ehcache_jms_test.xml
+++ /dev/null
@@ -1,44 +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.
--->
-<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="ehcache.xsd" >
-
- <diskStore path="java.io.tmpdir"/>
-
- <cacheManagerEventListenerFactory class="" properties=""/>
-
- <!--
- Mandatory Default Cache configuration. These settings will be applied to caches
- created programmtically using CacheManager.add(String cacheName).
-
- The defaultCache has an implicit name "default" which is a reserved cache name.
- -->
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- overflowToDisk="true"
- diskSpoolBufferSizeMB="30"
- maxElementsOnDisk="10000000"
- diskPersistent="false"
- diskExpiryThreadIntervalSeconds="120"
- memoryStoreEvictionPolicy="LRU"
- />
-
-</ehcache>
[3/4] git commit: CAMEL-6536: Disabled tests so the code can compile.
Posted by da...@apache.org.
CAMEL-6536: Disabled tests so the code can compile.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d7956a24
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d7956a24
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d7956a24
Branch: refs/heads/master
Commit: d7956a246c44572ac2e1719cb19afabe99acf06d
Parents: 8feaa4e
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 10 12:02:15 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 10 12:02:15 2013 +0200
----------------------------------------------------------------------
.../camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java | 7 +++++--
.../apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/d7956a24/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java
index 7bdf465..05108bb 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreBlueprintRouteTest.java
@@ -24,7 +24,8 @@ import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.itest.osgi.blueprint.OSGiBlueprintTestSupport;
import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.BlobStoreContext;
-import org.jclouds.blobstore.BlobStoreContextFactory;
+// import org.jclouds.blobstore.BlobStoreContextFactory;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
@@ -38,6 +39,7 @@ import static org.ops4j.pax.exam.OptionUtils.combine;
import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
@RunWith(JUnit4TestRunner.class)
+@Ignore("See CAMEL-6536")
public class BlobStoreBlueprintRouteTest extends OSGiBlueprintTestSupport {
private static final String TEST_CONTAINER = "testContainer";
@@ -47,11 +49,12 @@ public class BlobStoreBlueprintRouteTest extends OSGiBlueprintTestSupport {
*/
@Override
protected void doPreSetup() throws Exception {
- BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
+/* BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
BlobStore blobStore = blobStoreContext.getBlobStore();
blobStore.createContainerInLocation(null, TEST_CONTAINER);
blobStore.clearContainer(TEST_CONTAINER);
+*/
}
@Test
http://git-wip-us.apache.org/repos/asf/camel/blob/d7956a24/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java
----------------------------------------------------------------------
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java
index b8278f8..3848dc9 100644
--- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jclouds/BlobStoreRouteTest.java
@@ -26,7 +26,8 @@ import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
import org.apache.camel.spring.SpringCamelContext;
import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.BlobStoreContext;
-import org.jclouds.blobstore.BlobStoreContextFactory;
+// import org.jclouds.blobstore.BlobStoreContextFactory;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
@@ -38,6 +39,7 @@ import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
import static org.ops4j.pax.exam.OptionUtils.combine;
@RunWith(JUnit4TestRunner.class)
+@Ignore("See CAMEL-6536")
public class BlobStoreRouteTest extends OSGiIntegrationTestSupport {
private static final String TEST_CONTAINER = "testContainer";
@@ -51,11 +53,12 @@ public class BlobStoreRouteTest extends OSGiIntegrationTestSupport {
*/
@Override
protected void doPreSetup() throws Exception {
- BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
+/* BlobStoreContextFactory contextFactory = new BlobStoreContextFactory();
BlobStoreContext blobStoreContext = contextFactory.createContext("transient", "identity", "credential");
BlobStore blobStore = blobStoreContext.getBlobStore();
blobStore.createContainerInLocation(null, TEST_CONTAINER);
blobStore.clearContainer(TEST_CONTAINER);
+*/
}
[4/4] git commit: CAME-6524: camel-test-blueprint - Using
isMockEndpointsAndSkip doesnt work
Posted by da...@apache.org.
CAME-6524: camel-test-blueprint - Using isMockEndpointsAndSkip doesnt work
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/82130fd4
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/82130fd4
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/82130fd4
Branch: refs/heads/camel-2.11.x
Commit: 82130fd49961d5ef84af55cdd1a025fe736ffc00
Parents: 81830bf
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Jul 10 07:59:04 2013 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Jul 10 12:03:10 2013 +0200
----------------------------------------------------------------------
.../camel/blueprint/BlueprintCamelContext.java | 29 ++++++++++--
.../core/osgi/OsgiCamelContextPublisher.java | 45 +++++++++++++------
.../blueprint/CamelBlueprintTestSupport.java | 12 ++++-
.../blueprint/MockEndpointsAndSkipTest.java | 42 ++++++++++++++++++
.../test/blueprint/MockEndpointsAndSkipTest.xml | 34 +++++++++++++++
.../test/issues/MockEndpointsAndSkipTest.java | 46 ++++++++++++++++++++
.../test/issues/MockEndpointsAndSkipTest.xml | 35 +++++++++++++++
7 files changed, 226 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
----------------------------------------------------------------------
diff --git a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
index 33798ec..82f27d7 100644
--- a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
+++ b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java
@@ -18,11 +18,13 @@ package org.apache.camel.blueprint;
import org.apache.camel.TypeConverter;
import org.apache.camel.core.osgi.OsgiCamelContextHelper;
+import org.apache.camel.core.osgi.OsgiCamelContextPublisher;
import org.apache.camel.core.osgi.OsgiFactoryFinderResolver;
import org.apache.camel.core.osgi.OsgiTypeConverter;
import org.apache.camel.core.osgi.utils.BundleContextUtils;
import org.apache.camel.core.osgi.utils.BundleDelegatingClassLoader;
import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spi.EventNotifier;
import org.apache.camel.spi.FactoryFinder;
import org.apache.camel.spi.Registry;
import org.apache.camel.util.ObjectHelper;
@@ -39,6 +41,9 @@ import org.osgi.service.cm.ConfigurationAdmin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+/**
+ * OSGi Blueprint based {@link CamelContext}.
+ */
public class BlueprintCamelContext extends DefaultCamelContext implements ServiceListener, BlueprintListener {
private static final transient Logger LOG = LoggerFactory.getLogger(BlueprintCamelContext.class);
@@ -167,8 +172,28 @@ public class BlueprintCamelContext extends DefaultCamelContext implements Servic
private void maybeStart() throws Exception {
LOG.trace("maybeStart: {}", this);
+
+ // allow to regsiter the BluerintCamelContext eager in the OSGi Service Registry, which ex is needed
+ // for unit testing with camel-test-blueprint
+ boolean eager = "true".equalsIgnoreCase(System.getProperty("registerBlueprintCamelContextEager"));
+ if (eager) {
+ for (EventNotifier notifer : getManagementStrategy().getEventNotifiers()) {
+ if (notifer instanceof OsgiCamelContextPublisher) {
+ OsgiCamelContextPublisher publisher = (OsgiCamelContextPublisher) notifer;
+ publisher.registerCamelContext(this);
+ break;
+ }
+ }
+ }
+
// for example from unit testing we want to start Camel later and not
// when blueprint loading the bundle
+ boolean skip = "true".equalsIgnoreCase(System.getProperty("skipStartingCamelContext"));
+ if (skip) {
+ LOG.trace("maybeStart: {} is skipping as System property skipStartingCamelContext is set", this);
+ return;
+ }
+
if (!isStarted() && !isStarting()) {
LOG.debug("Starting {}", this);
start();
@@ -176,8 +201,6 @@ public class BlueprintCamelContext extends DefaultCamelContext implements Servic
// ignore as Camel is already started
LOG.trace("Ignoring maybeStart() as {} is already started", this);
}
-
}
-
-
+
}
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
----------------------------------------------------------------------
diff --git a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
index b542d19..7c9ed17 100644
--- a/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
+++ b/components/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/OsgiCamelContextPublisher.java
@@ -24,11 +24,14 @@ import java.util.concurrent.ConcurrentHashMap;
import org.apache.camel.CamelContext;
import org.apache.camel.management.event.CamelContextStartedEvent;
+import org.apache.camel.management.event.CamelContextStartingEvent;
import org.apache.camel.management.event.CamelContextStoppingEvent;
import org.apache.camel.support.EventNotifierSupport;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.Version;
@@ -52,18 +55,7 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
public void notify(EventObject event) throws Exception {
if (event instanceof CamelContextStartedEvent) {
CamelContext context = ((CamelContextStartedEvent) event).getContext();
-
- Dictionary<String, Object > props = new Hashtable<String, Object>();
- props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
- props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
- props.put(CONTEXT_NAME_PROPERTY, context.getName());
-
- if (log.isDebugEnabled()) {
- log.debug("Registering CamelContext [{}] of in OSGi registry", context.getName());
- }
-
- ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(), context, props);
- registrations.put(context, reg);
+ registerCamelContext(context);
} else if (event instanceof CamelContextStoppingEvent) {
CamelContext context = ((CamelContextStoppingEvent) event).getContext();
ServiceRegistration reg = registrations.remove(context);
@@ -81,7 +73,10 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
}
public boolean isEnabled(EventObject event) {
- return true;
+ if (event instanceof CamelContextStartedEvent || event instanceof CamelContextStoppingEvent) {
+ return true;
+ }
+ return false;
}
@Override
@@ -97,9 +92,33 @@ public class OsgiCamelContextPublisher extends EventNotifierSupport {
registrations.clear();
}
+ public ServiceRegistration registerCamelContext(CamelContext camelContext) throws InvalidSyntaxException {
+ // avoid registering the same service again
+ ServiceReference[] refs = bundleContext.getServiceReferences(CamelContext.class.getName(), "(camel.context.symbolicname=" + bundleContext.getBundle().getSymbolicName() + ")");
+ if (refs == null) {
+ Dictionary<String, Object > props = new Hashtable<String, Object>();
+ props.put(CONTEXT_SYMBOLIC_NAME_PROPERTY, bundleContext.getBundle().getSymbolicName());
+ props.put(CONTEXT_VERSION_PROPERTY, getBundleVersion(bundleContext.getBundle()));
+ props.put(CONTEXT_NAME_PROPERTY, camelContext.getName());
+
+ if (log.isDebugEnabled()) {
+ log.debug("Registering CamelContext [{}] of in OSGi registry", camelContext.getName());
+ }
+
+ ServiceRegistration reg = bundleContext.registerService(CamelContext.class.getName(), camelContext, props);
+ if (reg != null) {
+ registrations.put(camelContext, reg);
+ }
+ return reg;
+ } else {
+ return null;
+ }
+ }
+
public static Version getBundleVersion(Bundle bundle) {
Dictionary<?, ?> headers = bundle.getHeaders();
String version = (String) headers.get(Constants.BUNDLE_VERSION);
return (version != null) ? Version.parseVersion(version) : Version.emptyVersion;
}
+
}
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
index bdbd45d..03c0a07 100644
--- a/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
+++ b/components/camel-test-blueprint/src/main/java/org/apache/camel/test/blueprint/CamelBlueprintTestSupport.java
@@ -101,6 +101,9 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
@Before
@Override
public void setUp() throws Exception {
+ System.setProperty("skipStartingCamelContext", "true");
+ System.setProperty("registerBlueprintCamelContextEager", "true");
+
String symbolicName = getClass().getSimpleName();
if (isCreateCamelContextPerClass()) {
// test is per class, so only setup once (the first time)
@@ -114,6 +117,11 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
}
super.setUp();
+
+ // start context when we are ready
+ log.debug("Staring CamelContext: {}", context.getName());
+ context.start();
+
// must wait for blueprint container to be published then the namespace parser is complete and we are ready for testing
log.debug("Waiting for BlueprintContainer to be published with symbolicName: {}", symbolicName);
getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=" + symbolicName + ")");
@@ -142,6 +150,8 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
@After
@Override
public void tearDown() throws Exception {
+ System.clearProperty("skipStartingCamelContext");
+ System.clearProperty("registerBlueprintCamelContextEager");
super.tearDown();
if (isCreateCamelContextPerClass()) {
// we tear down in after class
@@ -202,8 +212,8 @@ public abstract class CamelBlueprintTestSupport extends CamelTestSupport {
/**
* Gets the bundle directives.
+ * <p/>
* Modify this method if you wish to add some directives.
- * @return
*/
protected String getBundleDirectives() {
return null;
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
new file mode 100644
index 0000000..1b16711
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/java/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.java
@@ -0,0 +1,42 @@
+/**
+ * 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.junit.Test;
+
+public class MockEndpointsAndSkipTest extends CamelBlueprintTestSupport {
+
+ @Override
+ public String isMockEndpointsAndSkip() {
+ return "seda*";
+ }
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
new file mode 100644
index 0000000..38be1b8
--- /dev/null
+++ b/components/camel-test-blueprint/src/test/resources/org/apache/camel/test/blueprint/MockEndpointsAndSkipTest.xml
@@ -0,0 +1,34 @@
+<?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.
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:foo"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
+
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
new file mode 100644
index 0000000..d1bf95e
--- /dev/null
+++ b/components/camel-test-spring/src/test/java/org/apache/camel/test/issues/MockEndpointsAndSkipTest.java
@@ -0,0 +1,46 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.test.spring.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class MockEndpointsAndSkipTest extends CamelSpringTestSupport {
+
+ @Override
+ protected AbstractApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml");
+ }
+
+ @Override
+ public String isMockEndpointsAndSkip() {
+ return "seda*";
+ }
+
+ @Test
+ public void testHelloWorld() throws Exception {
+ getMockEndpoint("mock:seda:foo").expectedBodiesReceived("Hello World");
+
+ template.sendBody("direct:start", "Hello World");
+
+ assertMockEndpointsSatisfied();
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/82130fd4/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml b/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
new file mode 100644
index 0000000..81b9093
--- /dev/null
+++ b/components/camel-test-spring/src/test/resources/org/apache/camel/test/issues/MockEndpointsAndSkipTest.xml
@@ -0,0 +1,35 @@
+<?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"
+ xmlns:camel="http://camel.apache.org/schema/spring"
+ xsi:schemaLocation="
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
+
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+ <route>
+ <from uri="direct:start"/>
+ <to uri="log:foo"/>
+ <to uri="seda:foo"/>
+ </route>
+
+ </camelContext>
+
+</beans>
\ No newline at end of file