Package org.apache.tapestry.ioc.services

Examples of org.apache.tapestry.ioc.services.TypeCoercer


    @Test
    public void validator_with_no_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = newValidationMessagesSource();
        Validator validator = newValidator();
        TypeCoercer coercer = newTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = newMessages();
        MessageFormatter formatter = newMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = newComponentResources();
View Full Code Here


    @Test
    public void component_messages_overrides_validator_messages() throws Exception
    {
        ValidationMessagesSource messagesSource = newValidationMessagesSource();
        Validator validator = newValidator();
        TypeCoercer coercer = newTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = newMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = newComponentResources();
        Messages containerMessages = newMessages();
View Full Code Here

    @Test
    public void single_validator_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = newValidationMessagesSource();
        Validator validator = newValidator();
        TypeCoercer coercer = newTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = newMessages();
        MessageFormatter formatter = newMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = newComponentResources();
View Full Code Here

    public void multiple_validators_via_specification() throws Exception
    {
        ValidationMessagesSource messagesSource = newValidationMessagesSource();
        Validator required = newValidator();
        Validator minLength = newValidator();
        TypeCoercer coercer = newTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = newMessages();
        MessageFormatter requiredFormatter = newMessageFormatter();
        MessageFormatter minLengthFormatter = newMessageFormatter();
        Object inputValue = "input value";
View Full Code Here

    @Test
    public void validator_with_constraint() throws Exception
    {
        ValidationMessagesSource messagesSource = newValidationMessagesSource();
        Validator validator = newValidator();
        TypeCoercer coercer = newTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = newMessages();
        MessageFormatter formatter = newMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = newComponentResources();
View Full Code Here

    }

    @Test
    public void string_to_select_model_type_coercion_integration()
    {
        TypeCoercer coercer = getService(TypeCoercer.class);

        SelectModel selectModel = coercer.coerce(" UK , USA , DE=Germany ", SelectModel.class);

        assertNull(selectModel.getOptionGroups());
        assertEquals(selectModel.getOptions().size(), 3);

        // Waste of effort to re-test each individual option model.
View Full Code Here

    public void no_path_annotation()
    {
        AssetSource source = mockAssetSource();
        ObjectLocator locator = mockObjectLocator();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        TypeCoercer typeCoercer = mockTypeCoercer();
        SymbolSource symbolSource = mockSymbolSource();

        train_getAnnotation(annotationProvider, Path.class, null);

        replay();
View Full Code Here

        ObjectLocator locator = mockObjectLocator();
        Asset asset = mockAsset();
        String path = "${foo}";
        String expanded = "foo/bar/baz.gif";
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        TypeCoercer typeCoercer = mockTypeCoercer();
        Path pathAnnotation = mockPath();
        SymbolSource symbolSource = mockSymbolSource();

        train_getAnnotation(annotationProvider, Path.class, pathAnnotation);
        train_value(pathAnnotation, path);
View Full Code Here

{
    @Test
    public void no_annotation()
    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();

        train_getAnnotation(annotationProvider, Symbol.class, null);
View Full Code Here

    @Test
    public void annotation_present()
    {
        SymbolSource source = mockSymbolSource();
        TypeCoercer coercer = mockTypeCoercer();
        AnnotationProvider annotationProvider = mockAnnotationProvider();
        ObjectLocator locator = mockObjectLocator();
        String symbolName = "example-symbol";
        String symbolValue = "symbol-value";
        Long coercedValue = 123l;
View Full Code Here

TOP

Related Classes of org.apache.tapestry.ioc.services.TypeCoercer

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.