runAndVerify("hi", 1, "??", "h", udf);
}
private void runAndVerify(String str, int len, String pad, String expResult, GenericUDF udf)
throws HiveException {
DeferredObject valueObj1 = new DeferredJavaObject(new Text(str));
DeferredObject valueObj2 = new DeferredJavaObject(new IntWritable(len));
DeferredObject valueObj3 = new DeferredJavaObject(new Text(pad));
DeferredObject[] args = { valueObj1, valueObj2, valueObj3 };
Text output = (Text) udf.evaluate(args);
assertEquals("lpad() test ", expResult, output.toString());
}