Package org.springmodules.util

Examples of org.springmodules.util.StringResource


        if (logger.isDebugEnabled()) {
            logger.debug("The generated email descriptor for '" + name + "' is:\n" + writer.toString());
        }

        return emailParser.parse(new StringResource(writer.toString()));
    }
View Full Code Here


     */
    protected Email resolveEmail(String name, Map model) {
        StringWriter writer = new StringWriter();
        Template template = templateResolver.resolve(name, getEncoding());
        template.generate(writer, model);
        return emailParser.parse(new StringResource(writer.toString()));
    }
View Full Code Here

    }

    public void testResolve() throws Exception {
        String name = "name";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("prefix/name.ext"), resource);

        Template template = new DummyTemplate();
        engineControl.expectAndReturn(engine.createTemplate(resource, "UTF-8"), template);
View Full Code Here

    public void testResolve_WithEncoding() throws Exception {
        String name = "name";
        String encoding = "encoding";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("prefix/name.ext"), resource);

        Template template = new DummyTemplate();
        engineControl.expectAndReturn(engine.createTemplate(resource, encoding), template);
View Full Code Here

    public void testResolve_WithEncodingAndLocale() throws Exception {
        String name = "name";
        String encoding = "encoding";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("prefix/name_en_US.ext"), null);
        loaderControl.expectAndReturn(loader.getResource("prefix/name_en.ext"), null);
        loaderControl.expectAndReturn(loader.getResource("prefix/name.ext"), resource);

        Template template = new DummyTemplate();
View Full Code Here

    }

    public void testResolve() throws Exception {
        String name = "name";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);

        Template template = new DummyTemplate();
        engineControl.expectAndReturn(engine.createTemplate(resource, "UTF-8"), template);
View Full Code Here

    public void testResolve_WithEncoding() throws Exception {
        String name = "name";
        String encoding = "encoding";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);

        Template template = new DummyTemplate();
        engineControl.expectAndReturn(engine.createTemplate(resource, encoding), template);
View Full Code Here

    public void testResolve_WithEncodingAndLocale() throws Exception {
        String name = "name";
        String encoding = "encoding";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("name_en_US.ext"), null);
        loaderControl.expectAndReturn(loader.getResource("name_en.ext"), null);
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);

View Full Code Here

    public void testResolve() throws Exception {

        String name = "name";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);

        Template template = new DummyTemplate();
        engineControl.expectAndReturn(engine.createTemplate(resource, "UTF-8"), template);
View Full Code Here

        resolver.setCacheEnabled(false);

        String name = "name";

        StringResource resource = new StringResource("resource");
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);
        loaderControl.expectAndReturn(loader.getResource("name.ext"), resource);

        Template template1 = new DummyTemplate();
        Template template2 = new DummyTemplate();
View Full Code Here

TOP

Related Classes of org.springmodules.util.StringResource

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.