Examples of FreemarkerAutotagRuntime


Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        Map<String, TemplateModel> params = createMock(Map.class);
        TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
        expect(params.get(eq("notnullParam"))).andReturn(model).anyTimes();
        expect(params.get(eq("nullParam"))).andReturn(null).anyTimes();
        replay(model, params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
        runtime.execute(env, params, new TemplateModel[0], body);
        Object notnullParam = runtime.getParameter("notnullParam", Object.class, null);
        Object nullParam = runtime.getParameter("nullParam", Object.class, null);
        int notnullParamDefault = runtime.getParameter("notnullParam", Integer.class, new Integer(24));
        int nullParamDefault = runtime.getParameter("nullParam", Integer.class, new Integer(24));
        assertEquals(42, notnullParam);
        assertEquals(null, nullParam);
        assertEquals(42, notnullParamDefault);
        assertEquals(24, nullParamDefault);
        verify(template, rootDataModel, out, model, params, body);
View Full Code Here

Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        replay(template, rootDataModel, out);
        Environment env = new Environment(template, rootDataModel, out);

        replay(params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();

        runtime.execute(env, params, new TemplateModel[0], body);
        Request request = runtime.createRequest();
        assertTrue(request instanceof FreemarkerRequest);
        verify(servlet, wrapper, servletContext, applicationContext,
                httpServletRequest, httpServletResponse,
                template, rootDataModel, out,
                params, body);
View Full Code Here

Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        Environment env = new Environment(template, rootDataModel, out);
        @SuppressWarnings("unchecked")
        Map<String, TemplateModel> params = createMock(Map.class);
        TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
        replay(params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
        runtime.execute(env, params, new TemplateModel[0], body);
        ModelBody modelBody = runtime.createModelBody();
        assertTrue(modelBody instanceof FreemarkerModelBody);
        verify(template, rootDataModel, out, params, body);
    }
View Full Code Here

Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        replay(template, rootDataModel, out);
        Environment env = new Environment(template, rootDataModel, out);

        replay(params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();

        runtime.execute(env, params, new TemplateModel[0], body);
        Request request = runtime.createRequest();
        assertTrue(request instanceof FreemarkerRequest);
        verify(servlet, wrapper, servletContext, applicationContext,
                httpServletRequest, httpServletResponse,
                template, rootDataModel, out,
                params, body);
View Full Code Here

Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        Environment env = new Environment(template, rootDataModel, out);
        @SuppressWarnings("unchecked")
        Map<String, TemplateModel> params = createMock(Map.class);
        TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
        replay(params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
        runtime.execute(env, params, new TemplateModel[0], body);
        ModelBody modelBody = runtime.createModelBody();
        assertTrue(modelBody instanceof FreemarkerModelBody);
        verify(template, rootDataModel, out, params, body);
    }
View Full Code Here

Examples of org.apache.tiles.request.freemarker.autotag.FreemarkerAutotagRuntime

        Map<String, TemplateModel> params = createMock(Map.class);
        TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class);
        expect(params.get(eq("notnullParam"))).andReturn(model).anyTimes();
        expect(params.get(eq("nullParam"))).andReturn(null).anyTimes();
        replay(model, params, body);
        FreemarkerAutotagRuntime runtime = new FreemarkerAutotagRuntime();
        runtime.execute(env, params, new TemplateModel[0], body);
        Object notnullParam = runtime.getParameter("notnullParam", null);
        Object nullParam = runtime.getParameter("nullParam", null);
        Object notnullParamDefault = runtime.getParameter("notnullParam", new Integer(24));
        Object nullParamDefault = runtime.getParameter("nullParam", new Integer(24));
        assertEquals(42, notnullParam);
        assertEquals(null, nullParam);
        assertEquals(42, notnullParamDefault);
        assertEquals(24, nullParamDefault);
        verify(template, rootDataModel, out, model, params, body);
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.