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

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


    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


    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());
View Full Code Here

    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);
View Full Code Here

  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

    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());
View Full Code Here

        imageProvider.addIconsForClass(new Loop());
        imageProvider.addIconsForClass(new Marshal());
        imageProvider.addIconsForClass(new Multicast());
        imageProvider.addIconsForClass(new OnCompletion());
        imageProvider.addIconsForClass(new OnException());
        imageProvider.addIconsForClass(new Otherwise());
        imageProvider.addIconsForClass(new Pipeline());
        imageProvider.addIconsForClass(new Policy());
        imageProvider.addIconsForClass(new PollEnrich());
        imageProvider.addIconsForClass(new Process());
        imageProvider.addIconsForClass(new RecipientList());
View Full Code Here

    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);
    assertEquals("endpoint2 uri", "seda:choiceWhen", endpoint2.getUri());

    Endpoint endpoint3 = assertChildIsInstance(otherwise.getOutputs(), 0, Endpoint.class);
    assertEquals("endpoint3 uri", "seda:choiceOtherwise", endpoint3.getUri());

    assertContains(routeChildren, endpoint, filter, endpoint2);
  }
View Full Code Here

TOP

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

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.