NIHVIVO-1562 Show class of template directive/model in dump. Use LinkedHashMap in help data structure to ensure ordering of the entries.
This commit is contained in:
parent
b6ea045503
commit
1b9f4bbdce
11 changed files with 37 additions and 25 deletions
|
@ -6,6 +6,7 @@ import java.io.IOException;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -14,7 +15,6 @@ import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||||
import freemarker.core.Environment;
|
import freemarker.core.Environment;
|
||||||
import freemarker.template.Configuration;
|
|
||||||
import freemarker.template.TemplateDirectiveBody;
|
import freemarker.template.TemplateDirectiveBody;
|
||||||
import freemarker.template.TemplateException;
|
import freemarker.template.TemplateException;
|
||||||
import freemarker.template.TemplateModel;
|
import freemarker.template.TemplateModel;
|
||||||
|
@ -61,7 +61,7 @@ public class UrlDirective extends BaseTemplateDirectiveModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("effect", "Generate a full url from a path by prepending the servlet context path. Use for generating src attribute of image tags, href attribute of anchor tags, etc.");
|
map.put("effect", "Generate a full url from a path by prepending the servlet context path. Use for generating src attribute of image tags, href attribute of anchor tags, etc.");
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.io.Writer;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -94,7 +95,7 @@ public class WidgetDirective extends BaseTemplateDirectiveModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("effect", "Add a reuseable block of markup and functionality to the template, with associated scripts and stylesheets injected into the page <head> element.");
|
map.put("effect", "Add a reuseable block of markup and functionality to the template, with associated scripts and stylesheets injected into the page <head> element.");
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
package edu.cornell.mannlib.vitro.webapp.web.methods;
|
package edu.cornell.mannlib.vitro.webapp.web.methods;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class IndividualLocalNameMethod extends BaseTemplateMethodModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("return value", "The local name of the individual");
|
map.put("return value", "The local name of the individual");
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
package edu.cornell.mannlib.vitro.webapp.web.methods;
|
package edu.cornell.mannlib.vitro.webapp.web.methods;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||||
import freemarker.core.Environment;
|
import freemarker.core.Environment;
|
||||||
import freemarker.template.TemplateMethodModel;
|
|
||||||
import freemarker.template.TemplateModelException;
|
import freemarker.template.TemplateModelException;
|
||||||
|
|
||||||
public class IndividualProfileUrlMethod extends BaseTemplateMethodModel {
|
public class IndividualProfileUrlMethod extends BaseTemplateMethodModel {
|
||||||
|
@ -34,7 +33,7 @@ public class IndividualProfileUrlMethod extends BaseTemplateMethodModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("return value", "The profile url of the individual");
|
map.put("return value", "The profile url of the individual");
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
|
||||||
private static final Pattern PROPERTY_NAME_PATTERN = Pattern.compile("^(get|is)\\w");
|
private static final Pattern PROPERTY_NAME_PATTERN = Pattern.compile("^(get|is)\\w");
|
||||||
|
|
||||||
enum Key {
|
enum Key {
|
||||||
|
CLASS("class"),
|
||||||
DATE_TYPE("dateType"),
|
DATE_TYPE("dateType"),
|
||||||
HELP("help"),
|
HELP("help"),
|
||||||
METHODS("methods"),
|
METHODS("methods"),
|
||||||
|
@ -430,6 +431,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
|
||||||
private Map<String, Object> getTemplateModelDump(TemplateMethodModel model, String varName) throws TemplateModelException {
|
private Map<String, Object> getTemplateModelDump(TemplateMethodModel model, String varName) throws TemplateModelException {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put(Key.TYPE.toString(), Type.METHOD);
|
map.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
map.put(Key.CLASS.toString(), model.getClass().getName());
|
||||||
map.put(Key.HELP.toString(), getHelp(model, varName));
|
map.put(Key.HELP.toString(), getHelp(model, varName));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
@ -437,6 +439,7 @@ public abstract class BaseDumpDirective implements TemplateDirectiveModel {
|
||||||
private Map<String, Object> getTemplateModelDump(TemplateDirectiveModel model, String varName) throws TemplateModelException {
|
private Map<String, Object> getTemplateModelDump(TemplateDirectiveModel model, String varName) throws TemplateModelException {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
map.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
map.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
map.put(Key.CLASS.toString(), model.getClass().getName());
|
||||||
map.put(Key.HELP.toString(), getHelp(model, varName));
|
map.put(Key.HELP.toString(), getHelp(model, varName));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ package freemarker.ext.dump;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.SortedMap;
|
import java.util.SortedMap;
|
||||||
|
@ -69,12 +69,10 @@ public class DumpAllDirective extends BaseDumpDirective {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("effect", "Dumps the contents of the template data model.");
|
map.put("effect", "Dumps the contents of the template data model.");
|
||||||
|
|
||||||
//map.put("comments", "");
|
|
||||||
|
|
||||||
List<String> examples = new ArrayList<String>();
|
List<String> examples = new ArrayList<String>();
|
||||||
examples.add("<@" + name + " />");
|
examples.add("<@" + name + " />");
|
||||||
map.put("examples", examples);
|
map.put("examples", examples);
|
||||||
|
|
|
@ -5,6 +5,7 @@ package freemarker.ext.dump;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -57,12 +58,10 @@ public class DumpDirective extends BaseDumpDirective {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("effect", "Dumps the contents of a template variable.");
|
map.put("effect", "Dumps the contents of a template variable.");
|
||||||
|
|
||||||
//map.put("comments", "");
|
|
||||||
|
|
||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
params.put("var", "name of variable to dump");
|
params.put("var", "name of variable to dump");
|
||||||
map.put("parameters", params);
|
map.put("parameters", params);
|
||||||
|
|
|
@ -5,6 +5,7 @@ package freemarker.ext.dump;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -17,7 +18,6 @@ import freemarker.template.TemplateHashModel;
|
||||||
import freemarker.template.TemplateMethodModel;
|
import freemarker.template.TemplateMethodModel;
|
||||||
import freemarker.template.TemplateModel;
|
import freemarker.template.TemplateModel;
|
||||||
import freemarker.template.TemplateModelException;
|
import freemarker.template.TemplateModelException;
|
||||||
import freemarker.template.utility.DeepUnwrap;
|
|
||||||
|
|
||||||
public class HelpDirective extends BaseDumpDirective {
|
public class HelpDirective extends BaseDumpDirective {
|
||||||
|
|
||||||
|
@ -64,12 +64,10 @@ public class HelpDirective extends BaseDumpDirective {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> help(String name) {
|
public Map<String, Object> help(String name) {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new LinkedHashMap<String, Object>();
|
||||||
|
|
||||||
map.put("effect", "Outputs help for a directive or method.");
|
map.put("effect", "Outputs help for a directive or method.");
|
||||||
|
|
||||||
//map.put("comments", "");
|
|
||||||
|
|
||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
params.put("for", "name of directive or method");
|
params.put("for", "name of directive or method");
|
||||||
map.put("parameters", params);
|
map.put("parameters", params);
|
||||||
|
|
|
@ -256,6 +256,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -275,6 +276,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), getMethodHelp(varName));
|
expectedDumpValue.put(Key.HELP.toString(), getMethodHelp(varName));
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -294,6 +296,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -313,6 +316,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -332,6 +336,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), getDirectiveHelp(varName));
|
expectedDumpValue.put(Key.HELP.toString(), getDirectiveHelp(varName));
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -351,6 +356,7 @@ public class DumpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -735,14 +741,15 @@ public class DumpDirectiveTest {
|
||||||
Map<String, Object> dataModel = new HashMap<String, Object>();
|
Map<String, Object> dataModel = new HashMap<String, Object>();
|
||||||
BeansWrapper wrapper = new BeansWrapper();
|
BeansWrapper wrapper = new BeansWrapper();
|
||||||
wrapper.setExposureLevel(exposureLevel);
|
wrapper.setExposureLevel(exposureLevel);
|
||||||
|
Employee employee = getEmployee();
|
||||||
try {
|
try {
|
||||||
dataModel.put("employee", wrapper.wrap(getEmployee()));
|
dataModel.put("employee", wrapper.wrap(employee));
|
||||||
} catch (TemplateModelException e) {
|
} catch (TemplateModelException e) {
|
||||||
// logging is suppressed, so what do we do here?
|
// logging is suppressed, so what do we do here?
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), "freemarker.ext.dump.DumpDirectiveTest$Employee");
|
expectedDumpValue.put(Key.TYPE.toString(), employee.getClass().getName());
|
||||||
expectedDumpValue.put(Key.VALUE.toString(), getJohnDoeExpectedDump(exposureLevel));
|
expectedDumpValue.put(Key.VALUE.toString(), getJohnDoeExpectedDump(exposureLevel));
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
|
|
@ -57,7 +57,9 @@ public class HelpDirectiveTest {
|
||||||
dataModel.put(varName, methodModel);
|
dataModel.put(varName, methodModel);
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
|
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -77,6 +79,7 @@ public class HelpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), getMethodHelp(varName));
|
expectedDumpValue.put(Key.HELP.toString(), getMethodHelp(varName));
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -96,6 +99,7 @@ public class HelpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.METHOD);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), methodModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -115,6 +119,7 @@ public class HelpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -134,6 +139,7 @@ public class HelpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), getDirectiveHelp(varName));
|
expectedDumpValue.put(Key.HELP.toString(), getDirectiveHelp(varName));
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
@ -153,6 +159,7 @@ public class HelpDirectiveTest {
|
||||||
|
|
||||||
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
Map<String, Object> expectedDumpValue = new HashMap<String, Object>();
|
||||||
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
expectedDumpValue.put(Key.TYPE.toString(), Type.DIRECTIVE);
|
||||||
|
expectedDumpValue.put(Key.CLASS.toString(), directiveModel.getClass().getName());
|
||||||
expectedDumpValue.put(Key.HELP.toString(), null);
|
expectedDumpValue.put(Key.HELP.toString(), null);
|
||||||
|
|
||||||
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
Map<String, Object> expectedDump = new HashMap<String, Object>();
|
||||||
|
|
|
@ -157,7 +157,7 @@ div.dump {
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro doMethod method>
|
<#macro doMethod method>
|
||||||
<p><strong>Type:</strong> ${method.type}</p>
|
<p><strong>Type:</strong> ${method.type} (${method.class})</p>
|
||||||
<#local help = method.help!>
|
<#local help = method.help!>
|
||||||
<#if help?has_content>
|
<#if help?has_content>
|
||||||
<p><strong>Help:</strong><p>
|
<p><strong>Help:</strong><p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue