private void testEvaluateWithUDF(GenericUDF udfToTest) throws HiveException, InterruptedException {
    HiveConf conf = new HiveConfForTest(getClass());
    conf.setVar(HiveConf.ConfVars.HIVE_DATETIME_FORMATTER, formatter);
    conf.setVar(HiveConf.ConfVars.HIVE_LOCAL_TIME_ZONE, zone);
    conf.setVar(HiveConf.ConfVars.HIVE_DATETIME_RESOLVER_STYLE, resolverStyle);
    SessionState state = SessionState.start(conf);
    udfToTest.initialize(argInspectors);
    LongWritable result = (LongWritable) udfToTest.evaluate(
        new DeferredObject[] { new DeferredJavaObject(new Text(value)), new DeferredJavaObject(new Text(pattern)) });
    assertEquals(udfDisplayWithInputs(udfToTest), expectedResult, result);
    SessionState.endStart(state);
  }
Tests for {@link GenericUDFToUnixTimeStamp#evaluate(DeferredObject[])} with string value and pattern inputs.
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFToUnixTimestampEvaluateStringString.java