Package org.fusesource.ide.camel.model.generated

Examples of org.fusesource.ide.camel.model.generated.Choice


    Endpoint ep3 = new Endpoint();
    ep3.setUri("seda:c");
    Endpoint ep4 = new Endpoint();
    ep4.setUri("seda:d");

    Choice choice = new Choice();
    ep1.addTargetNode(choice);
    // adding out of order to check we add the otherwise first before the non-when/otherwise
    choice.addTargetNode(ep4);

    When when = new When();
    choice.addTargetNode(when);
    when.addTargetNode(ep2);

    Otherwise otherwise = new Otherwise();
    choice.addTargetNode(otherwise);
    otherwise.addTargetNode(ep3);

   
    RouteSupport route = new Route();
    route.addChildren(ep1, choice, when, otherwise, ep2, ep3, ep4);
View Full Code Here


  protected void assertRoute(RouteSupport route) {
    Endpoint e1 = assertSingleInput(route, Endpoint.class);
    assertEquals("from", "seda:a", e1.getUri());
   
    Choice c1 = assertSingleOutput(e1, Choice.class);
    When w1 = assertOutput(c1, 0, When.class);
    Endpoint e2 = assertSingleOutput(w1, Endpoint.class);
    assertEquals("when -> to", "seda:b", e2.getUri());

    Otherwise o1 = assertOutput(c1, 1, Otherwise.class);
    Endpoint e3 = assertSingleOutput(o1, Endpoint.class);
    assertEquals("otherwise -> to", "seda:c", e3.getUri());

    Endpoint e4 = assertOutput(c1, 2, Endpoint.class);
    assertEquals("choice -> to", "seda:d", e4.getUri());
   
    assertSize(c1.getOutputs(), 3);
  }
View Full Code Here

    Endpoint ep3 = new Endpoint();
    ep3.setUri("seda:c");
    Endpoint ep4 = new Endpoint();
    ep4.setUri("seda:d");

    Choice choice = new Choice();
    ep1.addTargetNode(choice);

    choice.addTargetNode(ep2);
    Otherwise otherwise = new Otherwise();
    choice.addTargetNode(otherwise);
    When when = new When();
    choice.addTargetNode(when);
    choice.addTargetNode(ep3);

    assertOutput(choice, 0, When.class);
    assertOutput(choice, 1, Otherwise.class);
    Endpoint e2 = assertOutput(choice, 2, Endpoint.class);
    assertEquals("e2", "seda:b", e2.getUri());
View Full Code Here

  @Test
  public void testCanConnect() throws Exception {
    Endpoint endpoint = new Endpoint();
    Filter filter = new Filter();
    Choice choice = new Choice();
    When when = new When();
    Otherwise otherwise = new Otherwise();
    Bean bean = new Bean();
   
    assertCanConnect(true, endpoint, choice);
    assertCanConnect(true, choice, when);
    assertCanConnect(true, choice, otherwise);
   
    assertCanConnect(true, when, endpoint);
    assertCanConnect(true, when, filter);
    assertCanConnect(true, otherwise, endpoint);
    assertCanConnect(true, otherwise, filter);

    assertCanConnect(true, choice, endpoint);
    assertCanConnect(true, choice, filter);
   
    assertCanConnect(false, endpoint, when);
    assertCanConnect(false, filter, when);
    assertCanConnect(false, endpoint, otherwise);
    assertCanConnect(false, filter, otherwise);
   
    // now lets check we can't connect to something we've already connected in the other direction
    assertCanConnect(true, endpoint, filter);
    assertCanConnect(true, filter, endpoint);
    endpoint.addTargetNode(filter);
    assertCanConnect(false, endpoint, filter);
    assertCanConnect(false, filter, endpoint);

    // we should still be able to connect this filter to another output
    assertCanConnect(true, filter, bean);

    // already has one otherwise, so can't add another
    choice.addTargetNode(otherwise);
    assertCanConnect(false, choice, new Otherwise());
  }
View Full Code Here

  protected void assertRoute(RouteSupport route) {
    Endpoint e1 = assertSingleInput(route, Endpoint.class);
    assertEquals("from", "seda:a", e1.getUri());
   
    Choice c1 = assertSingleOutput(e1, Choice.class);
    When w1 = assertOutput(c1, 0, When.class);
    Endpoint e2 = assertSingleOutput(w1, Endpoint.class);
    assertEquals("when -> to", "seda:b", e2.getUri());

    Otherwise o1 = assertOutput(c1, 1, Otherwise.class);
    Endpoint e3 = assertSingleOutput(o1, Endpoint.class);
    assertEquals("otherwise -> to", "seda:c", e3.getUri());

    Endpoint e4 = assertOutput(c1, 2, Endpoint.class);
    assertEquals("choice -> to", "seda:d", e4.getUri());
   
    assertSize(c1.getOutputs(), 3);
  }
View Full Code Here

        imageProvider.addIconsForClass(new Endpoint());
        imageProvider.addIconsForClass(new Aggregate());
        imageProvider.addIconsForClass(new AOP());
        imageProvider.addIconsForClass(new Bean());
        imageProvider.addIconsForClass(new Catch());
        imageProvider.addIconsForClass(new Choice());
        imageProvider.addIconsForClass(new ConvertBody());
        imageProvider.addIconsForClass(new Delay());
        imageProvider.addIconsForClass(new DynamicRouter());
        imageProvider.addIconsForClass(new Enrich());
        imageProvider.addIconsForClass(new Filter());
View Full Code Here

    Endpoint endpoint = assertChildIsInstance(route.getRootNodes(), 0, Endpoint.class);
    assertEquals("endpoint uri", "seda:choiceInput", endpoint.getUri());

    System.out.println("Endpoint outputs: " + endpoint.getOutputs());
    Choice choice = assertChildIsInstance(endpoint.getOutputs(), 0, Choice.class);

    System.out.println("Choice outputs: " + choice.getOutputs());
    When filter = assertChildIsInstance(choice.getOutputs(), 0, When.class);
    Otherwise otherwise = assertChildIsInstance(choice.getOutputs(), 1, Otherwise.class);
   
    assertEquals("when expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("when language", "xpath", filter.getExpression().getLanguage());
   
    Endpoint endpoint2 = assertChildIsInstance(filter.getOutputs(), 0, Endpoint.class);
View Full Code Here

TOP

Related Classes of org.fusesource.ide.camel.model.generated.Choice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.