Unfortunately, making the template variable protected static breaks in
Scala.

See:
http://stackoverflow.com/questions/4445617/calling-a-protected-static-java-method-from-scala

Is there a way to make this Scala compatible while still reaping the
performance benefits?



On Thu, Jul 14, 2011 at 3:06 PM, Richard Kettelerij <
richardkettele...@gmail.com> wrote:

> The only change I can spot between 2.7 and 2.8 concerning the template
> variable is that in 2.8 the template variable is made "static". This is the
> result of https://issues.apache.org/jira/browse/CAMEL-3960. But
> referencing
> a protected static variable in a superclass from a method in a child class
> shouldn't be a problem.
>
> Take a look at the Camel unit tests, the template variable is referenced
> all
> the time.
>
> On Thu, Jul 14, 2011 at 8:21 PM, Tommy Chheng <tommy.chh...@gmail.com
> >wrote:
>
> > I'm testing the latest 2.8.0 on my current application.
> >
> > In Camel 2.7.2, I was able to reference template when I extend
> > CamelTestSupport
> > class PublishRequestTest extends CamelTestSupport{
> >  @Test
> >  def testValidRequest{
> >    val mock = getMockEndpoint("mock:output")
> >
> >    val message = """{"username":"bob","permalink":"perma"}"""
> >    template.sendBody("seda:input", message)
> >
> > In Camel 2.8.0, I get a template value missing error:
> >
> > [ERROR] PublishRequestTest.scala:18: error: not found: value template
> > [INFO]     template.sendBody("seda:input", message)
> >
> >
> > Is this the expected behavior? If so, how should i reference a template
> > object in a test environment?
> >
> >
> > --
> > @tommychheng
> > http://tommy.chheng.com
> >
>



-- 
@tommychheng
http://tommy.chheng.com

Reply via email to