Package com.apress.progwt.client.domain.commands

Examples of com.apress.progwt.client.domain.commands.SaveForumPostCommand


                    null);
        }

        Log.debug("Going to Save " + sfp);

        getServiceCache().executeCommand(new SaveForumPostCommand(sfp),
                new StdAsyncCallback<SiteCommand>("SaveForumPost") {
                    @Override
                    public void onSuccess(SiteCommand result) {
                        super.onSuccess(result);
                        onHistoryChanged(History.getToken());
View Full Code Here


                ForumPost fp = new SchoolForumPost(sc, currentUser,
                        TITLE, TEXT, null);

                schoolService.executeAndSaveCommand(
                        new SaveForumPostCommand(fp), false);
            }
        };

    }
View Full Code Here

        assertNotNull(currentUser);

        ForumPost fp = new SchoolForumPost(sc, currentUser, TITLE, TEXT,
                null);

        executeWithToken(new SaveForumPostCommand(fp), false);

        PostsList posts = schoolService.getForum(sc, 0, 10);

        assertEquals(1, posts.getTotalCount());
        assertEquals(1, posts.getPosts().size());

        ForumPost saved = posts.getPosts().get(0);
        assertNotNull(saved);
        assertEquals(SchoolForumPost.class, saved.getClass());
        assertTrue(saved.getId() > 0);
        assertEquals(TITLE, saved.getPostTitle());
        assertEquals(TEXT, saved.getPostString());
        assertEquals(0, saved.getReplyCount());

        assertEquals(null, saved.getThreadPost());

        assertEquals(currentUser, saved.getAuthor());

        // save a second post to the same thread
        ForumPost fp2 = new SchoolForumPost(sc, currentUser, TITLE, TEXT,
                saved);
        executeWithToken(new SaveForumPostCommand(fp2), false);

        // assert that there's still just 1 top level thread
        posts = schoolService.getForum(sc, 0, 10);
        assertEquals(1, posts.getTotalCount());
        assertEquals(1, posts.getPosts().size());
View Full Code Here

TOP

Related Classes of com.apress.progwt.client.domain.commands.SaveForumPostCommand

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.