Examples of NullFieldStrategy


Examples of org.apache.tapestry.NullFieldStrategy

public class NullFieldStrategySourceImplTest extends InternalBaseTestCase
{
    @Test
    public void success()
    {
        NullFieldStrategy strategy = mockNullFieldStrategy();

        replay();

        Map<String, NullFieldStrategy> configuration = Collections.singletonMap("strat", strategy);
View Full Code Here

Examples of org.apache.tapestry.NullFieldStrategy

        _configuration = configuration;
    }

    public NullFieldStrategy get(String name)
    {
        NullFieldStrategy result = _configuration.get(name);

        if (result != null) return result;

        throw new IllegalArgumentException(
                ServicesMessages.unknownNullFieldStrategyName(name, _configuration.keySet()));
View Full Code Here

Examples of org.apache.tapestry.NullFieldStrategy

    }

    public Binding newBinding(String description, ComponentResources container, ComponentResources component,
                              String expression, Location location)
    {
        NullFieldStrategy strategy = _strategySource.get(expression);

        return new LiteralBinding(description, strategy, location);
    }
View Full Code Here

Examples of org.apache.tapestry.NullFieldStrategy

public class NullFieldStrategySourceImplTest extends InternalBaseTestCase
{
    @Test
    public void success()
    {
        NullFieldStrategy strategy = mockNullFieldStrategy();

        replay();

        Map<String, NullFieldStrategy> configuration = Collections.singletonMap("strat", strategy);
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    @Test
    public void parse_client_via_event() throws ValidationException
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";

        IAnswer answer = new IAnswer()
        {
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    @Test
    public void parse_client_for_null_value_returns_null_and_bypasses_events_and_translator() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "";

        train_replaceFromClient(nullFieldStrategy, "");
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    public void parse_client_event_handler_throws_validation_exception() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        ValidationException ve = new ValidationException("Just didn't feel right.");
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";

        EasyMock.expect(resources.triggerEvent(EasyMock.eq(EventConstants.PARSE_CLIENT),
                                               EasyMock.isA(Object[].class),
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    public void parse_client_event_handler_fails_with_other_exception() throws Exception
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        RuntimeException re = new RuntimeException("Just didn't feel right.");
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";


        EasyMock.expect(resources.triggerEvent(EasyMock.eq(EventConstants.PARSE_CLIENT),
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    @Test
    public void parse_client_via_translator() throws ValidationException
    {
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        String clientValue = "abracadabra";

        ignoreEvent(resources, EventConstants.PARSE_CLIENT, clientValue);
View Full Code Here

Examples of org.apache.tapestry5.NullFieldStrategy

    public void to_client_via_translator()
    {
        Object value = new Integer(99);
        ComponentResources resources = mockComponentResources();
        FieldTranslator translator = mockFieldTranslator();
        NullFieldStrategy nullFieldStrategy = mockNullFieldStrategy();

        expect(translator.getType()).andReturn(Integer.class);

        String clientValue = "abracadabra";
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.