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

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


    eagerCycleFinder = new EagerCycleFinder(errorManager);
  }
 
  public void testShortCycleDetection() throws Exception {
    eagerCycleFinder.reportError(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)),
        TestUtils.dependencyList(new Dependency(foo(), foo(), SOURCE)));
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here


    control.verify();
  }
 
  public void testBasicCycleDetection() throws Exception {
    eagerCycleFinder.reportError(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)),
        TestUtils.dependencyList(
            new Dependency(foo(), bar(), SOURCE),
            new Dependency(bar(), foo(), SOURCE)));
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testEagerCycleInUnresolved() throws Exception {
    eagerCycleFinder.reportError(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)),
        TestUtils.dependencyList(
            new Dependency(foo(), bar(), SOURCE),
            new Dependency(bar(), foo(), SOURCE)));
    expect(origin.getDependencies()).andStubReturn(TestUtils.dependencyList(
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
        new Dependency(foo(), bar(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testEagerCycleSecondInUnresolved() throws Exception {
    eagerCycleFinder.reportError(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)),
        TestUtils.dependencyList(
            new Dependency(foo(), baz(), SOURCE),
            new Dependency(baz(), foo(), SOURCE)));
    expect(origin.getDependencies()).andStubReturn(TestUtils.dependencyList(
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
        new Dependency(foo(), bar(), SOURCE),
        new Dependency(foo(), baz(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), SOURCE))
        .addEdge(new Dependency(baz(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

 
  public void testOnlyReportedOnce() throws Exception {
    errorManager.logError(isA(String.class), isA(Object.class), isA(Object.class));
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(
            new Dependency(Dependency.GINJECTOR, foo(), SOURCE),
            new Dependency(Dependency.GINJECTOR, bar(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testNoCycle() throws Exception {
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(foo(), bar(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE)).build();
    assertFalse(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testNotEagerCycle() throws Exception {
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), SOURCE))
        .addEdge(new Dependency(bar(), foo(), false, true, SOURCE)).build();
    assertFalse(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testNotEagerShortCycle() throws Exception {
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), foo(), false, true, SOURCE)).build();
    assertFalse(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testLazyCycleInUnresolved() throws Exception {
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(foo(), bar(), false, true, SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(foo(), bar(), false, true, SOURCE))
        .addEdge(new Dependency(bar(), foo(), SOURCE)).build();
    assertFalse(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
View Full Code Here

    control.verify();
  }
 
  public void testLazyProviderDoesNotHideCycle() throws Exception {
    eagerCycleFinder.reportError(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)),
        TestUtils.dependencyList(
            new Dependency(foo(), baz(), SOURCE),
            new Dependency(baz(), foo(), SOURCE)));
    expect(origin.getDependencies()).andStubReturn(
        TestUtils.dependencyList(new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    control.replay();
    DependencyGraph graph = new DependencyGraph.Builder(origin)
        .addEdge(new Dependency(Dependency.GINJECTOR, foo(), SOURCE))
        .addEdge(new Dependency(foo(), bar(), false, true, SOURCE))
        .addEdge(new Dependency(bar(), baz(), SOURCE))
        .addEdge(new Dependency(foo(), baz(), SOURCE))
        .addEdge(new Dependency(baz(), foo(), SOURCE)).build();
    assertTrue(eagerCycleFinder.findAndReportCycles(graph));
    control.verify();
  }
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.