use of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException in project google-gin by gwtplus.
the class BindingResolverTest method testFailToResolveDependency.
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()));
}
use of com.google.gwt.inject.rebind.resolution.ImplicitBindingCreator.BindingCreationException in project google-gin by gwtplus.
the class BindingResolverTest method testResolveBindingWithOptionalDependency_DepFails.
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);
// childLL gets foo from childL
expectParentBinding(foo(), tree.root, tree.childLL);
replayAndResolve(tree.childLL, required(Dependency.GINJECTOR, foo()));
}
Aggregations