Package org.sete.common

Examples of org.sete.common.CreateUpdateDeleteGroup


     *
     * @throws Exception
     */
    @Test
    public void testEmptyCurrentSetWithNullUpdateList() throws Exception {
        CreateUpdateDeleteGroup group =
                            CollectionUtil.separateCreateUpdateDeleteObjects(new HashSet<Identifiable>(),
                                                                             null);

        assertTrue("Create group should be empty.", group.getToBeCreated().isEmpty());
        assertTrue("Update group should be empty.", group.getToBeUpdated().isEmpty());
        assertTrue("Delete group should be empty.", group.getToBeDeleted().isEmpty());
    }
View Full Code Here


        Set<IdentifiableVo> current = new HashSet<IdentifiableVo>();
        current.add(new IdentifiableVo(1));
        current.add(new IdentifiableVo(2));
        current.add(new IdentifiableVo(3));

        CreateUpdateDeleteGroup group =
                            CollectionUtil.separateCreateUpdateDeleteObjects(current,
                                                                             null);

        assertTrue("Create group should be empty.", group.getToBeCreated().isEmpty());
        assertTrue("Update group should be empty.", group.getToBeUpdated().isEmpty());

        Set<IdentifiableVo> deletes = group.getToBeDeleted();
        assertTrue("Delete group size should be equal to Current group size [" + current.size() + "].",
                   deletes.size() == current.size());

        int cnt = 0;
        for(Identifiable deleteId : deletes) {
View Full Code Here

        List<IdentifiableVo> updates = new ArrayList<IdentifiableVo>();
        updates.add(new IdentifiableVo(1));
        updates.add(new IdentifiableVo(2));
        updates.add(new IdentifiableVo(3));

        CreateUpdateDeleteGroup group =
                            CollectionUtil.separateCreateUpdateDeleteObjects(current,
                                                                             updates);

        assertTrue("Delete group should be empty.", group.getToBeDeleted().isEmpty());
        assertTrue("Update group should be empty.", group.getToBeUpdated().isEmpty());

        List<IdentifiableVo> creates = group.getToBeCreated();
        assertTrue("Create group size should be equal to Update group size [" + updates.size() + "].",
                   creates.size() == updates.size());

        int cnt = 0;
        for(Identifiable createId : creates) {
View Full Code Here

        List<IdentifiableVo> updates = new ArrayList<IdentifiableVo>();
        updates.add(new IdentifiableVo(1));
        updates.add(new IdentifiableVo(2));
        updates.add(new IdentifiableVo(3));

        CreateUpdateDeleteGroup group =
                            CollectionUtil.separateCreateUpdateDeleteObjects(current,
                                                                             updates);

        assertTrue("Delete group should be empty.", group.getToBeDeleted().isEmpty());
        assertTrue("Create group should be empty.", group.getToBeCreated().isEmpty());

        Set<IdentifiableVo> toBeUpdated = group.getToBeUpdated();
        assertTrue("Current group size should be equal to Update group size [" + toBeUpdated.size() + "].",
                   current.size() == toBeUpdated.size());

        int cnt = 0;
        for(Identifiable currentId : current) {
View Full Code Here

        updates.add(new IdentifiableVo(4));
        updates.add(new IdentifiableVo(5));
        updates.add(new IdentifiableVo(6));
        updates.add(new IdentifiableVo(7));

        CreateUpdateDeleteGroup group =
                            CollectionUtil.separateCreateUpdateDeleteObjects(current,
                                                                             updates);

        List<IdentifiableVo> toBeCreated = group.getToBeCreated();
        Set<IdentifiableVo> toBeDeleted = group.getToBeDeleted();
        Set<IdentifiableVo> toBeUpdated = group.getToBeUpdated();

        assertEquals("Delete group size is incorrect.", 2, toBeDeleted.size());
        assertEquals("Create group size is incorrect.", 4, toBeCreated.size());
        assertEquals("Update group size is incorrect.", 1, toBeUpdated.size());
View Full Code Here

TOP

Related Classes of org.sete.common.CreateUpdateDeleteGroup

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.