Package net.sourceforge.stripes.mock

Examples of net.sourceforge.stripes.mock.MockRoundtrip.addParameter()


        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("listOfBeans[0].intProperty", "0");
        trip.addParameter("listOfBeans[3].intProperty", "30");
        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);
View Full Code Here


    }

    @Test(groups="fast")
    public void bindStringIndexedProperties() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapOfLongs['one']", "1");
        trip.addParameter("mapOfLongs['twentyseven']", "27");
        trip.addParameter("mapOfLongs['nine']", "9");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
View Full Code Here

    @Test(groups="fast")
    public void bindStringIndexedProperties() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        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));
View Full Code Here

    @Test(groups="fast")
    public void bindStringIndexedProperties() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        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));
View Full Code Here

    }

    @Test(groups="fast")
    public void bindStringIndexedPropertiesII() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapOfObjects['foo']", "bar");
        trip.addParameter("mapOfObjects['cat']", "meow");
        trip.addParameter("mapOfObjects['dog']", "woof");
        trip.addParameter("mapOfObjects['snake']", "ssss");
        trip.execute();
View Full Code Here

    @Test(groups="fast")
    public void bindStringIndexedPropertiesII() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapOfObjects['foo']", "bar");
        trip.addParameter("mapOfObjects['cat']", "meow");
        trip.addParameter("mapOfObjects['dog']", "woof");
        trip.addParameter("mapOfObjects['snake']", "ssss");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
View Full Code Here

    @Test(groups="fast")
    public void bindStringIndexedPropertiesII() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapOfObjects['foo']", "bar");
        trip.addParameter("mapOfObjects['cat']", "meow");
        trip.addParameter("mapOfObjects['dog']", "woof");
        trip.addParameter("mapOfObjects['snake']", "ssss");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(bean.getMapOfObjects().get("foo"),   "bar");
View Full Code Here

    public void bindStringIndexedPropertiesII() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapOfObjects['foo']", "bar");
        trip.addParameter("mapOfObjects['cat']", "meow");
        trip.addParameter("mapOfObjects['dog']", "woof");
        trip.addParameter("mapOfObjects['snake']", "ssss");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(bean.getMapOfObjects().get("foo"),   "bar");
        Assert.assertEquals(bean.getMapOfObjects().get("cat"),   "meow");
View Full Code Here

    }

    @Test(groups="fast")
    public void bindIntArray() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("intArray", "100", "200", "30017");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertTrue(Arrays.equals(bean.getIntArray(), new int[] {100, 200, 30017}));
    }
View Full Code Here

    @Test(groups="fast")
    public void bindNonExistentProperty() throws Exception {
        // Should get logged but otherwise ignored...not blow up
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("foobarsplatNotProperty", "100");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertNotNull(bean);
    }
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.