use of com.google.inject.ConfigurationException in project google-gin by gwtplus.
the class FactoryBindingTest method testMismatchedFactoryAndClassAnnotations.
public void testMismatchedFactoryAndClassAnnotations() {
try {
new FactoryBinding(Collections.<Key<?>, TypeLiteral<?>>emptyMap(), Key.get(MismatchedFactoryAndClassAssistedValuesFactory.class), CONTEXT, new GuiceUtil(createInjectableCollector()), null);
fail("Expected ConfigurationException.");
} catch (ConfigurationException e) {
assertTrue(e.getMessage(), e.getMessage().contains("has no constructors matching " + "the parameters in method"));
}
}
use of com.google.inject.ConfigurationException in project google-gin by gwtplus.
the class BindingsProcessor method createBindingsForFactories.
private void createBindingsForFactories(GinjectorBindings bindings) {
for (final FactoryModule<?> factoryModule : bindings.getFactoryModules()) {
FactoryBinding binding;
try {
binding = bindingFactory.getFactoryBinding(factoryModule.getBindings(), factoryModule.getFactoryType(), Context.forText(factoryModule.getSource()));
} catch (ConfigurationException e) {
errorManager.logError("Factory %s could not be created", e, factoryModule.getFactoryType());
continue;
}
bindings.addBinding(factoryModule.getFactoryType(), binding);
}
}
Aggregations