camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Is Spring ActiveProfiles annotation supported in camel test 2.10?
Date Mon, 22 Oct 2012 09:20:59 GMT
Hi

Have you tried using the JUnit instead of TestNG? eg camel-test-spring.


On Wed, Oct 17, 2012 at 12:23 AM, jiunjiunma <jiunjiunma@gmail.com> wrote:
> Hi,
>     I am trying to use Spring 3.1's ActiveProfiles feature to start an
> embedded activemq in my test context. However, it  doesn't seem the profile
> was chosen since the embedded broker was never created. I am using Spring
> 3.1.2 with Camel 2.10 and using testng.
>
> Here is the snippet of my application context:
>
>
>
>     <beans profile="test">
>         <broker:broker useJmx="false" persistent="false"
> brokerName="localhost">
>             <broker:transportConnectors>
>                 <broker:transportConnector name="tcp"
> uri="tcp://localhost:61616"/>
>             </broker:transportConnectors>
>         </broker:broker>
>
>         <bean id="jmsConnectionFactory"
>                class="org.apache.activemq.ActiveMQConnectionFactory">
>                <property name="brokerURL" value="tcp://localhost:61616" />
>         </bean>
>     </beans>
>
>     <beans profile="production">
>         <bean id="jmsConnectionFactory"
>               class="org.apache.activemq.ActiveMQConnectionFactory">
>             <property name="brokerURL" value="tcp://localhost:61616" />
>         </bean>
>     </beans>
>
>
> My test looks liks this:
>
> @ContextConfiguration(locations={
>     "classpath:config/applicationContext.xml"})
> @ActiveProfiles("test")
> public class SimpleApplicationTest extends
> AbstractCamelTestNGSpringContextTests {
>     @Autowired
>     protected CamelContext camelContext;
> ...
> }
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Is-Spring-ActiveProfiles-annotation-supported-in-camel-test-2-10-tp5721145.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message