Package com.apress.progwt.client.domain

Examples of com.apress.progwt.client.domain.SchoolForumPost


        currentCommand = fc;
        if (fc.getType().equals("School")) {
            School s = new School(fc.getId());
            gotoSchool(s, fc.getStart(), fc.isCreate());
        } else if (fc.getType().equals("SchoolForumPost")) {
            ForumPost fp = new SchoolForumPost();
            fp.setId(fc.getId());
            gotoThread(fp, fc.getStart(), fc.isCreate());
        } else if (fc.getType().equals("User")) {
            User u = new User();
            u.setId(fc.getId());
            gotoUser(u, fc.getStart(), fc.isCreate());
        } else if (fc.getType().equals("UserForumPost")) {
            ForumPost fp = new UserForumPost();
            fp.setId(fc.getId());
            gotoThread(fp, fc.getStart(), fc.isCreate());
        } else if (fc.getType().equals("RecentForumPost")) {
            gotoForum(new RecentForumPostTopic(), fc.getStart(), false,
                    FORUM_THREAD_MAX, fc.isCreate());
        } else {
View Full Code Here


                assertNotNull(sc);

                User currentUser = getUser();
                assertNotNull(currentUser);

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

                schoolService.executeAndSaveCommand(
                        new SaveForumPostCommand(fp), false);
            }
View Full Code Here

        assertNotNull(sc);

        User currentUser = getUser();
        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);
View Full Code Here

        User u = userDAO.getUserByUsername("test");
        assertNotNull(u);

        // Create a first thread for this school
        ForumPost post = new SchoolForumPost(sc, u, A, A, null);
        post = (ForumPost) schoolDAO.save(post);

        threads = schoolDAO.getSchoolThreads(sc.getId(), 0, 10);
        assertEquals(1, threads.getTotalCount());
        assertEquals(1, threads.getPosts().size());

        ForumPost saved = threads.getPosts().get(0);
        assertNotNull(saved.getDate());
        assertEquals(sc, saved.getTopic());

        // save a second post in the same thread
        ForumPost post2 = new SchoolForumPost(sc, u, null, A, saved);
        post2 = (ForumPost) schoolDAO.save(post2);

        // should only be 1 top level thread still.
        threads = schoolDAO.getSchoolThreads(sc.getId(), 0, 10);
        assertEquals(1, threads.getTotalCount());
View Full Code Here

        User au = new User();
        au.setId(77);
        au.setUsername("Author");

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

        SaveForumPostCommand command = new SaveForumPostCommand(fp);

        MockCommandService commandService = new MockCommandService(
                command);
View Full Code Here

        User au = new User();
        au.setId(77);
        au.setUsername("Author");

        ForumPost fp = new SchoolForumPost(sc, au, TEXT_XSS, TEXT_XSS,
                null);

        SaveForumPostCommand command = new SaveForumPostCommand(fp);

        MockCommandService commandService = new MockCommandService(
View Full Code Here

TOP

Related Classes of com.apress.progwt.client.domain.SchoolForumPost

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.