You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Nestor Urquiza (JIRA)" <ji...@apache.org> on 2012/05/17 17:26:08 UTC

[jira] [Created] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Nestor Urquiza created CAMEL-5283:
-------------------------------------

             Summary: JUnit @Test silently fails to run when there are missing component dependencies
                 Key: CAMEL-5283
                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
             Project: Camel
          Issue Type: Bug
            Reporter: Nestor Urquiza


As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.

Test case:
---------
Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java

A little change to the route (commented line below) is enough to stop the testing method from running.  

@Override 
    protected RouteBuilder createRouteBuilder() throws Exception { 
        return new RouteBuilder() { 
            @Override 
            public void configure() throws Exception { 
                
                from("file://target/inbox") 
                .to("file://target/outbox") 
                //.to("http://localhost:8088") 
                ; 
                
            } 
        }; 
    } 

If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 

I can confirm this is the case for other missing components as well like camel-jackson.

Thanks!
-Nestor


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Posted by "Nestor Urquiza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279129#comment-13279129 ] 

Nestor Urquiza commented on CAMEL-5283:
---------------------------------------

My bad. Sorry about this non-issue. 

I should have run this from command line. Instead I run it from Eclipse and I was not receiving the exception in the console but in the JUnit output tab which I did not check.

You can close the ticket now.

Thanks!

-Nestor
                
> JUnit @Test silently fails to run when there are missing component dependencies
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-5283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Nestor Urquiza
>
> As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.
> Test case:
> ---------
> Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java
> A little change to the route (commented line below) is enough to stop the testing method from running.  
> @Override 
>     protected RouteBuilder createRouteBuilder() throws Exception { 
>         return new RouteBuilder() { 
>             @Override 
>             public void configure() throws Exception { 
>                 
>                 from("file://target/inbox") 
>                 .to("file://target/outbox") 
>                 //.to("http://localhost:8088") 
>                 ; 
>                 
>             } 
>         }; 
>     } 
> If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 
> I can confirm this is the case for other missing components as well like camel-jackson.
> Thanks!
> -Nestor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278328#comment-13278328 ] 

Christian Müller commented on CAMEL-5283:
-----------------------------------------

If I change the route to:

{code}
public void configure() throws Exception {
    from("file://target/inbox")
        .to("file://target/outbox")
        .to("http://localhost:8088");
}
{code}

I get the following (expected) exception:
{code}
org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[http://localhost:8088] <<< in route: Route[[From[file://target/inbox]] -> [To[file://target/outbo... because of Failed to resolve endpoint: http://localhost:8088 due to: No component found with scheme: http
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:855)
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:168)
	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:709)
	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1733)
	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1525)
	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1420)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1388)
	at org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:410)
	at org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:277)
	at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:204)
	at camelinaction.FirstTest.setUp(FirstTest.java:38)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:47)
	at org.junit.rules.RunRules.evaluate(RunRules.java:18)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: http://localhost:8088 due to: No component found with scheme: http
	at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:461)
	at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
	at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:183)
	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
	at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
	at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
	at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:440)
	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:178)
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:852)
	... 42 more

{code}

What's the issue?
                
> JUnit @Test silently fails to run when there are missing component dependencies
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-5283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Nestor Urquiza
>
> As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.
> Test case:
> ---------
> Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java
> A little change to the route (commented line below) is enough to stop the testing method from running.  
> @Override 
>     protected RouteBuilder createRouteBuilder() throws Exception { 
>         return new RouteBuilder() { 
>             @Override 
>             public void configure() throws Exception { 
>                 
>                 from("file://target/inbox") 
>                 .to("file://target/outbox") 
>                 //.to("http://localhost:8088") 
>                 ; 
>                 
>             } 
>         }; 
>     } 
> If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 
> I can confirm this is the case for other missing components as well like camel-jackson.
> Thanks!
> -Nestor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Posted by "Nestor Urquiza (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13277975#comment-13277975 ] 

Nestor Urquiza commented on CAMEL-5283:
---------------------------------------

Here is all I can see when I raise level to DEBUG:
2012-05-17 13:03:03,726 DEBUG [org.apache.camel.impl.DefaultComponentResolver] - <Found component: http in registry: null>
                
> JUnit @Test silently fails to run when there are missing component dependencies
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-5283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Nestor Urquiza
>
> As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.
> Test case:
> ---------
> Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java
> A little change to the route (commented line below) is enough to stop the testing method from running.  
> @Override 
>     protected RouteBuilder createRouteBuilder() throws Exception { 
>         return new RouteBuilder() { 
>             @Override 
>             public void configure() throws Exception { 
>                 
>                 from("file://target/inbox") 
>                 .to("file://target/outbox") 
>                 //.to("http://localhost:8088") 
>                 ; 
>                 
>             } 
>         }; 
>     } 
> If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 
> I can confirm this is the case for other missing components as well like camel-jackson.
> Thanks!
> -Nestor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13278475#comment-13278475 ] 

Willem Jiang commented on CAMEL-5283:
-------------------------------------

@Nestor
Which version of Camel are you using?
Did you get an exception when you try to run the test ?

                
> JUnit @Test silently fails to run when there are missing component dependencies
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-5283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Nestor Urquiza
>
> As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.
> Test case:
> ---------
> Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java
> A little change to the route (commented line below) is enough to stop the testing method from running.  
> @Override 
>     protected RouteBuilder createRouteBuilder() throws Exception { 
>         return new RouteBuilder() { 
>             @Override 
>             public void configure() throws Exception { 
>                 
>                 from("file://target/inbox") 
>                 .to("file://target/outbox") 
>                 //.to("http://localhost:8088") 
>                 ; 
>                 
>             } 
>         }; 
>     } 
> If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 
> I can confirm this is the case for other missing components as well like camel-jackson.
> Thanks!
> -Nestor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Closed] (CAMEL-5283) JUnit @Test silently fails to run when there are missing component dependencies

Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-5283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Müller closed CAMEL-5283.
-----------------------------------

    Resolution: Invalid
    
> JUnit @Test silently fails to run when there are missing component dependencies
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-5283
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5283
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Nestor Urquiza
>
> As discussed in http://camel.465427.n5.nabble.com/JUnit-Test-not-running-when-using-http-endpoint-td5711142.html#a5711368 it looks like Camel fails to report exceptions related to routes using components not present in the classpath.
> Test case:
> ---------
> Use this example http://camelinaction.googlecode.com/svn/trunk/chapter6/firsttest/src/test/java/camelinaction/FirstTest.java
> A little change to the route (commented line below) is enough to stop the testing method from running.  
> @Override 
>     protected RouteBuilder createRouteBuilder() throws Exception { 
>         return new RouteBuilder() { 
>             @Override 
>             public void configure() throws Exception { 
>                 
>                 from("file://target/inbox") 
>                 .to("file://target/outbox") 
>                 //.to("http://localhost:8088") 
>                 ; 
>                 
>             } 
>         }; 
>     } 
> If camel-http is included then the method gets hit. Camel fails to report any errors when camel-http is missing. 
> I can confirm this is the case for other missing components as well like camel-jackson.
> Thanks!
> -Nestor

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira