Package net.sourceforge.stripes.util.bean

Examples of net.sourceforge.stripes.util.bean.PropertyExpression


        bean = trip.getActionBean(beanType);
        for (int i = 0; i < properties.length; i++) {
            String fullName = beanType.getSimpleName() + "." + properties[i];
            log.debug("Testing binding security on ", fullName);
            PropertyExpression pe = PropertyExpression.getExpression(properties[i]);
            PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(pe, bean);
            Object value = eval.getValue();
            Assert.assertEquals(value != null, expect[i], "Property " + fullName + " should"
                    + (expect[i] ? " not" : "") + " be null but it is" + (expect[i] ? "" : " not"));
        }
View Full Code Here


        bean = trip.getActionBean(beanType);
        for (int i = 0; i < properties.length; i++) {
            String fullName = beanType.getSimpleName() + "." + properties[i];
            log.debug("Testing binding security on ", fullName);
            PropertyExpression pe = PropertyExpression.getExpression(properties[i]);
            PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(pe, bean);
            Object value = eval.getValue();
            Assert.assertEquals(value != null, expect[i], "Property " + fullName + " should"
                    + (expect[i] ? " not" : "") + " be null but it is" + (expect[i] ? "" : " not"));
        }
View Full Code Here

        final TestBean bean = new TestBean();
        final BindingPolicyManager bpm = new BindingPolicyManager(TestBean.class);
        for (String expression : expressions) {
            log.debug("Testing illegal expression: " + expression);
            PropertyExpression pe = PropertyExpression.getExpression(expression);
            PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(pe, bean);
            Assert.assertFalse(bpm.isBindingAllowed(eval), "Binding should not be allowed for expression " + expression);
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.util.bean.PropertyExpression

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.