Package org.eurekastreams.server.domain

Examples of org.eurekastreams.server.domain.TabGroup


        else
        {
            person.setTheme(new Theme("", "", "", dto.getThemeCssFile(), "", "", "", ""));
        }

        TabGroup startTabGroup = new TabGroup();

        for (TabDTO tabDTO : dto.getTabDTOs())
        {
            Tab tab = new Tab(tabDTO.getTabName(), tabDTO.getTabLayout(), tabDTO.getId());
            tab.setTabIndex(tabDTO.getTabIndex());
            List<Gadget> gadgets = new ArrayList<Gadget>();

            for (GadgetDTO gadgetDTO : tabDTO.getGadgets())
            {
                GadgetDefinition gadgetDef = new GadgetDefinition(gadgetDTO.getGadgetDefinition().getUrl(), gadgetDTO
                        .getGadgetDefinition().getUuid());
                gadgetDef.setId(gadgetDTO.getGadgetDefinition().getId());
                Gadget gadget = new Gadget(gadgetDef, gadgetDTO.getZoneNumber(), gadgetDTO.getZoneIndex(), null,
                        gadgetDTO.getGadgetUserPref());
                gadget.setId(gadgetDTO.getId());
                gadget.setMaximized(gadgetDTO.isMaximized());
                gadget.setMinimized(gadgetDTO.isMinimized());
                gadgets.add(gadget);
            }

            tab.setGadgets(gadgets);
            startTabGroup.addTab(tab);
        }

        person.setStartTabGroup(startTabGroup);

        return person;
View Full Code Here


    @Test
    public final void testUpdateList() throws Exception
    {
        String message = "lists should be set appropriately";

        TabGroup sut = new TabGroup();

        ArrayList<Tab> tabs = new ArrayList<Tab>();
        tabs.add(new Tab("name", Layout.ONECOLUMN));
        HashMap<String, Serializable> map = new HashMap<String, Serializable>();
        map.put("tabs", tabs);

        ReflectiveUpdater reflector = new ReflectiveUpdater();
        reflector.setProperties(sut, map);

        assertEquals(message, tabs, sut.getTabs());
    }
View Full Code Here

     */
    @Test
    public void testDBUnitDatasetTabs()
    {
        Person ford = jpaPersonMapper.findByAccountId("fordp");
        TabGroup tabGroup = ford.getStartTabGroup();
        List<Tab> tabs = tabGroup.getTabs();

        // Assert the order is 1,2,3
        assertEquals("Expected Ford's first tab in his first TabGroup to be called 'Ford Tab 1' from DBUnit setup.",
                "Ford Tab 1", tabs.get(0).getTabName());
        assertEquals("Expected Ford's first tab in his first TabGroup to be called 'Ford Tab 2' from DBUnit setup.",
View Full Code Here

     */
    @Test
    public void testInsert()
    {
        final long id = 4231L;
        TabGroup tg = jpaTabGroupMapper.findById(id);

        Person p = new Person("ndtyson", "Neil", "d", "deGrasse Tyson", "Dr. To You");
        p.setWorkPhone("1234567890");
        p.setTitle("Better than you!");
        p.setEmail("foo.blah@example.com");
View Full Code Here

     */
    @Test
    public void testInsertWithProfileProperties()
    {
        final long id = 4231L;
        TabGroup tg = jpaTabGroupMapper.findById(id);

        Person p = new Person("yoyojoe", "Joe", "hey", "Yoyo", "Call Me Joe");
        p.setWorkPhone("1234567890");
        p.setTitle("Better than you!");
        p.setEmail("foo.blah@example.com");
View Full Code Here

    {
        final int expectedTabCount = 3;

        // Load Ford, and rearrange his tabs
        Person ford = jpaPersonMapper.findByAccountId("fordp");
        TabGroup tabGroup = ford.getStartTabGroup();
        List<Tab> tabs = tabGroup.getTabs();

        Tab t2 = tabs.get(1);
        tabs.remove(t2);
        tabs.add(t2);

        // update all modified entities
        jpaPersonMapper.flush();

        // clear the entity manager
        getEntityManager().clear();

        // reload
        ford = jpaPersonMapper.findByAccountId("fordp");
        tabGroup = ford.getStartTabGroup();
        tabs = tabGroup.getTabs();

        // assert there's 3 tabs
        assertEquals("Ford Prefect should have 3 (non-deleted) tabs in the DBUnit fixture", expectedTabCount, tabs
                .size());
View Full Code Here

        DummyUpdater dummyUpdater = new DummyUpdater();
        Person.setEntityCacheUpdater(dummyUpdater);

        final long id = 4231L;

        TabGroup tg = jpaTabGroupMapper.findById(id);

        Person p = new Person("ndtyson", "Neil", "d", "deGrasse Tyson", "Dr. To You");
        p.setWorkPhone("1234567890");
        p.setTitle("Better than you!");
        p.setEmail("foo.blah@example.com");
View Full Code Here

    @Test
    public void testDBUnitDatasetTabs()
    {
        final int expectedTabCount = 3;

        TabGroup tabGroup = jpaTabGroupMapper.findById(fordsStartPageId);
        List<Tab> tabs = tabGroup.getTabs();

        assertEquals("Expected the DBUnit-loaded TabGroup with ID=" + fordsStartPageId + " to have " + expectedTabCount
                + "(non-deleted) tabs", expectedTabCount, tabs.size());

        // Assert the order is 1,2,3
View Full Code Here

     * Test persisting a start tabGroup.
     */
    @Test
    public void testInsert()
    {
        TabGroup p = new TabGroup();
        jpaTabGroupMapper.insert(p);
        assertTrue(p.getId() > 0);
    }
View Full Code Here

     * Test adding a tab to a tab group persists when we update the tab group.
     */
    @Test
    public void testUpdateAddNewTab()
    {
        TabGroup tabGroup = jpaTabGroupMapper.findById(fordsStartPageId);
        tabGroup.getTabs().add(new Tab("Foo", Layout.THREECOLUMN));
        jpaTabGroupMapper.insert(tabGroup);

        getEntityManager().flush();
        getEntityManager().clear();

        tabGroup = jpaTabGroupMapper.findById(fordsStartPageId);
        assertEquals("Attemped updating a Person after adding a Tab to his first "
                + "TabGroup, then flushing and clearing the EntityManager.  "
                + "Expected to see the new tab after re-loading the Person.", "Foo", tabGroup.getTabs().get(
                tabGroup.getTabs().size() - 1).getTabName());
    }
View Full Code Here

TOP

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

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.