Example usage for java.io ObjectStreamClass lookup

List of usage examples for java.io ObjectStreamClass lookup

Introduction

In this page you can find the example usage for java.io ObjectStreamClass lookup.

Prototype

public static ObjectStreamClass lookup(Class<?> cl) 

Source Link

Document

Find the descriptor for a class that can be serialized.

Usage

From source file:ponzu.impl.test.Verify.java

public static void assertSerializedForm(long expectedSerialVersionUID, String expectedBase64Form,
        Object actualObject) {//from ww  w. ja  va  2s .  c o m
    try {
        assertInstanceOf(Serializable.class, actualObject);

        assertEquals("Serialization was broken. Contact a senior architect for approval.", expectedBase64Form,
                encodeObject(actualObject));

        Object decodeToObject = decodeObject(expectedBase64Form);

        Assert.assertEquals("serialVersionUID's differ", expectedSerialVersionUID,
                ObjectStreamClass.lookup(decodeToObject.getClass()).getSerialVersionUID());
    } catch (AssertionError e) {
        throwMangledException(e);
    }
}