Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.Tab


                allowing(tabGroupMapper).undeleteTab(tabId.longValue());
                will(returnValue(undeletedTab));
            }
        });

        Tab actual = sut.execute(actionContext);

        assertEquals("The undeleteTab action didn't return the expected Tab", undeletedTab, actual);

        context.assertIsSatisfied();
    }
View Full Code Here


                oneOf(tabMapper).findById(tab1.getId());
                will(returnValue(tab1));
            }
        });

        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab1, resultTab);

        // verify mock assertions
View Full Code Here

                will(returnValue(tab1));
            }
        });

        // Perform the action
        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab1, resultTab);

        // verify mock assertions
View Full Code Here

                will(returnValue(tab2));
            }
        });

        // Perform the action
        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab2, resultTab);

        // verify mock assertions
View Full Code Here

                will(returnValue(tab1));
            }
        });

        // Perform the action
        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab1, resultTab);

        // verify mock assertions
View Full Code Here

                will(returnValue(tab1));
            }
        });

        // Perform the action
        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab1, resultTab);

        // verify mock assertions
View Full Code Here

                will(returnValue(tab1));
            }
        });

        // Perform the action
        Tab resultTab = sut.execute(actionContext);

        // make sure the right tab was returned
        assertSame(tab1, resultTab);

        // verify mock assertions
View Full Code Here

     * Test deleting a gadget, then undeleting it.
     */
    @Test
    public void testDeleteThenUndelete()
    {
        Tab tab = jpaTabMapper.findById(fordsFirstTabId);
        Gadget fordGadget1 = jpaGadgetMapper.findById(fordsFirstTabFirstGadgetId);

        final int expectedGadgetCountAfterDeletingAndUndeleting = 3;

        // delete the first gadget
        try
        {
            jpaTabMapper.deleteGadget(fordGadget1);
        }
        catch (GadgetDeletionException e)
        {
            throw new RuntimeException(e);
        }
        jpaTabMapper.flush();

        // clear the getEntityManager() so we can re-query the collection
        getEntityManager().clear();

        try
        {
            jpaTabMapper.undeleteGadget(fordsFirstTabFirstGadgetId);
        }
        catch (GadgetUndeletionException e)
        {
            throw new RuntimeException(e);
        }
        jpaTabMapper.flush();

        // clear the getEntityManager() so we can re-query the collection
        getEntityManager().clear();

        // re-get and assert
        tab = jpaTabMapper.findById(fordsFirstTabId);
        assertEquals("Expected 3 gadgets in Ford's startPage after deleting and undeleting.",
                expectedGadgetCountAfterDeletingAndUndeleting, tab.getGadgets().size());

        assertEquals("Expected the undeleted gadget to be 1st again.", fordsFirstTabFirstGadgetId, tab.getGadgets()
                .get(0).getId());

        assertEquals("Expected the previously 1st gadget to be 2nd after deleting and undeleting the first",
                fordsFirstTabSecondGadgetId, tab.getGadgets().get(1).getId());

        assertEquals("Expected the previously 2nd gadget to be 3rd after deleting and undeleting the first",
                fordsFirstTabThirdGadgetId, tab.getGadgets().get(2).getId());
    }
View Full Code Here

     * Test deleting the only gadget in a zone, then undeleting it.
     */
    @Test
    public void testDeleteThenUndeleteTheOnlyGadgetOnAPage()
    {
        Tab tab = jpaTabMapper.findById(carlsFirstTabId);
        Gadget carlGadget1 = jpaGadgetMapper.findById(carlsFirstTabFirstGadgetId);

        final int expectedGadgetCountAfterDeletingAndUndeleting = 1;

        // delete the first gadget
        try
        {
            jpaTabMapper.deleteGadget(carlGadget1);
        }
        catch (GadgetDeletionException e)
        {
            throw new RuntimeException(e);
        }
        jpaTabMapper.flush();

        // clear the getEntityManager() so we can re-query the collection
        getEntityManager().clear();

        try
        {
            jpaTabMapper.undeleteGadget(carlsFirstTabFirstGadgetId);
        }
        catch (GadgetUndeletionException e)
        {
            throw new RuntimeException(e);
        }
        jpaTabMapper.flush();

        // clear the getEntityManager() so we can re-query the collection
        getEntityManager().clear();

        // re-get and assert
        tab = jpaTabMapper.findById(carlsFirstTabId);
        assertEquals("Expected 1 gadget in Carl's startPage after deleting and undeleting.",
                expectedGadgetCountAfterDeletingAndUndeleting, tab.getGadgets().size());

        assertEquals("Expected the undeleted gadget to be 1st again.", carlsFirstTabFirstGadgetId, tab.getGadgets()
                .get(0).getId());
    }
View Full Code Here

     *             thrown on error during gadget deletion.
     */
    @Test
    public void testDeletedRecordRemainsAvailableinDBForUndelete() throws GadgetDeletionException
    {
        Tab fordsTab = jpaTabMapper.findById(fordsFirstTabId);
        Gadget fordGadget1 = jpaGadgetMapper.findById(fordsFirstTabFirstGadgetId);

        // delete the first gadget of the first tab
        jpaTabMapper.deleteGadget(fordGadget1);
        jpaTabMapper.flush();

        Boolean deletedFlag = (Boolean) getEntityManager().createQuery(
                "select deleted from Gadget where id = :gadgetId and "
                        + "tabTemplateId = :tabTemplateId and deleted = true").setParameter("tabTemplateId",
                fordsTab.getTemplate().getId()).setParameter("gadgetId", fordsFirstTabFirstGadgetId).getSingleResult();

        assertEquals("Expected that after deleting a gadget, it's still tied to the " + "tab, the gadgetIndex is null,"
                + " and the gadget is marked as deleted", true, deletedFlag.booleanValue());
    }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.domain.Tab

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.