Author: ningjiang Date: Fri Aug 6 07:35:10 2010 New Revision: 982897 URL: http://svn.apache.org/viewvc?rev=982897&view=rev Log: CAMEL-3030 added an osgi test for it
Added: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/header.vm Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/example.vm Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java?rev=982897&r1=982896&r2=982897&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java Fri Aug 6 07:35:10 2010 @@ -43,8 +43,8 @@ public class VelocityTest extends OSGiIn @Test public void testReceivesResponse() throws Exception { - assertRespondsWith("foo", "<hello>foo</hello>"); - assertRespondsWith("bar", "<hello>bar</hello>"); + assertRespondsWith("foo", "<header>foo</header><hello>foo</hello>"); + assertRespondsWith("bar", "<header>bar</header><hello>bar</hello>"); } protected void assertRespondsWith(final String value, String expectedBody) throws InvalidPayloadException { @@ -61,6 +61,8 @@ public class VelocityTest extends OSGiIn protected RouteBuilder createRouteBuilder() { return new RouteBuilder() { public void configure() { + // need to update the CCL to current bundle's as it could be no defined + Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); // START SNIPPET: example from("direct:a"). to("velocity:org/apache/camel/itest/osgi/example.vm"); Modified: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/example.vm URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/example.vm?rev=982897&r1=982896&r2=982897&view=diff ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/example.vm (original) +++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/example.vm Fri Aug 6 07:35:10 2010 @@ -14,4 +14,5 @@ ## See the License for the specific language governing permissions and ## limitations under the License. ## ------------------------------------------------------------------------ +#parse("org/apache/camel/itest/osgi/header.vm") <hello>${headers.cheese}</hello> \ No newline at end of file Added: camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/header.vm URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/header.vm?rev=982897&view=auto ============================================================================== --- camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/header.vm (added) +++ camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/header.vm Fri Aug 6 07:35:10 2010 @@ -0,0 +1,17 @@ +## ------------------------------------------------------------------------ +## 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. +## ------------------------------------------------------------------------ +<header>${headers.cheese}</header> \ No newline at end of file