Package org.apache.tapestry.coerce

Examples of org.apache.tapestry.coerce.ValueConverter


    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();

        trainGetListener(component, map, listener);
View Full Code Here


    {
        IComponent component = newComponent();
        ListenerMap map = newListenerMap();
        IActionListener listener = newListener();
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent sourceComponent = newComponent();
        IRequestCycle cycle = newCycle();

        trainGetListener(component, map, listener);
View Full Code Here

public class TestTranslatorBinding extends BindingTestCase
{
    public void testCreate()
    {
        Location l = newLocation();
        ValueConverter vc = newValueConverter();
        IComponent component = newComponent();
       
        BeanFactory bf = newMock(BeanFactory.class);

        Translator translator =newMock(Translator.class);
View Full Code Here

{  
    public void test_Render()
    {
        IRequestCycle cycle = newMock(IRequestCycle.class);
        IMarkupWriter writer = newBufferWriter();
        ValueConverter conv = newMock(ValueConverter.class);
        ResponseBuilder resp = newMock(ResponseBuilder.class);
        IComponentSpecification spec = newSpec();
        IParameterSpecification pspec = newMock(IParameterSpecification.class);
       
        List src = new ArrayList();
        src.add("Test1");
        src.add("Test2");
       
        IBinding source = newBinding(src);
       
        ForBean bean = newInstance(ForBean.class, new Object[] {
            "valueConverter", conv,
            "responseBuilder", resp,
            "templateTagName", "div",
            "renderTag", true,
            "specification", spec
            });
       
        expect(cycle.renderStackPush(bean)).andReturn(bean);
       
        expect(cycle.isRewinding()).andReturn(false);
       
        expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(null);
       
        expect(spec.getParameter("source")).andReturn(pspec).anyTimes();
       
        expect(conv.coerceValue(src, Iterator.class)).andReturn(src.iterator());
       
        expect(resp.isDynamic()).andReturn(false).anyTimes();
       
        expect(cycle.getResponseBuilder()).andReturn(resp).anyTimes();
       
View Full Code Here

   
    public void test_Rewind_Missing_Converter()
    {
        IRequestCycle cycle = newMock(IRequestCycle.class);
        IMarkupWriter writer = newWriter();
        ValueConverter conv = newMock(ValueConverter.class);
        ResponseBuilder resp = newMock(ResponseBuilder.class);
        IForm form = newMock(IForm.class);
        IComponentSpecification spec = newSpec();
       // IParameterSpecification pspec = newMock(IParameterSpecification.class);
       
        List src = new ArrayList();
        src.add("Test1");
        src.add("Test2");
       
        IBinding source = newBinding(src);
       
        ForBean bean = newInstance(ForBean.class, new Object[] {
            "valueConverter", conv,
            "responseBuilder", resp,
            "templateTagName", "div",
            "renderTag", true,
            "specification", spec
            });
       
        expect(cycle.renderStackPush(bean)).andReturn(bean);
       
        expect(cycle.isRewinding()).andReturn(true).anyTimes();
       
        expect(cycle.getAttribute(TapestryUtils.FORM_ATTRIBUTE)).andReturn(form);
       
        expect(form.isRewinding()).andReturn(true);
       
        expect(form.getElementId(bean)).andReturn("foo");
       
        String[] parms = (String[])src.toArray((new String[src.size()]));
       
        expect(cycle.getParameters("foo")).andReturn(parms);
       
        expect(conv.coerceValue(src, Iterator.class)).andReturn(src.iterator());
       
        expect(resp.isDynamic()).andReturn(false).anyTimes();
       
        expect(cycle.renderStackPop()).andReturn(bean);
       
View Full Code Here

    {
        Location l = newLocation();
        InjectSpecification spec = newSpec("fooBar", "foo.bar", l);

        ComponentPropertySource source = newSource();
        ValueConverter converter = newMock(ValueConverter.class);

        EnhancementOperation op = newMock(EnhancementOperation.class);

        expect(op.getPropertyType("fooBar")).andReturn(Object.class);
View Full Code Here

       
        Object compiled = new Object();
       
        Object expressionValue = "EXPRESSION-VALUE";
       
        ValueConverter vc = newValueConverter();
       
        expect(ec.getCompiledExpression("exp")).andReturn(compiled);
       
        expect(ev.isConstant("exp")).andReturn(true);
       
View Full Code Here

        Object compiled = new Object();

        Object expressionValue1 = new Object();
        Object expressionValue2 = new Object();

        ValueConverter vc = newValueConverter();
       
        expect(ec.getCompiledExpression("exp")).andReturn(compiled);

        expect(ev.isConstant("exp")).andReturn(false);
View Full Code Here

        Location l = fabricateLocation(1);
       
        IComponent component = newComponent();
        Object compiled = new Object();

        ValueConverter vc = newValueConverter();

        expect(ec.getCompiledExpression("exp")).andReturn(compiled);

        expect(ev.isConstant("exp")).andReturn(false);
View Full Code Here

        Location l = fabricateLocation(1);
       
        IComponent component = newComponent("Foo/bar.baz");
        Object compiled = new Object();
       
        ValueConverter vc = newValueConverter();

        expect(ec.getCompiledExpression("exp")).andReturn(compiled);

        expect(ev.isConstant("exp")).andReturn(true);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.coerce.ValueConverter

Copyright © 2018 www.massapicom. 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.