One option would be to put the definition of your bean in one XML file and the 
route in another.  You can have the production version of the supporting beans 
in src/main/resources/OSGI-INF/blueprint, and the test versions in 
src/test/resources/OSGI-INF/blueprint.  That’s not a great solution because you 
have to update two files (the prod one and the test one) if something 
significant changes, but it’s simple.

The other option that comes to mind would be to use maven filtering to process 
the XML file.  You could specify different class name in maven profiles.

> On Jan 30, 2016, at 1:19 PM, Ranx <brad.john...@mediadriver.com> wrote:
> 
> I'm currently creating test stubs for use with my blueprint tests and for use
> in deployment and testing.  I've tried various methods with varying degrees
> of luck.
> 
> Is there a way to substitute a class name at start up?  I could create a
> factory class to do a class for name on it but would prefer to use standard
> mechanisms.
> 
> <bean id="supplierServiceImpl" class="${serviceImpl}" />
> 
> In my camel context if I use this it works fine:
>               <route id="GetSuppliers">
>                       <from uri="{{suppliers.info.endpoint}}" />
>                       <to uri="class:{{serviceImpl}}?method=getSuppliers" />
>               </route>
> 
> And if I use this in the preamble section above the context it works fine:
> <cxf:rsServer id=&quot;cxfRsServer&quot;
> address=&quot;${CXFServer}:${proxy.port}/resources&quot;
> 
> So the properties are getting passed in but it doesn't like using the class
> substitution.  I even tried wild swings like &lt;bean
> id=&quot;supplierServiceImpl&quot; class=&quot;class:${serviceImpl}&quot;
> />.  But at that point I'm just guessing.
> 
> Any help is appreciated.
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Class-substitution-in-bean-tp5777061.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to