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

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


        .test();
  }

  private PositionerExpectationsBuilder testTree() {
    return new PositionerExpectationsBuilder(grandchild)
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), SOURCE));
  }
View Full Code Here


        .test();
  }

  private PositionerExpectationsBuilder testChain() {
    return new PositionerExpectationsBuilder(grandchild)
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE));
  }
View Full Code Here

        .test();
  }

  private PositionerExpectationsBuilder testCycle() {
    return new PositionerExpectationsBuilder(grandchild)
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .addEdge(new Dependency(baz(), foo(), SOURCE));
  }
View Full Code Here

        .test();
  }

  public void testPositionCycle_OutsideDep() throws Exception {
    testCycle()
        .addEdge(new Dependency(bar(), Key.get(A.class), SOURCE))
        .keysBoundAt(child, Key.get(A.class))
        .implicitlyBoundAt(child, foo(), bar(), baz())
        .test();
  }
View Full Code Here

  public void testPositionPinned_noBindingInParent() throws Exception {
    // Bar is bound (and pinned) at grandchild, but because it is not exposed to
    // the root, foo should be created in grandchild.
    testChain()
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .pinnedAt(grandchild, bar())
        .implicitlyBoundAt(grandchild, bar())
        .implicitlyBoundAt(grandchild, foo())
        .test();
  }
View Full Code Here

  public void testPositionPinned_exposedBindingInParent() throws Exception {
    // Bar is bound (and pinned) at grandchild, but because it is exposed to the
    // child, foo should be created up there.
    testChain()
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .pinnedAt(grandchild, bar())
        .exposed(grandchild, child, bar())
        .implicitlyBoundAt(grandchild, bar())
        .implicitlyBoundAt(child, foo())
        .test();
View Full Code Here

    // in this case.
    //
    // (this should be an error in other parts of the code, but check that this
    // module behaves in a well-defined way)
    testChain()
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .pinnedAt(grandchild, bar())
        .exposed(othergrandchild, child, bar())
        .shouldThrow(Exception.class)
        .implicitlyBoundAt(grandchild, bar())
        .implicitlyBoundAt(grandchild, foo())
View Full Code Here

    // this case.
    //
    // (this should be an error in other parts of the code, but check that this
    // module behaves in a well-defined way)
    testChain()
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .pinnedAt(grandchild, bar())
        .notExposedBinding(child, bar())
        .shouldThrow(Exception.class)
        .implicitlyBoundAt(grandchild, bar())
        .implicitlyBoundAt(grandchild, foo())
View Full Code Here

  public void testPositionPinned_exposedBindingInParentAndGrandparent() throws Exception {
    // Bar is bound (and pinned) at grandchild, but because it is exposed to the
    // child and the root, foo should be created up there.
    testChain()
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .pinnedAt(grandchild, bar())
        .exposed(grandchild, child, bar())
        .exposed(child, root, bar())
        .implicitlyBoundAt(grandchild, bar())
        .implicitlyBoundAt(root, foo())
View Full Code Here

  private static class C {}
  private static class D {}

  public void testTwoCycles() throws Exception {
    testCycle()
        .addEdge(new Dependency(bar(), Key.get(A.class), SOURCE))
        .addEdge(new Dependency(Key.get(A.class), Key.get(B.class), SOURCE))
        .addEdge(new Dependency(Key.get(B.class), Key.get(C.class), SOURCE))
        .addEdge(new Dependency(Key.get(B.class), Key.get(D.class), SOURCE))
        .addEdge(new Dependency(Key.get(C.class), Key.get(A.class), SOURCE))
        .keysBoundAt(child, Key.get(D.class))
        .implicitlyBoundAt(child, foo(), bar(), baz(),
            Key.get(A.class), Key.get(B.class), Key.get(C.class))
        .test();
  }
View Full Code Here

TOP

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

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.