Package org.libreplan.business.util.deepcopy.EntityExamples

Examples of org.libreplan.business.util.deepcopy.EntityExamples.EntityA


        assertTrue(subclass.isAfterCopyHookCalled());
    }

    @Test
    public void equalObjectsButDifferentAreNotReused() {
        EntityA entityA = new EntityA();
        DeepCopy deepCopy = new DeepCopy();
        entityA.setSet1(new HashSet<Object>());
        entityA.setSet2(new HashSet<Object>());
        EntityA copied = deepCopy.copy(entityA);
        assertNotSame(copied.getSet1(), copied.getSet2());
    }
View Full Code Here


        new DeepCopy().copy(entity);
    }

    @Test
    public void stringPropertiesAreShared() {
        EntityA entityA = new EntityA();
        entityA.setStringProperty("foo");
        EntityA copy = new DeepCopy().copy(entityA);
        assertSame(entityA.getStringProperty(), copy.getStringProperty());
    }
View Full Code Here

        assertSame(entityA.getStringProperty(), copy.getStringProperty());
    }

    @Test
    public void intPropertiesAreShared() {
        EntityA entityA = new EntityA();
        EntityA copy = new DeepCopy().copy(entityA);
        assertEquals(entityA.getIntProperty(), copy.getIntProperty());
    }
View Full Code Here

        assertEquals(entityA.getIntProperty(), copy.getIntProperty());
    }

    @Test
    public void nullPropertiesKeepBeingNull() {
        EntityA entityA = new EntityA();
        EntityA copy = new DeepCopy().copy(entityA);
        assertThat(copy.getNullProperty(), nullValue());
    }
View Full Code Here

        assertThat(copy.getNullProperty(), nullValue());
    }

    @Test
    public void enumPropertiesAreShared() {
        EntityA entityA = new EntityA();
        entityA.setEnumProperty(TestEnum.A);
        EntityA copy = new DeepCopy().copy(entityA);
        assertSame(TestEnum.A, copy.getEnumProperty());
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.util.deepcopy.EntityExamples.EntityA

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.