Examples of TemplateContextAdapter


Examples of com.alibaba.citrus.service.freemarker.impl.TemplateContextAdapter

    }

    @Override
    public TemplateModel wrap(Object obj) throws TemplateModelException {
        if (obj instanceof TemplateContext) {
            return new TemplateContextAdapter((TemplateContext) obj, this);
        }

        if (obj instanceof Renderable) {
            return new RenderableModel((Renderable) obj, this);
        }
View Full Code Here

Examples of com.alibaba.citrus.service.freemarker.impl.TemplateContextAdapter

        ctx.put("ccc", 333);
    }

    @Test
    public void test() throws TemplateModelException {
        TemplateContextAdapter adapter = new TemplateContextAdapter(ctx, null);

        assertSimpleNumber(adapter.get("aaa"), 111);
        assertSimpleNumber(adapter.get("bbb"), 222);
        assertSimpleNumber(adapter.get("ccc"), 333);
        assertNull(adapter.get("ddd"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.freemarker.impl.TemplateContextAdapter

        ctx.put("ccc", 333);
    }

    @Test
    public void test() throws TemplateModelException {
        TemplateContextAdapter adapter = new TemplateContextAdapter(ctx, null);

        assertSimpleNumber(adapter.get("aaa"), 111);
        assertSimpleNumber(adapter.get("bbb"), 222);
        assertSimpleNumber(adapter.get("ccc"), 333);
        assertNull(adapter.get("ddd"));
    }
View Full Code Here

Examples of com.alibaba.citrus.service.freemarker.impl.TemplateContextAdapter

    }

    @Override
    public TemplateModel wrap(Object obj) throws TemplateModelException {
        if (obj instanceof TemplateContext) {
            return new TemplateContextAdapter((TemplateContext) obj, this);
        }

        if (obj instanceof Renderable) {
            return new RenderableModel((Renderable) obj, this);
        }
View Full Code Here

Examples of com.alibaba.citrus.service.freemarker.impl.TemplateContextAdapter

    }

    @Override
    public TemplateModel wrap(Object obj) throws TemplateModelException {
        if (obj instanceof TemplateContext) {
            return new TemplateContextAdapter((TemplateContext) obj, this);
        }

        if (obj instanceof Renderable) {
            return new RenderableModel((Renderable) obj, this);
        }
View Full Code Here

Examples of com.alibaba.citrus.service.jsp.impl.TemplateContextAdapter

        context = new MappedTemplateContext();

        context.put("ccc", 3333);
        context.put("ddd", 4444);

        adapter = new TemplateContextAdapter(request, context);
    }
View Full Code Here

Examples of com.alibaba.citrus.service.jsp.impl.TemplateContextAdapter

    }

    @Test
    public void newInstance() {
        try {
            new TemplateContextAdapter(null, null);
            fail();
        } catch (IllegalArgumentException e) {
            assertThat(e, exception("request"));
        }

        try {
            new TemplateContextAdapter(request, null);
            fail();
        } catch (IllegalArgumentException e) {
            assertThat(e, exception("templateContext"));
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.service.jsp.impl.TemplateContextAdapter

        context = new MappedTemplateContext();

        context.put("ccc", 3333);
        context.put("ddd", 4444);

        adapter = new TemplateContextAdapter(request, context);
    }
View Full Code Here

Examples of com.alibaba.citrus.service.jsp.impl.TemplateContextAdapter

    }

    @Test
    public void newInstance() {
        try {
            new TemplateContextAdapter(null, null);
            fail();
        } catch (IllegalArgumentException e) {
            assertThat(e, exception("request"));
        }

        try {
            new TemplateContextAdapter(request, null);
            fail();
        } catch (IllegalArgumentException e) {
            assertThat(e, exception("templateContext"));
        }
    }
View Full Code Here

Examples of com.alibaba.citrus.service.velocity.impl.TemplateContextAdapter

    private TemplateContextAdapter adapter;

    @Before
    public void init() {
        context = new MappedTemplateContext();
        adapter = new TemplateContextAdapter(context);

        context.put("aaa", 111);
        context.put("bbb", 222);
        context.put("ccc", 333);
    }
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.