Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4790

Using the CamelContext.stopRoute(routeId) should not remove the route from context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.3
    • 2.8.4, 2.9.0
    • camel-core
    • None
    • Unknown

    Description

      Christian reported a camel route stop issue few months ago[1], I found this bug by running the unit test he submit.

      public class RouteRemoveTest extends ContextTestSupport {
       
      +    public void testStopRouteOnContext() throws Exception {
      +        assertEquals(ServiceStatus.Started, ((DefaultRoute) context.getRoute("foo")).getStatus());
      +        assertEquals(ServiceStatus.Started, context.getRouteStatus("foo"));
      +        
      +        context.stopRoute("foo");
      +        
      +        assertEquals(ServiceStatus.Stopped, ((DefaultRoute) context.getRoute("foo")).getStatus());
      +        assertEquals(ServiceStatus.Stopped, context.getRouteStatus("foo"));
      +    }
      

      The route foo should not be removed from the camelContext.
      [1] http://camel.465427.n5.nabble.com/Stop-a-route-for-unit-testing-tt4724550.html#a5011082

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: