Package net.sourceforge.stripes.test

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


        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");
        Assert.assertEquals(bean.getMapOfObjects().get("dog"),   "woof");
        Assert.assertEquals(bean.getMapOfObjects().get("snake"), "ssss");
    }
View Full Code Here


    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

        // 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

        // Should be able to set it just fine
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("setOnlyString", "whee");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertTrue(bean.setOnlyStringIsNotNull());
    }
View Full Code Here

        // Should be able to set it just fine
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("publicLong", "12345");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        Assert.assertEquals(new Long(12345), bean.publicLong);
    }
View Full Code Here

        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("context.eventName", "woohaa!");
        trip.addParameter(" context.eventName", "woohaa!");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        ActionBeanContext context = bean.getContext();
        Assert.assertFalse("woohaa!".equals(context.getEventName()));
    }
View Full Code Here

        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("Context.eventName", "woohaa!");
        trip.addParameter(" Context.eventName", "woohaa!");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        ActionBeanContext context = bean.getContext();
        Assert.assertFalse("woohaa!".equals(context.getEventName()));
    }
View Full Code Here

        // Should be able to set it just fine
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("colors", "Red", "Green", "Blue");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        TestActionBean.Color[] colors = bean.getColors();
        Assert.assertNotNull(colors);
        Assert.assertEquals(colors.length, 3);
        Assert.assertEquals(colors[0], TestActionBean.Color.Red);
        Assert.assertEquals(colors[1], TestActionBean.Color.Green);
        Assert.assertEquals(colors[2], TestActionBean.Color.Blue);
View Full Code Here

    public void testBindingToSubclassOfDeclaredType() throws Exception {
        MockRoundtrip trip = getRoundtrip();
        trip.addParameter("item.id", "1000000");
        trip.execute();

        TestActionBean bean = trip.getActionBean(TestActionBean.class);
        TestActionBean.PropertyLess item = bean.getItem();
        Assert.assertEquals(item.getClass(), TestActionBean.Item.class);
        Assert.assertEquals( ((TestActionBean.Item) item).getId(), new Long(1000000l));
    }
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

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.