NIHVIVO-1564 Commit changes that should have been included in r7823.
This commit is contained in:
parent
f7dbdc4889
commit
d126241bcd
2 changed files with 49 additions and 1 deletions
48
webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java
Normal file
48
webapp/test/freemarker/ext/dump/DumpAllDirectiveTest.java
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||||
|
|
||||||
|
package freemarker.ext.dump;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
import static junit.framework.Assert.fail;
|
||||||
|
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.io.StringWriter;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.log4j.Level;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import freemarker.core.Environment;
|
||||||
|
import freemarker.template.Configuration;
|
||||||
|
import freemarker.template.Template;
|
||||||
|
|
||||||
|
public class DumpAllDirectiveTest {
|
||||||
|
|
||||||
|
private Template template;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
Configuration config = new Configuration();
|
||||||
|
String templateStr = "";
|
||||||
|
try {
|
||||||
|
template = new Template("template", new StringReader(templateStr), config);
|
||||||
|
} catch (Exception e) {
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
// Turn off log messages to console
|
||||||
|
Logger.getLogger(BaseDumpDirective.class).setLevel(Level.OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void dumpDataModel() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////// Private stub classes and helper methods ///////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -707,7 +707,7 @@ public class DumpDirectiveTest {
|
||||||
private Map<String, Object> getDump(String varName, Map<String, Object> dataModel) {
|
private Map<String, Object> getDump(String varName, Map<String, Object> dataModel) {
|
||||||
try {
|
try {
|
||||||
Environment env = template.createProcessingEnvironment(dataModel, new StringWriter());
|
Environment env = template.createProcessingEnvironment(dataModel, new StringWriter());
|
||||||
return new DumpDirective().getTemplateVariableData(varName, env);
|
return new DumpDirective().getTemplateVariableDump(varName, env);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
fail(e.getMessage());
|
fail(e.getMessage());
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue