@@ -0,0 +1,3325 @@
+package org.apache.velocity.test;%0A%0A/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.    %0A */%0A%0Aimport org.apache.velocity.VelocityContext;%0Aimport org.apache.velocity.app.VelocityEngine;%0Aimport org.apache.velocity.runtime.RuntimeConstants;%0Aimport org.apache.velocity.runtime.resource.loader.FileResourceLoader;%0Aimport org.apache.velocity.runtime.resource.loader.StringResourceLoader;%0Aimport org.apache.velocity.test.misc.TestLogger;%0A%0Aimport java.io.FileWriter;%0A%0A/**%0A * This class tests the velocimacro.library.autoreload functionality, and issue VELOCITY-%0A */%0Apublic class MacroAutoReloadTestCase extends BaseTestCase%0A%7B%0A    public MacroAutoReloadTestCase(String name)%0A    %7B%0A        super(name);%0A    %7D%0A%0A    protected void setUp() throws Exception%0A    %7B%0A        engine = new VelocityEngine();%0A%0A        //by default, make the engine's log output go to the test-report%0A        log = new TestLogger(false, false);%0A        engine.setProperty(RuntimeConstants.RUNTIME_LOG_INSTANCE, log);%0A%0A        // use file resource loader%0A        engine.setProperty(RuntimeConstants.RESOURCE_LOADER, %22file,string%22);%0A        engine.addProperty(%22file.resource.loader.path%22, TEST_COMPARE_DIR + %22/reload%22);%0A        engine.addProperty(%22velocimacro.library%22, %22macros.vtl%22);%0A        engine.addProperty(%22velocimacro.library.autoreload%22, %22true%22);%0A        engine.addProperty(%22file.resource.loader.cache%22, %22false%22);%0A        engine.addProperty(%22string.resource.loader.class%22, StringResourceLoader.class.getName());%0A        engine.addProperty(%22string.resource.loader.repository.name%22, %22stringRepo%22);%0A        engine.addProperty(%22string.resource.loader.repository.static%22, %22false%22);%0A        %0A        setUpEngine(engine);%0A%0A        context = new VelocityContext();%0A        setUpContext(context);%0A    %7D%0A%0A    %0A    public void testChangedMacro() throws Exception%0A    %7B%0A        String template = %22#foo('hip')%22;%0A        String result = %22hop_hip%22;%0A        assertEvalEquals(result, template);%0A%0A        FileWriter writer = new FileWriter(TEST_COMPARE_DIR + %22/reload/macros.vtl%22);%0A        writer.write(%22#macro(foo $txt)hip_$txt#%7Bend%7D%22);%0A        writer.close();%0A %0A        result = %22hip_hip%22;%0A        assertEvalEquals(result, template);%0A    %7D%0A%0A    public void testNewMacro() throws Exception%0A    %7B%0A        FileWriter writer = new FileWriter(TEST_COMPARE_DIR + %22/reload/macros.vtl%22, true);%0A        writer.write(%22%5Cn#macro(bar $txt)hep_$txt#%7Bend%7D%22);%0A        writer.close();%0A %0A        String template = %22#foo('hip') #bar('hip')%22;%0A        String result = %22hip_hip hep_hip%22;%0A        assertEvalEquals(result, template);%0A    %7D%0A%7D%0A%0A

add test case for VELOCITY-710