Testing Route in camel-quarkus

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Testing Route in camel-quarkus

dennisholu
Hello,

is it possible to test a non-http route in camel-quarkus like we do
with CamelTestSupport in camel?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Testing Route in camel-quarkus

dennisholu
I could create a quarkus test where the route is injected and external
endpoint is mocked with quarkus mock support.

Am Fr., 20. März 2020 um 11:52 Uhr schrieb Dennis Holunder
<[hidden email]>:
>
> Hello,
>
> is it possible to test a non-http route in camel-quarkus like we do
> with CamelTestSupport in camel?
>
> Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Testing Route in camel-quarkus

Alex Dettinger
Hi Dennis,

  Interesting idea, this may work in jvm mode and would need to be excluded
when executing @NativeImageTest.
You may also be able to inject a ProducerTemplate in the test to feed the
route directly.

Alex

On Wed, Mar 25, 2020 at 7:55 AM Dennis Holunder <[hidden email]>
wrote:

> I could create a quarkus test where the route is injected and external
> endpoint is mocked with quarkus mock support.
>
> Am Fr., 20. März 2020 um 11:52 Uhr schrieb Dennis Holunder
> <[hidden email]>:
> >
> > Hello,
> >
> > is it possible to test a non-http route in camel-quarkus like we do
> > with CamelTestSupport in camel?
> >
> > Thanks!
>
Reply | Threaded
Open this post in threaded view
|

Re: Testing Route in camel-quarkus

dennisholu
thanks, works fine except logging:

quarkus.log.file.enable = true
quarkus.log.file.path = log/myquarkus.log
quarkus.log.console.enable = true

When running tests from IDE there is no console log and empty
target/quarkus.log file is created instead of log/myquarkus.log as in
defined in config.
When running tests from command line there is console log and
target/quarkus.log file is populated with logs.
When running the application, the config from
src/main/resources/application.properties is picked up, but stored in
target/log/ directory.

In summary, log configuration in
src/test/resources/application.properties is ignored and working dir
is apparently target

Am Mi., 25. März 2020 um 09:19 Uhr schrieb Alex Dettinger [via Camel]
<[hidden email]>:

>
> Hi Dennis,
>
>   Interesting idea, this may work in jvm mode and would need to be excluded
> when executing @NativeImageTest.
> You may also be able to inject a ProducerTemplate in the test to feed the
> route directly.
>
> Alex
>
> On Wed, Mar 25, 2020 at 7:55 AM Dennis Holunder <[hidden email]>
> wrote:
>
> > I could create a quarkus test where the route is injected and external
> > endpoint is mocked with quarkus mock support.
> >
> > Am Fr., 20. März 2020 um 11:52 Uhr schrieb Dennis Holunder
> > <[hidden email]>:
> > >
> > > Hello,
> > >
> > > is it possible to test a non-http route in camel-quarkus like we do
> > > with CamelTestSupport in camel?
> > >
> > > Thanks!
> >
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> https://camel.465427.n5.nabble.com/Testing-Route-in-camel-quarkus-tp5860291p5861032.html
> To unsubscribe from Camel, click here.
> NAML
Reply | Threaded
Open this post in threaded view
|

Re: Testing Route in camel-quarkus

Alex Dettinger
Looking at the effective pom of a quarkus project, it looks that the
maven-surefire-plugin has some config related to logs:
<artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <systemProperties>

<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              </systemProperties>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <systemProperties>

<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
          </systemProperties>

So maybe, you just need to do the same kind of configuration within your
IDE test configuration.

Also, would you have wishes, experiments, contributions there is a ticket
related to camel-quarkus tests:
https://github.com/apache/camel-quarkus/issues/457.

On Wed, Mar 25, 2020 at 4:10 PM Dennis Holunder <[hidden email]>
wrote:

> thanks, works fine except logging:
>
> quarkus.log.file.enable = true
> quarkus.log.file.path = log/myquarkus.log
> quarkus.log.console.enable = true
>
> When running tests from IDE there is no console log and empty
> target/quarkus.log file is created instead of log/myquarkus.log as in
> defined in config.
> When running tests from command line there is console log and
> target/quarkus.log file is populated with logs.
> When running the application, the config from
> src/main/resources/application.properties is picked up, but stored in
> target/log/ directory.
>
> In summary, log configuration in
> src/test/resources/application.properties is ignored and working dir
> is apparently target
>
> Am Mi., 25. März 2020 um 09:19 Uhr schrieb Alex Dettinger [via Camel]
> <[hidden email]>:
> >
> > Hi Dennis,
> >
> >   Interesting idea, this may work in jvm mode and would need to be
> excluded
> > when executing @NativeImageTest.
> > You may also be able to inject a ProducerTemplate in the test to feed the
> > route directly.
> >
> > Alex
> >
> > On Wed, Mar 25, 2020 at 7:55 AM Dennis Holunder <[hidden email]>
> > wrote:
> >
> > > I could create a quarkus test where the route is injected and external
> > > endpoint is mocked with quarkus mock support.
> > >
> > > Am Fr., 20. März 2020 um 11:52 Uhr schrieb Dennis Holunder
> > > <[hidden email]>:
> > > >
> > > > Hello,
> > > >
> > > > is it possible to test a non-http route in camel-quarkus like we do
> > > > with CamelTestSupport in camel?
> > > >
> > > > Thanks!
> > >
> >
> >
> > ________________________________
> > If you reply to this email, your message will be added to the discussion
> below:
> >
> https://camel.465427.n5.nabble.com/Testing-Route-in-camel-quarkus-tp5860291p5861032.html
> > To unsubscribe from Camel, click here.
> > NAML
>