Package com.google.gwt.inject.rebind.binding

Examples of com.google.gwt.inject.rebind.binding.Dependency$GinjectorSourceClass


    addImplicitBinding(untargettedBinding);
    return null;
  }

  private void addImplicitBinding(Element sourceElement) {
    bindingsCollection.addDependency(new Dependency(Dependency.GINJECTOR, targetKey,
        Context.forElement(sourceElement).toString()));
  }
View Full Code Here


       
    replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
  }
   
  private Dependency required(Key<?> source, Key<?> key) {
    return new Dependency(source, key, SOURCE);
  }
View Full Code Here

  private Dependency required(Key<?> source, Key<?> key) {
    return new Dependency(source, key, SOURCE);
  }
 
  private Dependency optional(Key<?> source, Key<?> key) {
    return new Dependency(source, key, true, false, SOURCE);
  }
View Full Code Here

  private Dependency optional(Key<?> source, Key<?> key) {
    return new Dependency(source, key, true, false, SOURCE);
  }
 
  private Dependency requiredLazy(Key<?> source, Key<?> key) {
    return new Dependency(source, key, false, true, SOURCE);
  }
View Full Code Here

    origin = control.createMock(GinjectorBindings.class);
  }
 
  public void testFindAnyPath() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(foo(), bar(), SOURCE),
            new Dependency(bar(), baz(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz()).findShortestPath());
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testFindShortestPath() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), SOURCE)) // we should use the "shortcut" to baz
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(foo(), baz(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz()).findShortestPath());
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testFindShortestPath_MultipleDestinations() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(foo(), bar(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz(), bar()).findShortestPath());
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testPathInUnresolved() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(Dependency.GINJECTOR, baz(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), SOURCE))
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, baz(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz()).findShortestPath());
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testRequiredPath_OptionalInPath() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), true, false, SOURCE)) // avoid optional short-cut
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(foo(), bar(), SOURCE),
            new Dependency(bar(), baz(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz())
            .withOnlyRequiredEdges(true).findShortestPath());
    control.verify();
View Full Code Here

    control.verify();
  }
 
  public void testRequiredPath_OptionalInUnresolved() throws Exception {
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(Dependency.GINJECTOR, baz(), true, false, SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .build();
    control.replay();
    assertEquals(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(foo(), bar(), SOURCE),
            new Dependency(bar(), baz(), SOURCE)),
        new PathFinder().onGraph(graph)
            .addRoots(Dependency.GINJECTOR)
            .addDestinations(baz())
            .withOnlyRequiredEdges(true).findShortestPath());
    control.verify();
View Full Code Here

TOP

Related Classes of com.google.gwt.inject.rebind.binding.Dependency$GinjectorSourceClass

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.