use of freemarker.template.SimpleScalar in project android by JetBrains.
the class FmCompareVersionsMethodTest method check.
@SuppressWarnings("rawtypes")
private void check(String lhs, String rhs, int expected) throws Exception {
FmCompareVersionsMethod method = new FmCompareVersionsMethod();
List list = newArrayList(new SimpleScalar(lhs), new SimpleScalar(rhs));
Number result = ((SimpleNumber) method.exec(list)).getAsNumber();
assertEquals(expected, Integer.signum(result.intValue()));
}
use of freemarker.template.SimpleScalar in project android by JetBrains.
the class FmHasDependencyMethodTest method check.
@SuppressWarnings("rawtypes")
private static void check(boolean expected, String s, Map<String, Object> paramMap) throws TemplateModelException {
FmHasDependencyMethod method = new FmHasDependencyMethod(paramMap);
List list = Collections.singletonList(new SimpleScalar(s));
assertEquals(expected, ((TemplateBooleanModel) method.exec(list)).getAsBoolean());
}
use of freemarker.template.SimpleScalar in project android by JetBrains.
the class FmLayoutToActivityMethodTest method check.
@SuppressWarnings("rawtypes")
private static void check(String s, String expected) throws TemplateModelException {
FmLayoutToActivityMethod method = new FmLayoutToActivityMethod();
List list = Collections.singletonList(new SimpleScalar(s));
assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
}
use of freemarker.template.SimpleScalar in project android by JetBrains.
the class FmSlashedPackageNameMethodTest method check.
@SuppressWarnings("rawtypes")
private void check(String s, String expected) throws TemplateModelException {
FmSlashedPackageNameMethod method = new FmSlashedPackageNameMethod();
List list = Collections.singletonList(new SimpleScalar(s));
assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
}
use of freemarker.template.SimpleScalar in project android by JetBrains.
the class FmEscapeXmlTextMethodTest method check.
@SuppressWarnings("rawtypes")
private void check(String s, String expected) throws TemplateModelException {
FmEscapeXmlTextMethod method = new FmEscapeXmlTextMethod();
List list = Collections.singletonList(new SimpleScalar(s));
assertEquals(expected, ((SimpleScalar) method.exec(list)).getAsString());
}
Aggregations