Search in sources :

Example 1 with UniqueSerializable

use of com.vaadin.flow.shared.util.UniqueSerializable in project flow by vaadin.

the class UniqueSerializableTest method testUniqueness.

@Test
public void testUniqueness() {
    UniqueSerializable o1 = new UniqueSerializable() {
    };
    UniqueSerializable o2 = new UniqueSerializable() {
    };
    Assert.assertFalse(o1 == o2);
    Assert.assertFalse(o1.equals(o2));
}
Also used : UniqueSerializable(com.vaadin.flow.shared.util.UniqueSerializable) Test(org.junit.Test)

Example 2 with UniqueSerializable

use of com.vaadin.flow.shared.util.UniqueSerializable in project flow by vaadin.

the class UniqueSerializableTest method testSerialization.

@Test
public void testSerialization() {
    UniqueSerializable o1 = new UniqueSerializable() {
    };
    UniqueSerializable d1 = (UniqueSerializable) SerializationUtils.deserialize(SerializationUtils.serialize(o1));
    Assert.assertTrue(d1.equals(o1));
}
Also used : UniqueSerializable(com.vaadin.flow.shared.util.UniqueSerializable) Test(org.junit.Test)

Aggregations

UniqueSerializable (com.vaadin.flow.shared.util.UniqueSerializable)2 Test (org.junit.Test)2