Package org.switchyard.validate

Examples of org.switchyard.validate.BaseValidator


    }

    @Test
    public void testGetName_default_without_generics() {
        // No generics...
        BaseValidator strv =
            new BaseValidator() {
                public ValidationResult validate(Object obj) {
                    if (obj != null) {
                        return validResult();
                    } else {
                        return invalidResult("obj == null");
                    }
                }
        };

        Assert.assertEquals("java:java.lang.Object", strv.getName().toString());
    }
View Full Code Here


    @Test
    public void testGetName_specified_without_generics() {
        final QName name = new QName("string1");

        BaseValidator strv =
            new BaseValidator(name) {
                public ValidationResult validate(Object obj) {
                    if (obj != null) {
                        return validResult();
                    } else {
                        return invalidResult("obj == null");
                    }
                }
        };

        Assert.assertEquals(name, strv.getName());
    }
View Full Code Here

        if (!ValidationResult.class.isAssignableFrom(publicMethod.getReturnType())) {
            throw ValidateMessages.MESSAGES.invalidMethodSignatureMustReturnValidationResult(publicMethod.getName(),
                    publicMethod.getDeclaringClass().getName());
        }
       
        Validator validator = new BaseValidator(name) {
            @Override
            public ValidationResult validate(Object subject) {
                try {
                    return ValidationResult.class.cast(publicMethod.invoke(validatorObject, subject));
                } catch (InvocationTargetException e) {
View Full Code Here

TOP

Related Classes of org.switchyard.validate.BaseValidator

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.