Package org.fusesource.ide.camel.model

Examples of org.fusesource.ide.camel.model.RouteSupport


    assertModelRoundTrip("sample.xml", 1);
  }
 
  @Test
  public void testLoadAndSaveOfFilter() throws Exception {
    RouteSupport route = assertModelRoundTrip("filterSample.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

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

    Filter filter = assertChildIsInstance(endpoint.getOutputs(), 0, Filter.class);
    assertEquals("filter expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("filter language", "xpath", filter.getExpression().getLanguage());
View Full Code Here


    assertContains(routeChildren, endpoint, filter, endpoint2);
  }
 
  @Test
  public void testLoadAndSaveOfFilterWithBlueprint() throws Exception {
    RouteSupport route = assertModelRoundTrip("filterSampleBlueprint.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

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

    Filter filter = assertChildIsInstance(endpoint.getOutputs(), 0, Filter.class);
    assertEquals("filter expression", "/foo/bar", filter.getExpression().getExpression());
    assertEquals("filter language", "xpath", filter.getExpression().getLanguage());
View Full Code Here

    assertContains(routeChildren, endpoint, filter, endpoint2);
  }

  @Test
  public void testLoadAndSaveOfContentBasedRouter() throws Exception {
    RouteSupport route = assertModelRoundTrip("cbrSample.xml", 1);
    List<AbstractNode> routeChildren = route.getChildren();

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

    List<AbstractNode> children2 = model2.getChildren();
    assertEquals("Should have the same outputs " + model1 + " and " + model2, model1.getOutputs().size(), model2.getOutputs().size());
    assertEquals("Should have the same children " + model1 + " and " + model2, children1.size(), children2.size());
    assertEquals("Child count", outputCount, children1.size());

    RouteSupport route1 = assertIsInstance(children1.get(0), RouteSupport.class);
    RouteSupport route2 = assertIsInstance(children2.get(0), RouteSupport.class);

    assertEquals("Should have the same outputs " + route1 + " and " + route2, route1.getOutputs().size(), route2.getOutputs().size());
    assertEquals("Should have the same children " + route1 + " and " + route2, route1.getChildren().size(), route2.getChildren().size());
   
    return route2;
  }
View Full Code Here

   * @see org.eclipse.jface.action.Action#isChecked()
   */
  @Override
  public boolean isChecked() {
    final RiderDesignEditor editor = Activator.getDiagramEditor();
    final RouteSupport selectedRoute = editor.getSelectedRoute();
    return route == selectedRoute;
  }
View Full Code Here

    if (target != null) {
      if (source == null) {
        // lets add the target to the diagram
        RiderDesignEditor editor = RiderDesignEditor.toRiderDesignEditor(getDiagramBehavior());
        if (editor != null) {
          RouteSupport route = editor.getSelectedRoute();
          if (route != null) {
            route.addChild(target);
          }
        }
      } else {
        // create new business object
        Flow eReference = createFlow(source, target);
View Full Code Here

    if (model != null) {
      List<AbstractNode> children = model.getChildren();
      int counter = 0;
      for (AbstractNode node : children) {
        if (node instanceof RouteSupport) {
          final RouteSupport route = (RouteSupport) node;
          ActionContributionItem item = new ActionContributionItem(new SwitchRouteAction(route, counter));
          items.add(item);
          counter++;
        }
      }
View Full Code Here

   */
  @Override
  public Object[] create(ICreateContext context) {
    AbstractNode node = createNode();

    RouteSupport selectedRoute = Activator.getDiagramEditor().getSelectedRoute();
    Diagram diagram = getDiagram();

    if (selectedRoute != null) {
      selectedRoute.addChild(node);
    } else {
      Activator.getLogger().warning("Warning! Could not find currently selectedNode, so can't associate this node with the route!: " + node);
    }

    // do the add
View Full Code Here

  public void setEditingDomain(TransactionalEditingDomain editingDomain) {
//    this.editingDomain = editingDomain;
  }

  public String getCamelContextURI() {
    RouteSupport selectedRoute = getSelectedRoute();
    String id = selectedRoute.getId();
    if (id == null || id.length() == 0) {
      id = "#" + selectedRoute.hashCode();
    }
    IFile file = getCamelContextFile();
    if (file != null) {
      return file.getFullPath().toString() + "_" + id;
    } else {
View Full Code Here

  public void addNewRoute() {
    DiagramOperations.addNewRoute(this);
  }

  public void deleteRoute() {
    RouteSupport selectedRoute = getSelectedRoute();
    if (selectedRoute != null) {
      DiagramOperations.deleteRoute(this, selectedRoute);
    }
  }
View Full Code Here

TOP

Related Classes of org.fusesource.ide.camel.model.RouteSupport

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.