Package net.sourceforge.stripes.test

Examples of net.sourceforge.stripes.test.TestActionBean$PropertyLess


*/
public class PropertyExpressionEvaluationTests {
    @Test(groups="fast")
    public void testGetBasicPropertyType() {
        PropertyExpression expr = PropertyExpression.getExpression("singleLong");
        PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(expr, new TestActionBean());
        Class<?> type = eval.getType();
        Assert.assertEquals(type, Long.class);
    }
View Full Code Here


    }

    @Test(groups="fast")
    public void testGetPropertyTypeWithPropertyAccess() {
        PropertyExpression expr = PropertyExpression.getExpression("publicLong");
        PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(expr, new TestActionBean());
        Class<?> type = eval.getType();
        Assert.assertEquals(type, Long.class);
    }
View Full Code Here

    }

    @Test(groups="fast")
    public void testGetPropertyTypeForListOfLongs() {
        PropertyExpression expr = PropertyExpression.getExpression("listOfLongs[17]");
        PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(expr, new TestActionBean());
        Class<?> type = eval.getType();
        Assert.assertEquals(type, Long.class);
    }
View Full Code Here

    }

    @Test(groups="fast")
    public void testGetPropertyTypeForReadThroughList() {
        PropertyExpression expr = PropertyExpression.getExpression("listOfBeans[3].enumProperty");
        PropertyExpressionEvaluation eval = new PropertyExpressionEvaluation(expr, new TestActionBean());
        Class<?> type = eval.getType();
        Assert.assertEquals(type, TestEnum.class);
    }
View Full Code Here

        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("singleString", "testValue");
        trip.addParameter("singleLong", "12345");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(bean.getSingleString(), "testValue");
        Assert.assertEquals(bean.getSingleLong(), new Long(12345L));
    }
View Full Code Here

    public void bindSetsOfStrings() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("setOfStrings", "testValue", "testValue", "testValue2", "testValue3");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertTrue(bean.getSetOfStrings().contains("testValue"));
        Assert.assertTrue(bean.getSetOfStrings().contains("testValue2"));
        Assert.assertTrue(bean.getSetOfStrings().contains("testValue3"));
        Assert.assertEquals(bean.getSetOfStrings().size(), 3);
    }
View Full Code Here

    public void bindListOfLongs() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("listOfLongs", "1", "2", "3", "456");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertTrue(bean.getListOfLongs().contains(1L));
        Assert.assertTrue(bean.getListOfLongs().contains(2L));
        Assert.assertTrue(bean.getListOfLongs().contains(3L));
        Assert.assertTrue(bean.getListOfLongs().contains(456L));
        Assert.assertEquals(bean.getListOfLongs().size(), 4);
    }
View Full Code Here

    public void bindNonGenericListOfLongs() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("nakedListOfLongs", "10", "20", "30", "4567");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertTrue(bean.getNakedListOfLongs().contains(10L));
        Assert.assertTrue(bean.getNakedListOfLongs().contains(20L));
        Assert.assertTrue(bean.getNakedListOfLongs().contains(30L));
        Assert.assertTrue(bean.getNakedListOfLongs().contains(4567L));
        Assert.assertEquals(bean.getNakedListOfLongs().size(), 4);
    }
View Full Code Here

        trip.addParameter("listOfBeans[2].intProperty", "20");
        trip.addParameter("listOfBeans[1].intProperty", "10");
        trip.addParameter("listOfBeans[4].intProperty", "40");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(bean.getListOfBeans().get(0).getIntProperty(), 00);
        Assert.assertEquals(bean.getListOfBeans().get(1).getIntProperty(), 10);
        Assert.assertEquals(bean.getListOfBeans().get(2).getIntProperty(), 20);
        Assert.assertEquals(bean.getListOfBeans().get(3).getIntProperty(), 30);
        Assert.assertEquals(bean.getListOfBeans().get(4).getIntProperty(), 40);
    }
View Full Code Here

        trip.addParameter("mapOfLongs['one']", "1");
        trip.addParameter("mapOfLongs['twentyseven']", "27");
        trip.addParameter("mapOfLongs['nine']", "9");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(bean.getMapOfLongs().get("one"), new Long(1));
        Assert.assertEquals(bean.getMapOfLongs().get("twentyseven"), new Long(27));
        Assert.assertEquals(bean.getMapOfLongs().get("nine"), new Long(9));
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.test.TestActionBean$PropertyLess

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.