Package com.salas.bb.domain

Examples of com.salas.bb.domain.StandardGuide


     * @throws SQLException         if database fails.
     */
    public void testInsertGuide()
        throws PersistenceException, SQLException
    {
        StandardGuide standardGuide = new StandardGuide();
        standardGuide.setAutoFeedsDiscovery(!standardGuide.isAutoFeedsDiscovery());
        standardGuide.setIconKey("iconKey");
        standardGuide.setTitle("title");
        standardGuide.setPublishingPublic(true);
        standardGuide.setPublishingRating(2);
        standardGuide.setNotificationsAllowed(false);

        manager.insertGuide(standardGuide, 0);
        pm.commit();

        assertGuide(standardGuide);
View Full Code Here


     * @throws SQLException         if database fails.
     */
    public void testUpdateGuide()
        throws PersistenceException, SQLException
    {
        StandardGuide standardGuide = new StandardGuide();
        standardGuide.setTitle("title");
        standardGuide.setPublishingPublic(true);
        standardGuide.setPublishingRating(2);
        standardGuide.setNotificationsAllowed(true);

        manager.insertGuide(standardGuide, 0);
        pm.commit();

        standardGuide.setTitle("title2");
        standardGuide.setPublishingPublic(false);
        standardGuide.setPublishingRating(1);
        standardGuide.setNotificationsAllowed(false);
        manager.updateGuide(standardGuide, 0);
        pm.commit();

        assertGuide(standardGuide);
    }
View Full Code Here

     */
    public void testMovingGuide()
        throws PersistenceException, SQLException
    {
        // Add guides
        StandardGuide guide0 = new StandardGuide();
        guide0.setTitle("0");
        set.add(guide0);
        manager.insertGuide(guide0, 0);
        pm.commit();

        StandardGuide guide1 = new StandardGuide();
        guide1.setTitle("1");
        manager.insertGuide(guide1, 1);
        set.add(1, guide1);
        pm.commit();

        // Check if the order is initially right
        GuidesSet s = new GuidesSet();
        pm.loadGuidesSet(s);
        assertEquals(2, s.getGuidesCount());
        assertEquals(guide0.getID(), s.getGuideAt(0).getID());

        // Move the second guide to top and check again
        set.relocateGuide(guide1, 0);
        pm.updateGuidePositions(set);

        s = new GuidesSet();
        pm.loadGuidesSet(s);
        assertEquals(2, s.getGuidesCount());
        assertEquals(guide1.getID(), s.getGuideAt(0).getID());
    }
View Full Code Here

     * @throws SQLException         if database fails.
     */
    public void testDeleteGuide()
        throws PersistenceException, SQLException
    {
        StandardGuide standardGuide = new StandardGuide();
        standardGuide.setTitle("title");

        manager.insertGuide(standardGuide, 0);
        pm.commit();

        manager.removeGuide(standardGuide);
View Full Code Here

        throws PersistenceException
    {
        pm.loadGuidesSet(set);
        assertEquals("No guide.", 1, set.getGuidesCount());

        StandardGuide loadedGuide = (StandardGuide)set.getGuideAt(0);
        assertEquals("Wrong guide.", aStandardGuide, loadedGuide);

        assertEquals(aStandardGuide.isPublishingPublic(), loadedGuide.isPublishingPublic());
        assertEquals(aStandardGuide.getPublishingRating(), loadedGuide.getPublishingRating());
    }
View Full Code Here

        boolean delete = false;
        if (!dialog.hasBeenCanceled())
        {
            if (dialog.isReassigning())
            {
                final StandardGuide destGuide = dialog.getSelectedReassignGuide();
                GlobalController.SINGLETON.mergeGuides(guidesToDelete, destGuide);

                delete = false;
            } else
            {
View Full Code Here

        {
            final String title = dialog.getGuideTitle();
            final String iconKey = dialog.getIconKey();
            final boolean autoFeedDiscovery = dialog.isAutoFeedDiscovery();

            StandardGuide guide = controller.createStandardGuide(title, iconKey, autoFeedDiscovery);
            if (guide != null)
            {
                // Propagate publishing information
                boolean publishingEnabled = dialog.isPublishingEnabled();
                guide.setPublishingEnabled(publishingEnabled);
                guide.setPublishingTitle(dialog.getPublishingTitle());
                guide.setPublishingTags(dialog.getPublishingTags());
                guide.setPublishingPublic(dialog.isPublishingPublic());
                guide.setPublishingRating(dialog.getPublishingRating() - 1);

                guide.setNotificationsAllowed(dialog.isNotificationsAllowed());

                ReadingList[] readingLists = dialog.getReadingLists();
                if (readingLists != null)
                {
                    for (ReadingList readingList : readingLists) guide.add(readingList);

                    // if there were reading lists -- update them immediately
                    if (readingLists.length > 0) controller.getPoller().update(guide);
                }
View Full Code Here

TOP

Related Classes of com.salas.bb.domain.StandardGuide

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.