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

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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.3
    • Fix Version/s: 2.8.4, 2.9.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: