Search in sources :

Example 46 with FunctionInterface

use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.

the class StandardFunctionsTest method testFileSize.

@Test
public void testFileSize() {
    FunctionInterface fi = fff.getInstance(cl, "FileSize");
    fi.reset();
    fi.insertOperand(Operand.NULL);
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
}
Also used : FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) Test(org.junit.Test)

Example 47 with FunctionInterface

use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.

the class StandardFunctionsTest method testStringPadding2.

@Test
public void testStringPadding2() {
    FunctionInterface fi = fff.getInstance(cl, "StringPadding");
    fi.reset();
    fi.insertStringOperand("aap");
    fi.insertIntegerOperand(Integer.valueOf(10));
    fi.insertStringOperand("*");
    fi.insertBooleanOperand(true);
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(String.class, o.getClass());
    assertEquals("*******aap", o.toString());
}
Also used : FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) Test(org.junit.Test)

Example 48 with FunctionInterface

use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.

the class StandardFunctionsTest method testRandomString.

@Test
public void testRandomString() {
    FunctionInterface fi = fff.getInstance(cl, "RandomString");
    fi.reset();
    fi.insertIntegerOperand(10);
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(String.class, o.getClass());
}
Also used : FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) Test(org.junit.Test)

Example 49 with FunctionInterface

use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.

the class StandardFunctionsTest method testGetPropertyType.

@Test
public void testGetPropertyType() {
    FunctionInterface fi = fff.getInstance(cl, "GetPropertyType");
    fi.reset();
    fi.setInMessage(createTestNavajo());
    fi.insertStringOperand("/Single/Selectie");
    Object o = fi.evaluateWithTypeChecking();
    assertEquals("selection", o.toString());
}
Also used : FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) Test(org.junit.Test)

Example 50 with FunctionInterface

use of com.dexels.navajo.expression.api.FunctionInterface in project navajo by Dexels.

the class StandardFunctionsTest method testCheckUrl.

@Test
public void testCheckUrl() {
    FunctionInterface fi = fff.getInstance(cl, "CheckUrl");
    fi.reset();
    fi.insertStringOperand("http://www.dexels.com");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Boolean.class, o.getClass());
}
Also used : FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) Test(org.junit.Test)

Aggregations

FunctionInterface (com.dexels.navajo.expression.api.FunctionInterface)161 Test (org.junit.Test)153 Navajo (com.dexels.navajo.document.Navajo)26 FunctionDefinition (com.dexels.navajo.expression.api.FunctionDefinition)20 ArrayList (java.util.ArrayList)16 Date (java.util.Date)16 Operand (com.dexels.navajo.document.Operand)10 GiveLongTestFunction (com.dexels.navajo.expression.compiled.GiveLongTestFunction)10 TMLExpressionException (com.dexels.navajo.expression.api.TMLExpressionException)7 CapString (com.dexels.navajo.functions.CapString)7 StringReader (java.io.StringReader)5 ContextExpression (com.dexels.navajo.expression.api.ContextExpression)4 AddTestFunction (com.dexels.navajo.expression.compiled.AddTestFunction)4 Binary (com.dexels.navajo.document.types.Binary)3 CheckInteger (com.dexels.navajo.functions.CheckInteger)3 SimpleDateFormat (java.text.SimpleDateFormat)3 List (java.util.List)3 Message (com.dexels.navajo.document.Message)2 Property (com.dexels.navajo.document.Property)2 ClockTime (com.dexels.navajo.document.types.ClockTime)2