@Test
    public void testGZIPBase64Compression() throws HiveException {
        GenericUDFDeserialize udf = new GenericUDFDeserialize();
        udf.initialize(new ObjectInspector[]{PrimitiveObjectInspectorFactory.writableStringObjectInspector,
                PrimitiveObjectInspectorFactory.writableStringObjectInspector});
        GenericUDF.DeferredObject[] args = new GenericUDF.DeferredObject[2];
        String expectedOutput = "test";
        MessageEncoder encoder = MessageFactory.getDefaultInstanceForReplMetrics(new HiveConf());
        String serializedMsg = encoder.getSerializer().serialize(expectedOutput);
        args[0] = new GenericUDF.DeferredJavaObject(new Text(serializedMsg));
        args[1] = new GenericUDF.DeferredJavaObject(new Text(encoder.getMessageFormat()));
        Object actualOutput = udf.evaluate(args).toString();
        assertEquals("deserialize() test", expectedOutput, actualOutput != null ? actualOutput : null);
    }
TestGenericUDFDeserialize:
Utility to test the behaviour of GenericUDFDeserialize.
ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFDeserialize.java