@Test
public void testRankBadArgs() throws Exception {

    Over func = new Over();
    DataBag inbag = BagFactory.getInstance().newDefaultBag();
    for (int i = 0; i < 10; i++) {
        Tuple t = TupleFactory.getInstance().newTuple(1);
        t.set(0, i);
        inbag.add(t);
    }
    Tuple t = TupleFactory.getInstance().newTuple(5);
    t.set(0, inbag);
    t.set(1, "rank");
    t.set(2, -1);
    t.set(3, -1);
    t.set(4, "fred");
    boolean caught = false;
    try {
        DataBag outbag = func.exec(t);
    } catch (ExecException ioe) {
        caught = true;
        assertTrue(ioe.getMessage().contains("Rank expected column number"));
    }
    assertTrue(caught);
}