Package com.apress.progwt.client.domain

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


    }

    public void testSaveApplications() throws SiteException {
        log.debug("\n\nSaveratingTypes\n\n");
        School dart = schoolService.getSchoolDetails("Dartmouth College");
        School harvard = schoolService
                .getSchoolDetails("Harvard University");
        School yale = schoolService.getSchoolDetails("Yale University");

        // Save in order to Dart/Harvard/Yale
        SaveSchoolRankCommand comm = new SaveSchoolRankCommand(dart,
                getUser(), 0);
        executeWithToken(comm, false);
View Full Code Here


        assertEquals(B, savedHarvard2.getCons().get(1));

    }

    public void testForumReplies() throws SiteException {
        School s = new School(500);
        PostsList posts = schoolService.getForum(s, 0, 10);

        for (ForumPost fp : posts.getPosts()) {
            System.out.println("fp: " + fp + " REPL "
                    + fp.getReplies().size());
View Full Code Here

        AssertThrows as = new AssertThrows(SiteSecurityException.class) {

            @Override
            public void test() throws Exception {
                log.debug("\n\nSave Again\n\n");
                School sc = schoolService
                        .getSchoolDetails("Adrian College");
                assertNotNull(sc);

                User currentUser = getUser();
                assertNotNull(currentUser);
View Full Code Here

    }

    public void testForumPostSaving() throws SiteException {
        log.debug("\n\nSave Again\n\n");
        School sc = schoolService.getSchoolDetails("Adrian College");
        assertNotNull(sc);

        User currentUser = getUser();
        assertNotNull(currentUser);
View Full Code Here

        assertEquals(currentUser, saved2.getAuthor());

    }

    public void testGetUsersInterestedIn() throws SiteException {
        School jarv = schoolService
                .getSchoolDetails("Jarvis Christian College");
        School harvard = schoolService
                .getSchoolDetails("Harvard University");
        School yale = schoolService.getSchoolDetails("Yale University");

        // Save in order to Jarv/Harvard/Yale
        SaveSchoolRankCommand comm = new SaveSchoolRankCommand(jarv,
                getUser(), 0);
        executeWithToken(comm, false);
View Full Code Here

            return getNotFoundView();
        }

        String schoolName = pathParts[1];

        School school = schoolService.getSchoolDetails(schoolName);
        if (school == null) {
            model.addAttribute("message", "Couldn't find school "
                    + schoolName);
            return getNotFoundView();
        }
View Full Code Here

        // Utilities.reOrder(rankings, currentUser, rank)

        Application sap = null;

        School school = commandService.get(School.class, schoolID);

        for (Iterator iterator = rankings.iterator(); iterator.hasNext();) {
            Application scAndApp = (Application) iterator.next();

            if (scAndApp.getSchool().equals(school)) {
View Full Code Here

    public void execute(CommandService commandService)
            throws SiteException {

        User loadedUser = commandService.get(User.class, userID);
        School school = commandService.get(School.class, schoolID);

        commandService.assertUserIsAuthenticated(loadedUser);

        List<Application> rankings = loadedUser.getSchoolRankings();
View Full Code Here

        List<School> sc = schoolDAO.getAllSchools(0, 2500);
        assertEquals(2374, sc.size());
    }

    public void testGetSchoolFromName() {
        School sc = schoolDAO.getSchoolFromName("DDFNASD");
        assertNull(sc);

        sc = schoolDAO.getSchoolFromName("Dartmouth College");
        assertNotNull(sc);
View Full Code Here

    }

    public void testGetPosts() {

        School sc = schoolDAO
                .getSchoolFromName("Jarvis Christian College");
        assertNotNull(sc);

        // assert that there are no posts for the school
        PostsList threads = schoolDAO.getSchoolThreads(sc.getId(), 0, 10);
        assertNotNull(threads);
        assertEquals(0, threads.getTotalCount());
        assertEquals(0, threads.getPosts().size());

        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());
        assertEquals(1, threads.getPosts().size());

        PostsList post1Thread = schoolDAO.getPostsForThread(post, 0, 10);
        assertEquals(2, post1Thread.getTotalCount());
View Full Code Here

TOP

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

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.