Package org.mojavemvc.tests.views

Examples of org.mojavemvc.tests.views.HTMLPage


    @Action("some-action")
    public View someAction() {

        invocationList.add("someAction");
        return new HTMLPage()
            .withH2Content("someAction");
    }
View Full Code Here


    @Action("some-action")
    @InterceptedBy({ Interceptor1c.class, Interceptor1d.class })
    public View someAction() {

        invocationList.add("someAction");
        return new HTMLPage()
            .withH2Content("someAction");
    }
View Full Code Here

    @DefaultAction
    @InterceptedBy({ Interceptor1c.class, Interceptor1d.class })
    public View defaultAction() {

        invocationList.add("defaultAction");
        return new HTMLPage()
            .withH2Content("defaultAction");
    }
View Full Code Here

    @Action("some-action")
    public View someAction() {

        invocationList.add("someAction");
        return new HTMLPage()
            .withH2Content("someAction");
    }
View Full Code Here

    @DefaultAction
    public View defaultAction() {

        invocationList.add("defaultAction");
        return new HTMLPage()
            .withH2Content("defaultAction");
    }
View Full Code Here

        SomeModel model = new SomeModel();
        model.setName("John");
        model.setNum(21);

        HTMLPage view = new HTMLPage();
        view.setModel(model);

        Map<String, Object> attributes = view.getAttributes();
        assertNotNull(attributes);
        assertEquals(2, attributes.size());
        assertEquals("John", attributes.get("name"));
        assertEquals(21, attributes.get("num"));
    }
View Full Code Here

        SomeModel model = new SomeModel();
        model.setName("John");
        model.setNum(21);

        HTMLPage view = new HTMLPage().withModel(model);

        Map<String, Object> attributes = view.getAttributes();
        assertNotNull(attributes);
        assertEquals(2, attributes.size());
        assertEquals("John", attributes.get("name"));
        assertEquals(21, attributes.get("num"));
    }
View Full Code Here

        SomeModel model = new SomeModel();
        model.setName("John");
        model.setNum(21);

        HTMLPage view = new HTMLPage().withModel(model);

        SomeModel model2 = view.getModel(SomeModel.class);

        assertNotNull(model2);
        assertEquals("John", model2.getName());
        assertEquals(21, model2.getNum());
    }
View Full Code Here

    }

    @Test
    public void testView_getModelNoAttributes() throws Exception {

        HTMLPage view = new HTMLPage();
        SomeModel model2 = view.getModel(SomeModel.class);

        assertNotNull(model2);
        assertEquals(null, model2.getName());
        assertEquals(0, model2.getNum());
    }
View Full Code Here

    }

    @Test
    public void testView_setAttributesFromPairs() throws Exception {

        HTMLPage view = new HTMLPage();
        view.setAttributesFromPairs(new String[] { "name", "num" }, new Object[] { "John", 21 });

        Map<String, Object> attributes = view.getAttributes();
        assertNotNull(attributes);
        assertEquals(2, attributes.size());
        assertEquals("John", attributes.get("name"));
        assertEquals(21, attributes.get("num"));
    }
View Full Code Here

TOP

Related Classes of org.mojavemvc.tests.views.HTMLPage

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.