@Test
    public void testOneArg() throws HiveException {
        GenericUDFDeserialize udf = new GenericUDFDeserialize();
        ObjectInspector valueOI1 = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
        ObjectInspector valueOI2 = PrimitiveObjectInspectorFactory.writableStringObjectInspector;
        UDFArgumentException ex = null;
        try {
            udf.initialize(new ObjectInspector[]{valueOI1});
        } catch (UDFArgumentException e) {
            ex = e;
        }
        assertTrue(ex.getMessage().contains("The function deserialize accepts 2 arguments."));
        assertNotNull("The function deserialize() accepts 2 argument.", ex);
        ex = null;
        try {
            udf.initialize(new ObjectInspector[]{valueOI2, valueOI1});
        } catch (UDFArgumentException e) {
            ex = e;
        }
        assertNull("The function deserialize() accepts 2 argument.", ex);
    }
TestGenericUDFDeserialize:
Utility to test the behaviour of GenericUDFDeserialize.
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFDeserialize.java