Examples of DependencyExplorerOutput


Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

      this.thrownType = thrownType;
      return this;
    }

    public void test() {
      DependencyExplorerOutput output = control.createMock(DependencyExplorerOutput.class);
      expect(output.getGraph()).andStubReturn(graphBuilder.build());
      expect(output.getImplicitlyBoundKeys()).andStubReturn(implicitlyBoundKeys.keySet());
      expect(output.getPreExistingLocations()).andStubReturn(preExistingLocations);
      expectExposedBindingsExist();
      expectNotExposedBindingsExist();
      control.replay();
      BindingPositioner positioner = new BindingPositioner(treeLogger);
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.getDependencies()).andStubReturn(TestUtils.dependencyList(
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    expect(origin.isBound(foo())).andReturn(true).anyTimes();
    expect(origin.getParent()).andReturn(null);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(origin, output.getPreExistingLocations().get(foo()));
    assertEquals(1, output.getPreExistingLocations().size());
    assertEmpty(output.getBindingErrors());
    assertEmpty(output.getImplicitlyBoundKeys());
    assertSame(origin, output.getGraph().getOrigin());
    assertEmpty(output.getGraph().getDependenciesOf(foo()));
    assertContentsAnyOrder(output.getGraph().getDependenciesTargeting(foo()),
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.isBound(foo())).andReturn(false).anyTimes();
    expect(origin.getParent()).andReturn(parent).anyTimes();
    expect(parent.getParent()).andReturn(null);
    expect(parent.isBound(foo())).andReturn(true);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(parent, output.getPreExistingLocations().get(foo()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.getParent()).andReturn(parent).anyTimes();
    expect(parent.getParent()).andReturn(null);
    expect(parent.isBound(foo())).andReturn(false);
    expect(parent.isPinned(foo())).andReturn(true);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(parent, output.getPreExistingLocations().get(foo()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(parent.getParent()).andReturn(null).times(2);
    expect(parent.isBound(foo())).andReturn(false);
    expect(parent.isPinned(foo())).andReturn(false);
    expect(parent.isBound(bar())).andReturn(true);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(origin, output.getPreExistingLocations().get(foo()));
    assertSame(parent, output.getPreExistingLocations().get(bar()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.getParent()).andReturn(parent).anyTimes();
    expect(parent.getParent()).andReturn(null).times(2);
    expect(parent.isBound(foo())).andReturn(true);
    expect(parent.isBound(bar())).andReturn(true);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(parent, output.getPreExistingLocations().get(foo()));
    assertSame(parent, output.getPreExistingLocations().get(bar()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.isPinned(foo())).andReturn(true).anyTimes();
    expect(origin.getParent()).andReturn(parent).anyTimes();
    expect(bindingCreator.create(foo())).andReturn(binding);
    expect(binding.getDependencies()).andReturn(TestUtils.dependencyList());
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertTrue(output.getPreExistingLocations().isEmpty());
    assertTrue(output.getImplicitlyBoundKeys().contains(foo()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.isPinned(foo())).andReturn(false).anyTimes();
    expect(origin.getParent()).andReturn(parent).anyTimes();
    expect(parent.getParent()).andReturn(null);
    expect(parent.isBound(foo())).andReturn(true);
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(parent, output.getPreExistingLocations().get(foo()));
    control.verify();
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(bindingCreator.create(foo())).andReturn(binding);
    expect(binding.getDependencies()).andReturn(TestUtils.dependencyList(
        new Dependency(foo(), bar(), SOURCE)));
    expect(origin.isBound(bar())).andReturn(true).anyTimes();
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertSame(origin, output.getPreExistingLocations().get(bar()));
    assertEmpty(output.getBindingErrors());
    assertEquals(1, output.getImplicitlyBoundKeys().size());
    assertEquals(foo(), output.getImplicitBindings().iterator().next().getKey());
    assertEquals(binding, output.getImplicitBindings().iterator().next().getValue());
    DependencyGraph graph = output.getGraph();
    assertContentsAnyOrder(graph.getDependenciesTargeting(foo()),
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE));
    assertContentsAnyOrder(graph.getDependenciesTargeting(bar()),
        new Dependency(foo(), bar(), SOURCE));
    control.verify();
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.DependencyExplorer.DependencyExplorerOutput

    expect(origin.getParent()).andStubReturn(null);
    expect(origin.isBound(foo())).andReturn(false).anyTimes();
    expect(origin.isPinned(foo())).andReturn(false).anyTimes();
    expect(bindingCreator.create(foo())).andThrow(new BindingCreationException("failed"));
    control.replay();
    DependencyExplorerOutput output = dependencyExplorer.explore(origin);
    assertEquals(1, output.getBindingErrors().size());
    assertEquals(foo(), output.getBindingErrors().iterator().next().getKey());
    assertEquals("failed", output.getBindingErrors().iterator().next().getValue());
    control.verify();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.