Examples of BindingCreationException


Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

    expect(origin.getDependencies()).andStubReturn(TestUtils.dependencyList(
        new Dependency(Dependency.GINJECTOR, foo(), SOURCE)));
    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());
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

    replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
  }
 
  public void testResolveOptionalKey_Fails() throws Exception {
    StandardTree tree = createExampleTree();
    expect(bindingCreator.create(foo())).andThrow(new BindingCreationException("Unable to create"));
       
    replayAndResolve(tree.childLL, optional(Dependency.GINJECTOR, foo()));
    // No error because foo() is optional.
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

 
  public void testResolveBindingWithOptionalDependency_DepFails() throws Exception{
    StandardTree tree = createExampleTree();
    // Baz is optional and fails to resolve
    Binding fooBinding = expectCreateBinding(foo(), required(foo(), bar()), optional(foo(), baz()));
    expect(bindingCreator.create(baz())).andThrow(new BindingCreationException("Unable to create"));
    bind(bar(), tree.root);

    tree.root.addBinding(foo(), fooBinding);
    expectParentBinding(foo(), tree.root, tree.childLL); // childLL gets foo from childL
       
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

  public void testResolveBindingWithOptionalDependencyThatFails() throws Exception {   
    StandardTree tree = createExampleTree();
   
    Binding fooBinding = expectCreateBinding(foo(), optional(foo(), bar()));
    expectCreateBinding(bar(), required(bar(), baz()));
    expect(bindingCreator.create(baz())).andThrow(new BindingCreationException("Unable to create"));
    tree.root.addBinding(foo(), fooBinding);
    expectParentBinding(foo(), tree.root, tree.childLL);
       
    replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

    replayAndResolve(tree.childL, required(Dependency.GINJECTOR, foo()));
  }
 
  public void testFailToCreateImplicitBinding() throws Exception {
    StandardTree tree = createExampleTree();
    expect(bindingCreator.create(foo())).andThrow(new BindingCreationException("Unable to create"));
   
    errorManager.logError(isA(String.class), eq(foo()), isA(String.class), isA(List.class));
    replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
  }
View Full Code Here

Examples of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException

  public void testFailToResolveDependency() throws Exception {
    StandardTree tree = createExampleTree();
    expectCreateBinding(foo(), required(foo(), bar()));
   
    expect(bindingCreator.create(bar()))
        .andThrow(new BindingCreationException("Unable to create"));
       
    errorManager.logError(isA(String.class), eq(bar()), isA(String.class), isA(List.class));
    replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
  }
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.