Search in sources :

Example 6 with StopwatchTime

use of com.dexels.navajo.document.types.StopwatchTime in project navajo by Dexels.

the class StandardFunctionsTest method testToMilliseconds.

@Test
public void testToMilliseconds() {
    FunctionInterface fi = fff.getInstance(cl, "ToMilliseconds");
    fi.reset();
    fi.insertStopwatchOperand(new StopwatchTime(20));
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
    fi.reset();
    fi.insertClockTimeOperand(new ClockTime(new Date()));
    o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Long.class, o.getClass());
}
Also used : StopwatchTime(com.dexels.navajo.document.types.StopwatchTime) FunctionInterface(com.dexels.navajo.expression.api.FunctionInterface) ClockTime(com.dexels.navajo.document.types.ClockTime) Date(java.util.Date) Test(org.junit.Test)

Aggregations

StopwatchTime (com.dexels.navajo.document.types.StopwatchTime)6 ClockTime (com.dexels.navajo.document.types.ClockTime)5 Date (java.util.Date)4 Money (com.dexels.navajo.document.types.Money)3 Percentage (com.dexels.navajo.document.types.Percentage)3 Test (org.junit.Test)3 ExpressionChangedException (com.dexels.navajo.document.ExpressionChangedException)1 Navajo (com.dexels.navajo.document.Navajo)1 NavajoException (com.dexels.navajo.document.NavajoException)1 Property (com.dexels.navajo.document.Property)1 PropertyTypeException (com.dexels.navajo.document.PropertyTypeException)1 Binary (com.dexels.navajo.document.types.Binary)1 BinaryDigest (com.dexels.navajo.document.types.BinaryDigest)1 Coordinate (com.dexels.navajo.document.types.Coordinate)1 DatePattern (com.dexels.navajo.document.types.DatePattern)1 NavajoExpression (com.dexels.navajo.document.types.NavajoExpression)1 FunctionInterface (com.dexels.navajo.expression.api.FunctionInterface)1 TMLExpressionException (com.dexels.navajo.expression.api.TMLExpressionException)1 IOException (java.io.IOException)1 NumberFormat (java.text.NumberFormat)1