@Test
  public void testStringStringFunction() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "StringFunction");
    fi.reset();
    fi.insertOperand("indexOf");
    fi.insertOperand("Apenoot");
    fi.insertOperand("n");

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());

    fi.reset();
    fi.insertOperand("substring");
    fi.insertOperand("Apenoot");
    fi.insertOperand(new Integer(0));
    fi.insertOperand(new Integer(4));

    o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(String.class, o.getClass());
  }
  @Test
  public void testSize() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Size");
    fi.reset();
    fi.insertOperand("NOOT");

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
    assertEquals("4", o.toString());

    fi.reset();
    fi.insertOperand(createTestNavajo().getMessage("Aap"));

    o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
    assertEquals("1", o.toString());

    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(new Integer(10));
    list.add(new Integer(10));
    fi.reset();
    fi.insertOperand(list);

    o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
    assertEquals("2", o.toString());
  }
  @Test
  public void testToMilliseconds() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToMilliseconds");
    fi.reset();
    fi.insertOperand(new StopwatchTime(20));
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());

    fi.reset();
    fi.insertOperand(new ClockTime(new java.util.Date()));
    o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Long.class, o.getClass());
  }
  @Test
  public void testWeekday() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "WeekDay");
    fi.reset();
    fi.insertOperand(new java.util.Date());
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(o.getClass(), String.class);

    fi.reset();
    Object o2 = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(o.getClass(), String.class);

    assertEquals(o.toString(), o2.toString());
  }
  @Test
  public void testAbs() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Abs");

    // Test Integer.
    fi.reset();
    fi.insertOperand(new Integer(-10));
    Object o = fi.evaluateWithTypeChecking();
    assertEquals(o.getClass(), Integer.class);
    assertEquals(((Integer) o).intValue(), 10);

    // Test Double.
    fi.reset();
    fi.insertOperand(new Double(-10));
    o = fi.evaluateWithTypeChecking();
    assertEquals(o.getClass(), Double.class);
    assertEquals(((Double) o).intValue(), 10);

    // Test bogus.
    boolean bogus = false;
    fi.reset();
    fi.insertOperand(new String("-10"));
    try {
      o = fi.evaluateWithTypeChecking();
    } catch (TMLExpressionException e) {
      bogus = true;
    }
    assertTrue(bogus);

    // Test null.
    fi.reset();
    fi.insertOperand(null);
    o = fi.evaluateWithTypeChecking();
    assertNull(o);

    // Test empty parameters.
    boolean empty = false;
    fi.reset();
    try {
      o = fi.evaluateWithTypeChecking();
    } catch (TMLExpressionException e) {
      empty = true;
    }
    assertTrue(empty);
  }
  @Test
  public void testWait() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Wait");
    fi.reset();
    fi.insertOperand(new Integer(10));
    Object o = fi.evaluateWithTypeChecking();
    assertNull(o);
  }
  @Test
  public void testUnicode() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Unicode");
    fi.reset();
    fi.insertOperand("10");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
  }
  @Test
  public void testCurrentTimeMillis() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "CurrentTimeMillis");
    fi.reset();

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(String.class, o.getClass());
  }
  @Test
  public void testToLower() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToLower");
    fi.reset();
    fi.insertOperand("AAP");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals("aap", o.toString());
  }
  @Test
  public void testToStopwatchTime() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToStopwatchTime");
    fi.reset();
    fi.insertOperand(new java.util.Date());
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(StopwatchTime.class, o.getClass());
  }
  @Test
  public void testToMemo() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToMemo");
    fi.reset();
    fi.insertOperand(new String("20"));
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Memo.class, o.getClass());
  }
  @Test
  public void testToBinaryFromUrl() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToBinaryFromUrl");
    fi.reset();
    fi.insertOperand("http://www.google.com/google.jpg");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Binary.class, o.getClass());
  }
  @Test
  public void testToBinaryFromPath() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToBinaryFromPath");
    fi.reset();
    fi.insertOperand("/aeap");
    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
  }
  @Test
  public void testXmlEscape() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "XmlEscape");
    fi.reset();
    fi.insertOperand("aap");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(o.getClass(), String.class);
  }
  @Test
  public void testCheckUrl() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "CheckUrl");
    fi.reset();
    fi.insertOperand("http://www.dexels.com");

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Boolean.class, o.getClass());
  }
  @Test
  public void testEuro() throws Exception {

    DispatcherFactory df = new DispatcherFactory(new TestDispatcher(new TestNavajoConfig()));

    FunctionInterface fi = fff.getInstance(cl, "Euro");
    fi.reset();

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
  }
  @Test
  public void testGetMimeType() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "GetMimeType");
    fi.reset();
    fi.insertOperand(null);

    Object o = fi.evaluateWithTypeChecking();

    assertNull(o);
  }
  @Test
  public void testDecimalChar() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "DecimalChar");
    fi.reset();
    fi.insertOperand(10046);

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(String.class, o.getClass());
  }
  @Test
  public void testDate() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Date");
    fi.reset();
    fi.insertOperand("2008-01-01");

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(java.util.Date.class, o.getClass());
  }
  @Test
  public void testToClockTime() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToClockTime");
    fi.reset();
    fi.insertOperand("10:00");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals("10:00:00", o.toString());
    assertEquals(ClockTime.class, o.getClass());
  }
  @Test
  public void testCreateExpression() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "CreateExpression");
    fi.reset();
    fi.insertOperand("aap");

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(String.class, o.getClass());
  }
  @Test
  public void testGetUrlMimeType() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "GetUrlMimeType");
    fi.reset();
    fi.insertOperand("http://www.dexels.com/index.php");

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
  }
  @Test
  public void testRandom() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Random");
    fi.reset();

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
  }
  @Test
  public void testIsNull() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "IsNull");
    fi.reset();
    fi.insertOperand(null);

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertEquals("true", o.toString());
  }
  @Test
  public void testParseSelection() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ParseSelection");
    fi.reset();
    fi.insertOperand("aap,noot,mies");

    Object o = fi.evaluateWithTypeChecking();

    assertNotNull(o);
    assertTrue(o.getClass().isArray());
  }
  @Test
  public void testGetCurrentMessage() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "GetCurrentMessage");
    fi.reset();
    fi.setInMessage(createTestNavajo());
    Navajo doc = createTestNavajo();

    Object o = fi.evaluateWithTypeChecking();

    assertNull(o);
  }
  @Test
  public void testZip() throws Exception {

    Binary b = new Binary(new byte[] {1, 1, 1});
    FunctionInterface fi = fff.getInstance(cl, "Zip");
    fi.reset();
    fi.insertOperand(b);
    fi.insertOperand("aap");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(o.getClass(), Binary.class);
  }
  @Test
  public void testExistsProperty() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ExistsProperty");
    fi.reset();
    fi.setInMessage(createTestNavajo());
    fi.insertOperand("/Single/Selectie");

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals("true", o.toString());
  }
  @Test
  public void testAge() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "Age");
    fi.reset();
    fi.setInMessage(createTestNavajo());
    fi.insertOperand(new java.util.Date());

    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Integer.class, o.getClass());
  }
  @Test
  public void testToSecureImage() throws Exception {

    FunctionInterface fi = fff.getInstance(cl, "ToSecureImage");
    fi.reset();
    fi.insertOperand("SECURE");
    Object o = fi.evaluateWithTypeChecking();
    assertNotNull(o);
    assertEquals(Binary.class, o.getClass());

    fi.reset();
    fi.insertOperand(null);
    o = fi.evaluateWithTypeChecking();
    assertNull(o);

    System.err.println(System.currentTimeMillis());
    long l = (new Long("1234567890000").longValue() - System.currentTimeMillis());
    Calendar c = Calendar.getInstance();
    c.add(Calendar.MILLISECOND, (int) l);
    System.err.println(SimpleDateFormat.getInstance().format(c.getTime()));
  }