@Test public void factory_throws_exception() { BindingFactory factory = mockBindingFactory(); ComponentResources container = mockComponentResources(); ComponentResources component = mockComponentResources(); Location l = mockLocation(); Throwable t = new RuntimeException("Simulated failure."); String defaultPrefix = "def"; String description = "descrip"; String expression = "full expression"; factory.newBinding(description, container, component, expression, l); setThrowable(t); replay(); Map<String, BindingFactory> map = newMap(); map.put(defaultPrefix, factory); BindingSource source = new BindingSourceImpl(map, interner); try { source.newBinding(description, container, component, defaultPrefix, expression, l); unreachable(); } catch (TapestryException ex) { assertTrue(ex.getMessage().contains( "Could not convert 'full expression' into a component parameter binding")); assertTrue(ex.getMessage().contains(t.getMessage())); assertSame(ex.getLocation(), l); assertSame(ex.getCause(), t); } verify(); }
public Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression) { return newBinding(description, container, container, defaultPrefix, expression, null); }
BindingSourceImpl implements BindingSource { public Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression) { return newBinding(description, container, container, defaultPrefix, expression, null); } }
BindingSourceImpl implements BindingSource { public Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression) { return newBinding(description, container, container, defaultPrefix, expression, null); } BindingSourceImpl(Map<String, BindingFactory> factories, StringInterner interner); }
BindingSourceImpl implements BindingSource { public Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression) { return newBinding(description, container, container, defaultPrefix, expression, null); } BindingSourceImpl(Map<String, BindingFactory> factories, StringInterner interner); Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression); Binding newBinding(String description, ComponentResources container, ComponentResources component,
                              String defaultPrefix, String expression, Location location); }
BindingSourceImpl implements BindingSource { public Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression) { return newBinding(description, container, container, defaultPrefix, expression, null); } BindingSourceImpl(Map<String, BindingFactory> factories, StringInterner interner); Binding newBinding(String description, ComponentResources container, String defaultPrefix, String expression); Binding newBinding(String description, ComponentResources container, ComponentResources component,
                              String defaultPrefix, String expression, Location location);  }