use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class StandardFunctionsTest method testURLEncode.
@Test
public void testURLEncode() {
FunctionInterface fi = fff.getInstance(cl, "URLEncode");
fi.reset();
fi.insertStringOperand("10");
Object o = fi.evaluateWithTypeChecking();
assertNotNull(o);
assertEquals(o.getClass(), String.class);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class StandardFunctionsTest method testSumMessage.
@Test
public void testSumMessage() {
FunctionInterface fi = fff.getInstance(cl, "SumMessage");
Navajo doc = createTestNavajo();
fi.setInMessage(doc);
fi.reset();
fi.insertMessageOperand(doc.getMessage("Aap"));
fi.insertStringOperand("Noot");
Object o = fi.evaluateWithTypeChecking();
assertNotNull(o);
assertEquals(Integer.class, o.getClass());
assertEquals("10", o.toString());
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class StandardFunctionsTest method testGetMimeType.
@Test
public void testGetMimeType() {
FunctionInterface fi = fff.getInstance(cl, "GetMimeType");
fi.reset();
fi.insertOperand(Operand.NULL);
Object o = fi.evaluateWithTypeChecking();
assertNull(o);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class StandardFunctionsTest method testBase64Encode.
@Test
public void testBase64Encode() {
FunctionInterface fi = fff.getInstance(cl, "Base64Encode");
fi.reset();
String data = "tralala";
fi.insertStringOperand(data);
String actual = (String) fi.evaluateWithTypeChecking();
String expected = Base64.encode(data.getBytes());
// strip newline
expected = expected.substring(0, expected.length() - 1);
assertEquals(expected, actual);
}
use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.
the class StandardFunctionsTest method testToInteger.
@Test
public void testToInteger() {
FunctionInterface fi = fff.getInstance(cl, "ToInteger");
fi.reset();
fi.insertStringOperand("10");
Object o = fi.evaluateWithTypeChecking();
assertNotNull(o);
assertEquals("10", o.toString());
assertEquals(Integer.class, o.getClass());
}
Aggregations