Package org.apache.velocity.app

Examples of org.apache.velocity.app.VelocityEngine.addProperty()


    public void testIncludeNotFound() throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, "org.apache.velocity.app.event.implement.IncludeNotFound");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template;
        FileOutputStream fos;
        Writer fwriter;
View Full Code Here


    public void testIncludeRelativePath() throws Exception
    {
        VelocityEngine ve = new VelocityEngine();
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, "org.apache.velocity.app.event.implement.IncludeRelativePath");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        Template template;
        FileOutputStream fos;
        Writer fwriter;
View Full Code Here

        ve.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, this);
        ve.setProperty(RuntimeConstants.EVENTHANDLER_METHODEXCEPTION, sequence1);
        ve.setProperty(RuntimeConstants.EVENTHANDLER_NULLSET, sequence1);
        ve.setProperty(RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION, sequence1);
        ve.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, sequence1);
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();

        VelocityEngine ve2 = new VelocityEngine();
        ve2.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, this);
        ve2.setProperty(RuntimeConstants.EVENTHANDLER_METHODEXCEPTION, sequence2);
View Full Code Here

        ve2.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM, this);
        ve2.setProperty(RuntimeConstants.EVENTHANDLER_METHODEXCEPTION, sequence2);
        ve2.setProperty(RuntimeConstants.EVENTHANDLER_NULLSET, sequence2);
        ve2.setProperty(RuntimeConstants.EVENTHANDLER_REFERENCEINSERTION, sequence2);
        ve2.setProperty(RuntimeConstants.EVENTHANDLER_INCLUDE, sequence2);
        ve2.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve2.init();

        VelocityContext context;
        StringWriter w;
View Full Code Here

        /**
         * Check that #set does not accept nulls
         */
   
        VelocityEngine ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();
   
        checkTemplate(ve,"set1");
       
        /**
 
View Full Code Here

       
        /**
         * Check that setting the property is the same as the default
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "false");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();
   
        checkTemplate(ve,"set1");

View Full Code Here

        /**
         * Check that setting the property is the same as the default
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "false");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();
   
        checkTemplate(ve,"set1");

        /**
 
View Full Code Here

        /**
         * Check that #set can accept nulls
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "true");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();
   
        checkTemplate(ve,"set2");
    }
View Full Code Here

        /**
         * Check that #set can accept nulls
         */
        ve = new VelocityEngine();
        ve.addProperty(RuntimeConstants.SET_NULL_ALLOWED, "true");
        ve.addProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, FILE_RESOURCE_LOADER_PATH);
        ve.init();
   
        checkTemplate(ve,"set2");
    }

View Full Code Here

            }

            if (useClasspath)
            {
                log("Using classpath");
                ve.addProperty(
                    VelocityEngine.RESOURCE_LOADER, "classpath");

                ve.setProperty(
                    "classpath." + VelocityEngine.RESOURCE_LOADER + ".class",
                        "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
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.