http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelMultiVersionBlueprintTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelMultiVersionBlueprintTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelMultiVersionBlueprintTest.java deleted file mode 100644 index b4f05c7..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/CamelMultiVersionBlueprintTest.java +++ /dev/null @@ -1,86 +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.blueprint; - -import org.apache.camel.CamelContext; -import org.apache.camel.Exchange; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.mock.MockEndpoint; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.tinybundles.core.TinyBundles; -import org.osgi.framework.Constants; -import org.osgi.service.blueprint.container.BlueprintContainer; - -import static org.ops4j.pax.exam.OptionUtils.combine; - -@RunWith(PaxExam.class) -public class CamelMultiVersionBlueprintTest extends OSGiBlueprintTestSupport { - - @Test - public void testFileRoute() throws Exception { - - getInstalledBundle("CamelBlueprintTestBundle1").start(); - getOsgiService(BlueprintContainer.class, "(osgi.blueprint.container.symbolicname=CamelBlueprintTestBundle1)", 10000); - CamelContext camelContext = getOsgiService(CamelContext.class, "(camel.context.symbolicname=CamelBlueprintTestBundle1)", 10000); - - // delete the data directory - deleteDirectory("target/data"); - - MockEndpoint mock = camelContext.getEndpoint("mock:result", MockEndpoint.class); - - mock.expectedBodiesReceived("Hello World"); - // should be moved to .camel when done - mock.expectedFileExists("target/data/.camel/hello.txt"); - - ProducerTemplate producerTemplate = camelContext.createProducerTemplate(); - - producerTemplate.start(); - - producerTemplate.sendBodyAndHeader("file:target/data", "Hello World", Exchange.FILE_NAME, "hello.txt"); - - producerTemplate.stop(); - - mock.assertIsSatisfied(); - } - - @Configuration - public static Option[] configure() throws Exception { - - Option[] options = combine( - getDefaultCamelKarafOptions(), - - scanFeatures(getCamelKarafFeatureUrl("2.8.0"), - "camel-core"), - - bundle(TinyBundles.bundle() - .add("OSGI-INF/blueprint/fileRoute.xml", OSGiBlueprintTestSupport.class.getResource("fileRouteBlueprint.xml")) - .set(Constants.BUNDLE_SYMBOLICNAME, "CamelBlueprintTestBundle1") - .build()).noStart(), - - // using the features to install the camel components - loadCamelFeatures("camel-blueprint", "camel-test") - - ); - return options; - } -}
http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/JsseUtilTester.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/JsseUtilTester.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/JsseUtilTester.java deleted file mode 100644 index 99aee72..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/JsseUtilTester.java +++ /dev/null @@ -1,36 +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.blueprint; - -import java.io.IOException; -import java.security.GeneralSecurityException; - -import javax.net.ssl.SSLContext; - -import org.apache.camel.util.jsse.SSLContextParameters; - -public class JsseUtilTester { - private SSLContext context; - - public JsseUtilTester(SSLContextParameters params) throws GeneralSecurityException, IOException { - context = params.createSSLContext(); - } - - public SSLContext getContext() { - return context; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyErrorBean.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyErrorBean.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyErrorBean.java deleted file mode 100644 index e90afda..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyErrorBean.java +++ /dev/null @@ -1,35 +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.blueprint; - -/** - * - */ -public class MyErrorBean { - - private int counter; - - public void doSomething(String body) { - counter++; - throw new IllegalArgumentException("Damn"); - } - - public int getCounter() { - return counter; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyException.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyException.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyException.java deleted file mode 100644 index 5311416..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MyException.java +++ /dev/null @@ -1,32 +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.blueprint; - -/** - * - */ -public class MyException extends Exception { - - private static final long serialVersionUID = 1L; - - public MyException() { - } - - public MyException(String s) { - super(s); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MySerialBean.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MySerialBean.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MySerialBean.java deleted file mode 100644 index c4651c1..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/MySerialBean.java +++ /dev/null @@ -1,45 +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.blueprint; - -import java.io.Serializable; - -/** - * - */ -public class MySerialBean implements Serializable { - - private static final long serialVersionUID = 1L; - private int id; - private String name; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java deleted file mode 100644 index 96a0fa0..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintHelloWorldTest.java +++ /dev/null @@ -1,88 +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.blueprint; - -import org.apache.camel.CamelContext; -import org.apache.camel.Exchange; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.mock.MockEndpoint; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.tinybundles.core.TinyBundles; -import org.osgi.framework.Constants; - -import static org.ops4j.pax.exam.OptionUtils.combine; - -/** - * @version - */ -@RunWith(PaxExam.class) -public class OSGiBlueprintHelloWorldTest extends OSGiBlueprintTestSupport { - - private static final String NAME = OSGiBlueprintHelloWorldTest.class.getName(); - - @Override - public void setUp() throws Exception { - deleteDirectory("target/paxrunner/target/foo"); - super.setUp(); - } - - @Test - public void testHelloWorld() throws Exception { - // start bundle - getInstalledBundle(NAME).start(); - - // must use the camel context from osgi - CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + NAME + ")", 10000); - - ProducerTemplate myTemplate = ctx.createProducerTemplate(); - myTemplate.start(); - - // do our testing - MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class); - mock.expectedMessageCount(1); - - myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME, "hello.txt"); - - mock.assertIsSatisfied(); - - myTemplate.stop(); - } - - @Configuration - public static Option[] configure() throws Exception { - - Option[] options = combine( - getDefaultCamelKarafOptions(), - - bundle(TinyBundles.bundle() - .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-13.xml")) - .set(Constants.BUNDLE_SYMBOLICNAME, NAME) - .build()).noStart(), - - // using the features to install the camel components - loadCamelFeatures("camel-blueprint")); - - return options; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintQuarz2SchedulerTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintQuarz2SchedulerTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintQuarz2SchedulerTest.java deleted file mode 100644 index 1b2c279..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintQuarz2SchedulerTest.java +++ /dev/null @@ -1,88 +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.blueprint; - -import org.apache.camel.CamelContext; -import org.apache.camel.Exchange; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.mock.MockEndpoint; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; -import org.ops4j.pax.tinybundles.core.TinyBundles; -import org.osgi.framework.Constants; - -import static org.ops4j.pax.exam.OptionUtils.combine; - -/** - * @version - */ -@RunWith(PaxExam.class) -public class OSGiBlueprintQuarz2SchedulerTest extends OSGiBlueprintTestSupport { - - private static final String NAME = OSGiBlueprintQuarz2SchedulerTest.class.getName(); - - @Override - public void setUp() throws Exception { - deleteDirectory("target/paxrunner/target/foo"); - super.setUp(); - } - - @Test - public void testQuartz2Scheduler() throws Exception { - // start bundle - getInstalledBundle(NAME).start(); - - // must use the camel context from osgi - CamelContext ctx = getOsgiService(CamelContext.class, "(camel.context.symbolicname=" + NAME + ")", 10000); - - MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class); - mock.expectedMessageCount(2); - - ProducerTemplate myTemplate = ctx.createProducerTemplate(); - myTemplate.start(); - - myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME, "hello.txt"); - myTemplate.sendBodyAndHeader("file:target/foo", "Bye World", Exchange.FILE_NAME, "bye.txt"); - - mock.assertIsSatisfied(); - - myTemplate.stop(); - } - - @Configuration - public static Option[] configure() throws Exception { - - Option[] options = combine( - getDefaultCamelKarafOptions(), - - bundle(TinyBundles.bundle() - .add("OSGI-INF/blueprint/test.xml", OSGiBlueprintTestSupport.class.getResource("blueprint-28.xml")) - .set(Constants.BUNDLE_SYMBOLICNAME, NAME) - .build()).noStart(), - - // using the features to install the camel components - loadCamelFeatures("camel-blueprint", "camel-quartz2")); - - return options; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java deleted file mode 100644 index 0be90bf..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java +++ /dev/null @@ -1,64 +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.blueprint; - -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import org.ops4j.pax.exam.options.UrlProvisionOption; -import org.ops4j.store.Store; -import org.ops4j.store.StoreFactory; - -/** - * Base class for OSGi blueprint tests. - */ -public abstract class OSGiBlueprintTestSupport extends AbstractIntegrationTest { - - protected static void copy(InputStream input, OutputStream output, boolean close) throws IOException { - try { - byte[] buf = new byte[8192]; - int bytesRead = input.read(buf); - while (bytesRead != -1) { - output.write(buf, 0, bytesRead); - bytesRead = input.read(buf); - } - output.flush(); - } finally { - if (close) { - close(input, output); - } - } - } - - protected static void close(Closeable... closeables) { - if (closeables != null) { - for (Closeable c : closeables) { - try { - c.close(); - } catch (IOException e) { - } - } - } - } - - protected static UrlProvisionOption bundle(final InputStream stream) throws IOException { - Store<InputStream> store = StoreFactory.defaultStore(); - return new UrlProvisionOption(store.getLocation(store.store(stream)).toURL().toExternalForm()); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestInterceptStrategy.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestInterceptStrategy.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestInterceptStrategy.java deleted file mode 100644 index 19a6c66..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestInterceptStrategy.java +++ /dev/null @@ -1,29 +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.blueprint; - -import org.apache.camel.CamelContext; -import org.apache.camel.Processor; -import org.apache.camel.model.ProcessorDefinition; -import org.apache.camel.spi.InterceptStrategy; - -public class TestInterceptStrategy implements InterceptStrategy { - - public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition, Processor target, Processor nextTarget) throws Exception { - return null; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProducer.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProducer.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProducer.java deleted file mode 100644 index 1d9df60..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProducer.java +++ /dev/null @@ -1,30 +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.blueprint; - -import org.apache.camel.EndpointInject; -import org.apache.camel.ProducerTemplate; - -public class TestProducer { - - @EndpointInject(ref = "testEndpoint") - private ProducerTemplate testEndpoint; - - public ProducerTemplate getTestEndpoint() { - return testEndpoint; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProxySender.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProxySender.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProxySender.java deleted file mode 100644 index ef63be4..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestProxySender.java +++ /dev/null @@ -1,32 +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.blueprint; - -import org.apache.camel.ExchangePattern; -import org.apache.camel.Pattern; - -/** - * @version - */ -public interface TestProxySender { - - String hello(String name); - - @Pattern(value = ExchangePattern.InOnly) - void greeting(String message); - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestRouteBuilder.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestRouteBuilder.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestRouteBuilder.java deleted file mode 100644 index 7545f5c..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/TestRouteBuilder.java +++ /dev/null @@ -1,30 +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.blueprint; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.processor.aggregate.UseLatestAggregationStrategy; - -public class TestRouteBuilder extends RouteBuilder { - - @Override - public void configure() throws Exception { - from("seda:foo") - .aggregate(constant("messageId"), new UseLatestAggregationStrategy()).completionTimeout(1000L). - to("seda:aggregated"); - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheManagerFactoryRefTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheManagerFactoryRefTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheManagerFactoryRefTest.java deleted file mode 100644 index f53efe7..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheManagerFactoryRefTest.java +++ /dev/null @@ -1,115 +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; - -import javax.naming.Context; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cache.CacheConstants; -import org.apache.camel.component.cache.CacheEndpoint; -import org.apache.camel.component.cache.CacheManagerFactory; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; - -import static org.ops4j.pax.exam.OptionUtils.combine; - - -@RunWith(PaxExam.class) -public class CacheManagerFactoryRefTest extends OSGiIntegrationTestSupport { - private static final String CACHE_URI = "cache:foo?cacheManagerFactory=#cacheManagerFactory"; - private TestingCacheManagerFactory cmfRef = new TestingCacheManagerFactory("ehcache_test.xml"); - - @Override - protected Context createJndiContext() throws Exception { - Context ctx = super.createJndiContext(); - ctx.bind("cacheManagerFactory", cmfRef); - return ctx; - } - - @Test - public void testCache() throws Exception { - CacheEndpoint endpoint = context.getEndpoint(CACHE_URI, CacheEndpoint.class); - - // do some routes to let everything be initialized - template.sendBody("direct:add", "Hello World"); - - // Is CacheManagerFactory really referenced? - CacheManagerFactory cmf = endpoint.getCacheManagerFactory(); - assertEquals("Cache Manager Factory Referenced", cmfRef, cmf); - - // Is the right ehcache_test.xml config. loaded? - Cache cache = cmfRef.getCacheManager().getCache("testingOne"); - assertNotNull("Is ehcache_test.xml loaded", cache); - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("direct:add") - .setHeader(CacheConstants.CACHE_OPERATION, constant(CacheConstants.CACHE_OPERATION_ADD)) - .setHeader(CacheConstants.CACHE_KEY, constant("foo")) - .to(CACHE_URI); - } - }; - } - - - - @Configuration - public static Option[] configure() { - Option[] options = combine( - getDefaultCamelKarafOptions(), - // using the features to install the other camel components - loadCamelFeatures("camel-cache")); - - return options; - } - - public class TestingCacheManagerFactory extends CacheManagerFactory { - private String xmlName; - - //Only for testing purpose, normally not needed - private CacheManager cacheManager; - - public TestingCacheManagerFactory(String xmlName) { - this.xmlName = xmlName; - } - - @Override - protected synchronized CacheManager createCacheManagerInstance() { - //Singleton- only for testing purpose, normally not needed - if (cacheManager == null) { - cacheManager = CacheManager.create(getClass().getResourceAsStream(xmlName)); - } - - return cacheManager; - } - - public CacheManager getCacheManager() { - return cacheManager; - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheRoutesManagementTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheRoutesManagementTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheRoutesManagementTest.java deleted file mode 100644 index 32fec5e..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheRoutesManagementTest.java +++ /dev/null @@ -1,131 +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; - -import javax.naming.Context; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Status; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cache.CacheConstants; -import org.apache.camel.component.cache.CacheManagerFactory; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; - -import static org.ops4j.pax.exam.OptionUtils.combine; - - -@RunWith(PaxExam.class) -public class CacheRoutesManagementTest extends OSGiIntegrationTestSupport { - private static final String CACHE_URI = "cache:foo?cacheManagerFactory=#cacheManagerFactory"; - private static final String ROUTE1_ID = "TEST_ROUTE_1"; - private static final String ROUTE2_ID = "TEST_ROUTE_2"; - private TestingCacheManagerFactory cmfRef = new TestingCacheManagerFactory("ehcache_test.xml"); - - @Override - protected Context createJndiContext() throws Exception { - Context ctx = super.createJndiContext(); - ctx.bind("cacheManagerFactory", cmfRef); - return ctx; - } - - @Test - public void testCache() throws Exception { - - // Now do some routes to let endpoints be initialized - template.sendBody("direct:add1", "Hello World"); - template.sendBody("direct:add2", "Hello World"); - - CacheManager cacheManager = cmfRef.getCacheManager(); - assertNotNull("CacheManager initialized", cacheManager); - - Cache cache = cmfRef.getCacheManager().getCache("foo"); - - // Is cache alive - assertEquals("Is cache still alive", Status.STATUS_ALIVE, cache.getStatus()); - - context.stopRoute(ROUTE1_ID); - - // Is cache still alive - assertEquals("Is cache still alive", Status.STATUS_ALIVE, cache.getStatus()); - - context.stop(); - - // Was the cache shutdowned with context? - assertEquals("Is cache still alive", Status.STATUS_SHUTDOWN, cache.getStatus()); - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("direct:add1") - .setHeader(CacheConstants.CACHE_OPERATION, constant(CacheConstants.CACHE_OPERATION_ADD)) - .setHeader(CacheConstants.CACHE_KEY, constant("foo")) - .to(CACHE_URI).setId(ROUTE1_ID); - - from("direct:add2") - .setHeader(CacheConstants.CACHE_OPERATION, constant(CacheConstants.CACHE_OPERATION_ADD)) - .setHeader(CacheConstants.CACHE_KEY, constant("foo")) - .to(CACHE_URI).setId(ROUTE2_ID); - } - }; - } - - - @Configuration - public static Option[] configure() { - Option[] options = combine( - getDefaultCamelKarafOptions(), - // using the features to install the other camel components - loadCamelFeatures("camel-cache")); - - return options; - } - - public class TestingCacheManagerFactory extends CacheManagerFactory { - private String xmlName; - - //Only for testing purpose, normally not needed - private CacheManager cacheManager; - - public TestingCacheManagerFactory(String xmlName) { - this.xmlName = xmlName; - } - - @Override - protected synchronized CacheManager createCacheManagerInstance() { - //Singleton- only for testing purpose, normally not needed - if (cacheManager == null) { - cacheManager = CacheManager.create(getClass().getResourceAsStream(xmlName)); - } - - return cacheManager; - } - - public CacheManager getCacheManager() { - return cacheManager; - } - } - -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheTest.java deleted file mode 100644 index a9bec7e..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cache/CacheTest.java +++ /dev/null @@ -1,73 +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; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.cache.CacheConstants; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.Configuration; -import org.ops4j.pax.exam.Option; -import org.ops4j.pax.exam.junit.PaxExam; - -import static org.ops4j.pax.exam.OptionUtils.combine; - -@RunWith(PaxExam.class) -public class CacheTest extends OSGiIntegrationTestSupport { - - @Test - public void testCache() throws Exception { - // add to cache first - template.sendBody("direct:add", "Hello World"); - - // then get from cache and assert - getMockEndpoint("mock:result").expectedBodiesReceived("Hello World"); - template.sendBody("direct:get", null); - assertMockEndpointsSatisfied(); - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("direct:add") - .setHeader(CacheConstants.CACHE_OPERATION, constant(CacheConstants.CACHE_OPERATION_ADD)) - .setHeader(CacheConstants.CACHE_KEY, constant("foo")) - .to("cache:foo"); - - from("direct:get") - .setHeader(CacheConstants.CACHE_OPERATION, constant(CacheConstants.CACHE_OPERATION_GET)) - .setHeader(CacheConstants.CACHE_KEY, constant("foo")) - .to("cache:foo") - .to("mock:result"); - } - }; - } - - - @Configuration - public static Option[] configure() { - Option[] options = combine( - getDefaultCamelKarafOptions(), - // using the features to install the other camel components - loadCamelFeatures("camel-cache")); - - return options; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/OsgiFactoryFinderTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/OsgiFactoryFinderTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/OsgiFactoryFinderTest.java deleted file mode 100644 index 3f64c06..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/OsgiFactoryFinderTest.java +++ /dev/null @@ -1,42 +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.core; - -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.spi.FactoryFinder; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class OsgiFactoryFinderTest extends OSGiIntegrationTestSupport { - - @Test - public void testFileProducer() throws Exception { - FactoryFinder finder = context.getFactoryFinder("META-INF/services/org/apache/camel/component/"); - Class<?> factory = finder.findClass("file", "strategy.factory."); - assertNotNull("We should find the factory here.", factory); - } - - @Before - public void setUp() throws Exception { - setUseRouteBuilder(false); - super.setUp(); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/TypeConverterLoaderTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/TypeConverterLoaderTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/TypeConverterLoaderTest.java deleted file mode 100644 index eca1894..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/TypeConverterLoaderTest.java +++ /dev/null @@ -1,41 +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.core; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.spi.FactoryFinder; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class TypeConverterLoaderTest extends OSGiIntegrationTestSupport { - - @Test - public void testFileProducer() throws Exception { - FactoryFinder finder = context.getFactoryFinder("META-INF/services/org/apache/camel/component/"); - Class<?> factory = finder.findClass("file", "strategy.factory."); - assertNotNull("We should find the factory here.", factory); - } - - @Before - public void setUp() throws Exception { - setUseRouteBuilder(false); - super.setUp(); - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/BeanRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/BeanRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/BeanRouteTest.java deleted file mode 100644 index 0b692ff..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/BeanRouteTest.java +++ /dev/null @@ -1,56 +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.core.bean; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.impl.JndiRegistry; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - - - -@RunWith(PaxExam.class) -public class BeanRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testBean() throws Exception { - getMockEndpoint("mock:result").expectedBodiesReceived("Hello World"); - - template.sendBody("direct:start", "World"); - - assertMockEndpointsSatisfied(); - } - - @Override - protected JndiRegistry createRegistry() throws Exception { - JndiRegistry jndi = super.createRegistry(); - jndi.bind("foo", new MyFooBean()); - return jndi; - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:start").to("bean:foo").to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/FooService.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/FooService.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/FooService.java deleted file mode 100644 index 852813e..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/FooService.java +++ /dev/null @@ -1,26 +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.core.bean; - -/** - * @version - */ -public interface FooService { - - String hello(String s); - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/MyFooBean.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/MyFooBean.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/MyFooBean.java deleted file mode 100644 index 7d38bb6..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/bean/MyFooBean.java +++ /dev/null @@ -1,33 +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.core.bean; - -/** - * @version - */ -public class MyFooBean implements FooService { - - public String hello(String s) { - return "Hello " + s; - } - - @Override - public String toString() { - return "MyFooBean"; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/browse/BrowseRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/browse/BrowseRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/browse/BrowseRouteTest.java deleted file mode 100644 index 10562c2..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/browse/BrowseRouteTest.java +++ /dev/null @@ -1,55 +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.core.browse; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.spi.BrowsableEndpoint; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class BrowseRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testBrowseRoute() throws Exception { - MockEndpoint mock = getMockEndpoint("mock:result"); - mock.expectedBodiesReceived("Hello World", "Bye World"); - - template.sendBody("direct:start", "Hello World"); - template.sendBody("direct:start", "Bye World"); - - assertMockEndpointsSatisfied(); - - BrowsableEndpoint list = context.getEndpoint("browse:foo", BrowsableEndpoint.class); - - mock.getExchanges().get(0).equals(list.getExchanges().get(0)); - mock.getExchanges().get(1).equals(list.getExchanges().get(1)); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:start").to("browse:foo").to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/clazz/ClassRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/clazz/ClassRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/clazz/ClassRouteTest.java deleted file mode 100644 index 3465d92..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/clazz/ClassRouteTest.java +++ /dev/null @@ -1,47 +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.core.clazz; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - - -@RunWith(PaxExam.class) -public class ClassRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testClass() throws Exception { - getMockEndpoint("mock:result").expectedBodiesReceived("Hello World"); - - template.sendBody("direct:start", "World"); - - assertMockEndpointsSatisfied(); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - from("direct:start").to("class:org.apache.camel.itest.osgi.core.bean.MyFooBean").to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/MySerialBean.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/MySerialBean.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/MySerialBean.java deleted file mode 100644 index 47ecefe..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/MySerialBean.java +++ /dev/null @@ -1,45 +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.core.dataformat; - -import java.io.Serializable; - -/** - * - */ -public class MySerialBean implements Serializable { - - private static final long serialVersionUID = 1L; - private int id; - private String name; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/SerializationDataFormatTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/SerializationDataFormatTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/SerializationDataFormatTest.java deleted file mode 100644 index ee87e49..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataformat/SerializationDataFormatTest.java +++ /dev/null @@ -1,59 +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.core.dataformat; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class SerializationDataFormatTest extends OSGiIntegrationTestSupport { - - @Test - public void testSerialization() throws Exception { - MySerialBean bean = new MySerialBean(); - bean.setId(123); - bean.setName("Donald"); - - Object data = template.requestBody("direct:marshal", bean); - assertNotNull(data); - - Object out = template.requestBody("direct:unmarshal", data); - assertNotNull(out); - - MySerialBean outBean = context.getTypeConverter().convertTo(MySerialBean.class, out); - assertNotNull(outBean); - assertEquals(123, outBean.getId()); - assertEquals("Donald", outBean.getName()); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - from("direct:unmarshal") - .unmarshal().serialization(); - - from("direct:marshal") - .marshal().serialization(); - } - }; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataset/DataSetRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataset/DataSetRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataset/DataSetRouteTest.java deleted file mode 100644 index 2e8b910..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/dataset/DataSetRouteTest.java +++ /dev/null @@ -1,59 +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.core.dataset; - -import javax.naming.Context; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.dataset.SimpleDataSet; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - - -@RunWith(PaxExam.class) -public class DataSetRouteTest extends OSGiIntegrationTestSupport { - - protected SimpleDataSet dataSet = new SimpleDataSet(20); - - @Test - public void testDataSet() throws Exception { - // data set will itself set its assertions so we should just - // assert that all mocks is ok - assertMockEndpointsSatisfied(); - } - - @Override - protected Context createJndiContext() throws Exception { - Context context = super.createJndiContext(); - context.bind("foo", dataSet); - return context; - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - public void configure() throws Exception { - // start this first to make sure the "direct:foo" consumer is ready - from("direct:foo").to("dataset:foo?minRate=50"); - from("dataset:foo?minRate=50").to("direct:foo"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/direct/DirectTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/direct/DirectTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/direct/DirectTest.java deleted file mode 100644 index a24bcd9..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/direct/DirectTest.java +++ /dev/null @@ -1,48 +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.core.direct; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class DirectTest extends OSGiIntegrationTestSupport { - - @Test - public void testSendMessage() throws Exception { - MockEndpoint mock = getMandatoryEndpoint("mock:result", MockEndpoint.class); - assertNotNull("The mock endpoint should not be null", mock); - - mock.expectedBodiesReceived("Hello World"); - template.sendBody("direct:start", "Hello World"); - assertMockEndpointsSatisfied(); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - from("direct:start").to("mock:result"); - } - }; - } -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileComponentTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileComponentTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileComponentTest.java deleted file mode 100644 index a1a2db7..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileComponentTest.java +++ /dev/null @@ -1,47 +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.core.file; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class FileComponentTest extends OSGiIntegrationTestSupport { - - @Test - public void testFileProducer() throws Exception { - deleteDirectory("myfile"); - MockEndpoint result = getMockEndpoint("mock:test"); - result.expectedMessageCount(1); - template.sendBody("direct:simple", "Hello"); - assertMockEndpointsSatisfied(); - } - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("direct:simple").to("file:myfile"); - from("file:myfile").to("mock:test"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteDelayTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteDelayTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteDelayTest.java deleted file mode 100644 index 891ce60..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteDelayTest.java +++ /dev/null @@ -1,66 +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.core.file; - -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.apache.camel.util.StopWatch; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class FileRouteDelayTest extends OSGiIntegrationTestSupport { - - @Test - public void testFileRouteDelay() throws Exception { - MockEndpoint mock = getMockEndpoint("mock:result"); - mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World"); - // should be moved to .camel when done - mock.expectedFileExists("target/data/.camel/hello.txt"); - mock.expectedFileExists("target/data/.camel/bye.txt"); - - StopWatch watch = new StopWatch(); - - template.sendBodyAndHeader("file:target/data", "Hello World", Exchange.FILE_NAME, "hello.txt"); - - Thread.sleep(3000); - - template.sendBodyAndHeader("file:target/data", "Bye World", Exchange.FILE_NAME, "bye.txt"); - - assertMockEndpointsSatisfied(); - - long delta = watch.stop(); - assertTrue("Should take 6 sec or longer, was " + delta, delta > 5500); - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - // delete the data directory - deleteDirectory("target/data"); - - from("file:target/data?delay=6000").convertBodyTo(String.class).to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteTest.java deleted file mode 100644 index d2387a5..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/file/FileRouteTest.java +++ /dev/null @@ -1,55 +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.core.file; - -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class FileRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testFileRoute() throws Exception { - MockEndpoint mock = getMockEndpoint("mock:result"); - mock.expectedBodiesReceived("Hello World"); - // should be moved to .camel when done - mock.expectedFileExists("target/data/.camel/hello.txt"); - - template.sendBodyAndHeader("file:target/data", "Hello World", Exchange.FILE_NAME, "hello.txt"); - - assertMockEndpointsSatisfied(); - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - // delete the data directory - deleteDirectory("target/data"); - - from("file:target/data").convertBodyTo(String.class).to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/LanguageRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/LanguageRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/LanguageRouteTest.java deleted file mode 100644 index 7caed99..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/LanguageRouteTest.java +++ /dev/null @@ -1,48 +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.core.language; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class LanguageRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testLanguage() throws Exception { - getMockEndpoint("mock:result").expectedBodiesReceived("Hello World"); - - template.sendBody("direct:start", "World"); - - assertMockEndpointsSatisfied(); - } - - @Override - protected RouteBuilder createRouteBuilder() throws Exception { - return new RouteBuilder() { - @Override - public void configure() throws Exception { - from("direct:start").to("language:simple:Hello ${body}").to("mock:result"); - } - }; - } - - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/SimpleTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/SimpleTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/SimpleTest.java deleted file mode 100644 index ce19e04..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/language/SimpleTest.java +++ /dev/null @@ -1,47 +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.core.language; - -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.mock.MockEndpoint; -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - - -@RunWith(PaxExam.class) -public class SimpleTest extends OSGiIntegrationTestSupport { - - @Test - public void testSimpleLanguage() throws Exception { - MockEndpoint result = getMockEndpoint("mock:result"); - result.expectedBodiesReceived("Hello IS processed!"); - template.sendBody("direct:simple", "Hello"); - result.assertIsSatisfied(); - } - - - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - from("direct:simple").setBody().simple("${body} IS processed!").to("mock:result"); - } - }; - } - -} http://git-wip-us.apache.org/repos/asf/camel/blob/6b77d012/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java ---------------------------------------------------------------------- diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java deleted file mode 100644 index 40718af..0000000 --- a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/core/log/LogRouteTest.java +++ /dev/null @@ -1,58 +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.core.log; - -import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.ops4j.pax.exam.junit.PaxExam; - -@RunWith(PaxExam.class) -public class LogRouteTest extends OSGiIntegrationTestSupport { - - @Test - public void testSendMessageToLog() throws Exception { - template.sendBody("log:org.apache.camel.TEST", "<level>default</level>"); - } - - @Test - public void testSendMessageToInfoLog() throws Exception { - template.sendBody("log:org.apache.camel.TEST?level=INFO", "<level>INFO</level>"); - } - - @Test - public void testSendMessageToWarnLog() throws Exception { - template.sendBody("log:org.apache.camel.TEST?level=warn", "<level>WARN</level>"); - } - - @Test - public void testSendMessageToBadLevel() throws Exception { - try { - template.sendBody("log:org.apache.camel.TEST?level=noSuchLevel", "<level>noSuchLevel</level>"); - fail("Should have failed!"); - } catch (Exception e) { - LOG.debug("Caught the expected exception: {}", e); - } - } - - @Override - public boolean isUseRouteBuilder() { - return false; - } - - -}