5 Replies Latest reply on Sep 15, 2015 7:04 AM by grgrzybek

    missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport

    scotta64

      Hi all - I've created a couple of simple routes as follows

       

      /* Listener */

      from("cxfrs:bean:canonService?bindingStyle=SimpleConsumer")

      .log("GOT A REQUEST, ADDING TO QUEUE")

      .to("direct:incomingRequestQueue");

       

      /* Processor */

      from("direct:incomingRequestQueue")

      .log("PROCESSOR GET REQUEST FROM QUEUE")

      .process(new Processor() {*** bunch of code here***})

      .log("PROCESSOR DONE PROCESSING REQUEST");

       

      I have a number of tests written using CamelBlueprintTestSupport with methods that test just the Processor route by sending a message to the "direct:incomingRequestQueue" and which also test the Listener route (and thus, presumably the Processor route as well) by sending a message to the "cxfrs:bean..." endpoint.  Whenever I run a Maven task that executes my tests, the tests hang with the following message appearing in the log

       

      BlueprintContainerImpl Bundle TestCanonRoute/1.0.0 is waiting for dependencies [(&(component=cxfrs)(objectClass=org.apache.camel.spi.ComponentResolver))]

       

      and eventually the test times out and fails.  The project pom.xml and blueprint.xml files are attached.  Since I do have a <dependency> entry for camel-core (which contains the class org.apache.camel.spi.ComponentResolver) and one for camel-cxf (which contains a camel.osgi.export.service property for org.apache.camel.spi.ComponentResolver;component=cxfrs), near as I can tell, I've got everything mentioned in the waiting for message and shouldn't have to wait for anything.  Whats more, if remove my cxf route test classes from my project source, everything works great, the bundle gets built, deploys successfully and the cxf listener route does in fact start up.  Which also leads me to believe I've got all the dependencies I need to cxfrs work, at least within the context of a container.  So I guess I'm missing something at test time the container provides ... but what?

       

      FWIW, I've already found this discussion here which is sort of addressing a similar issue re: testing CXF with the CamelBlueprintTestSupport.  Accordingly, I have added a dependency for asm-all v4.0 to the test scope.  That did resolve some other issues w/my tests, but has left me with this current vexing problem which I'm sure is addressed by adding some test scoped dependency to my pom ... but which one?

        • 1. Re: missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport
          grgrzybek

          Hello Scott

           

          If you use Fuse, then please check https://issues.jboss.org/browse/ENTESB-1564 issue. In Camel community version 2.16, CamelBlueprintTestSupport has switched from PojoSR to Felix-Connect lib. This is also backported to Fuse version of Camel (camel-2.15.1.redhat-xxx versions). ENTESB-1564 (and related issues) describe the problem.

           

          It'd help me reproduce your problem if you could attach entire test project (or github link).

           

          Also I remember that ASM version should be at 5.0.3.

           

          regards

          Grzegorz Grzybek

          • 2. Re: missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport
            scotta64

            Grzegorz, thx for your reply.  To your points

             

            "...ENTESB-1564 (and related issues) describe the problem" - unfortunately, we're running JBoss Fuse 6.1.0-379 in production here.  The fix for the reference is fixed in 6.2.1, so it's probably not gonna do me much good right now.  Further, the error identified in the issue appears to be occurring when the route attempts to start and can't find a particular component.  In my case, the route isn't even trying to start 'cause it thinks it's still waiting for the cxfrs dependency.

             

            "It'd help me reproduce your problem if you could attach entire test project" - OK, attached here

             

            "ASM version should be at 5.0.3" - when I upgrade my POM to use 5.0.3, the tests hang forever, no output at all.  4.0 ASM as used in the attached project works.  Perhaps I can only use 5.0.3 w/a later version of the camel-test-blueprint than 2.12.0.redhat-610379?

            • 3. Re: missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport
              grgrzybek

              Thanks for clarification - I spent too much time recently working on Fuse 6.2, so I thought you were using this version.

               

              Of course with Fuse 6.1.GA, ASM 5.0.3 is not an option.

              DId you try patching 6.1.0.redhat-379 with newer patches?

               

              regards

              Grzegorz Grzybek

               

              p.s. I'll check your example

              • 4. Re: missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport
                scotta64

                Well yeah ... but I think I've screwed up the patch install, tried to put 6.1 Rollup2 Patch6 w/o installing the baseline 6.1 Rollup2.  My fault for not following patch instructions carefully .  Anyway, I'll try again from a clean install and let you know.  Appreciate your looking at my code in the meantime, thx.

                • 5. Re: missing dependency testing cxfrs endpoint with CamelBlueprintTestSupport
                  grgrzybek

                  Hello Scott

                   

                  I've run all your tests without problems:

                  $ mvn test
                  [INFO] Scanning for projects...
                  [INFO]                                                                         
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Building TrinityHealth :: ESB :: Canonical 0.0.1-SNAPSHOT (1/1)
                  [INFO] ------------------------------------------------------------------------
                  [INFO] 
                  [INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ consolidate_canonical ---
                  [INFO] Using 'UTF-8' encoding to copy filtered resources.
                  [INFO] Copying 1 resource
                  [INFO] 
                  [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ consolidate_canonical ---
                  [INFO] Nothing to compile - all classes are up to date
                  [INFO] 
                  [INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ consolidate_canonical ---
                  [INFO] Using 'UTF-8' encoding to copy filtered resources.
                  [INFO] Copying 0 resource
                  [INFO] 
                  [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ consolidate_canonical ---
                  [INFO] Nothing to compile - all classes are up to date
                  [INFO] 
                  [INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ consolidate_canonical ---
                  [INFO] Surefire report directory: /data/ggrzybek/sources/_customer/forum-939607/consolidated_canonical/target/surefire-reports
                  
                  -------------------------------------------------------
                   T E S T S
                  -------------------------------------------------------
                  Running org.trinityhealth.example.canon.TestCanonRoute
                  log4j:WARN No appenders could be found for logger (org.ops4j.store.intern.TemporaryStore).
                  log4j:WARN Please initialize the log4j system properly.
                  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
                  Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.753 sec - in org.trinityhealth.example.canon.TestCanonRoute
                  Running org.trinityhealth.example.canon.TestContentItem
                  Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.trinityhealth.example.canon.TestContentItem
                  Running org.trinityhealth.example.canon.TestPerson
                  Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.trinityhealth.example.canon.TestPerson
                  Running org.trinityhealth.example.canon.TestCanonService
                  Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in org.trinityhealth.example.canon.TestCanonService
                  Running org.trinityhealth.example.canon.TestTrinityStatus
                  Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in org.trinityhealth.example.canon.TestTrinityStatus
                  
                  Results :
                  
                  Tests run: 17, Failures: 0, Errors: 0, Skipped: 0
                  
                  [INFO] ------------------------------------------------------------------------
                  [INFO] BUILD SUCCESS
                  [INFO] ------------------------------------------------------------------------
                  [INFO] Total time: 7.629 s
                  [INFO] Finished at: 2015-09-15T12:58:08+02:00
                  [INFO] Final Memory: 17M/315M
                  [INFO] ------------------------------------------------------------------------
                  

                  Java version: 1.8.0_60, Maven version: 3.3.3.

                   

                  You can try adding src/test/resources/log4j.properties to see more information.

                   

                  regards

                  Grzegorz Grzybek