Package net.sourceforge.stripes.mock

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


    @Test(groups="fast")
    public void bindDoubleQuotedShortKey() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapShortInteger[\"1\"]",    "1");
        trip.addParameter("mapShortInteger[\"200\"]""2");
        trip.addParameter("mapShortInteger[\"3000\"]", "3");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getMapShortInteger().get( (short) 1 ), new Integer(1));
View Full Code Here


    @Test(groups="fast")
    public void bindDoubleQuotedShortKey() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapShortInteger[\"1\"]",    "1");
        trip.addParameter("mapShortInteger[\"200\"]""2");
        trip.addParameter("mapShortInteger[\"3000\"]", "3");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getMapShortInteger().get( (short) 1 ), new Integer(1));
        Assert.assertEquals(bean.getMapShortInteger().get( (short) 200), new Integer(2));
View Full Code Here

    }

    @Test(groups="fast")
    public void bindSingleQuotedEnumKey() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapEnumString['red']",    "Red");
        trip.addParameter("mapEnumString['green']""Green");
        trip.addParameter("mapEnumString['blue']",   "Blue");
        trip.execute();

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

    @Test(groups="fast")
    public void bindSingleQuotedEnumKey() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapEnumString['red']",    "Red");
        trip.addParameter("mapEnumString['green']""Green");
        trip.addParameter("mapEnumString['blue']",   "Blue");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getMapEnumString().get(Color.red), "Red");
View Full Code Here

    @Test(groups="fast")
    public void bindSingleQuotedEnumKey() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("mapEnumString['red']",    "Red");
        trip.addParameter("mapEnumString['green']""Green");
        trip.addParameter("mapEnumString['blue']",   "Blue");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getMapEnumString().get(Color.red), "Red");
        Assert.assertEquals(bean.getMapEnumString().get(Color.green), "Green");
View Full Code Here

    }

    @Test(groups="fast")
    public void bindNestedMap() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("testBean.longMap[1]", "1");
        trip.addParameter("testBean.longMap[2]", "2");
        trip.addParameter("testBean.longMap[3]", "3");
        trip.execute();

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

    @Test(groups="fast")
    public void bindNestedMap() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("testBean.longMap[1]", "1");
        trip.addParameter("testBean.longMap[2]", "2");
        trip.addParameter("testBean.longMap[3]", "3");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getTestBean().getLongMap().get(1l), new Long(1));
View Full Code Here

    @Test(groups="fast")
    public void bindNestedMap() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("testBean.longMap[1]", "1");
        trip.addParameter("testBean.longMap[2]", "2");
        trip.addParameter("testBean.longMap[3]", "3");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getTestBean().getLongMap().get(1l), new Long(1));
        Assert.assertEquals(bean.getTestBean().getLongMap().get(2l), new Long(2));
View Full Code Here

    }

    @Test(groups="fast")
    public void bindKeyGreaterThanMaxInt() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("testBean.longMap[9999999999l]", "1");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getTestBean().getLongMap().get(9999999999l), new Long(1));
    }
View Full Code Here

    }

    @Test(groups="fast")
    public void bindKeyGreaterThanMaxIntII() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("testBean.longMap['9999999999']", "1");
        trip.execute();

        MapBindingTests bean = trip.getActionBean(MapBindingTests.class);
        Assert.assertEquals(bean.getTestBean().getLongMap().get(9999999999l), new Long(1));
    }
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.