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

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


        assertNotNull(dart);
        assertNotNull(harvard);
        assertNotNull(yale);

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

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());

        assertEquals(dart, savedUser.getSchoolRankings().get(0)
                .getSchool());
        assertEquals(harvard, savedUser.getSchoolRankings().get(1)
                .getSchool());
        assertEquals(yale, savedUser.getSchoolRankings().get(2)
                .getSchool());

        log.debug("\n------Re-Order--------");

        // re-order to Dart,Yale,Harvard
        comm = new SaveSchoolRankCommand(harvard, getUser(), 2);
        executeWithToken(comm, false);

        savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());

        assertEquals(dart, savedUser.getSchoolRankings().get(0)
                .getSchool());
        assertEquals(yale, savedUser.getSchoolRankings().get(1)
                .getSchool());
        assertEquals(harvard, savedUser.getSchoolRankings().get(2)
                .getSchool());

        // re-order to Harvard,Dart,Yale
        comm = new SaveSchoolRankCommand(harvard, getUser(), 0);
        executeWithToken(comm, false);

        savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());
View Full Code Here


        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);

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User currentUser = userService.getCurrentUser();
        User savedUser = userDAO.getUserByUsername(currentUser
                .getUsername());
View Full Code Here

        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);

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());
View Full Code Here

        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);

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());
View Full Code Here

        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);

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());
View Full Code Here

        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);

        comm = new SaveSchoolRankCommand(harvard, getUser(), 1);
        executeWithToken(comm, false);

        comm = new SaveSchoolRankCommand(yale, getUser(), 2);
        executeWithToken(comm, false);

        User savedUser = getUser();
        assertEquals(3, savedUser.getSchoolRankings().size());
View Full Code Here

    }

    private void saveEntry(final CollegeEntry entry, int rank) {

        SaveSchoolRankCommand comm = new SaveSchoolRankCommand(entry
                .getApplication().getSchool(), user, rank);

        serviceCache.executeCommand(comm, new EZCallback<SiteCommand>() {
            public void onSuccess(SiteCommand success) {

                SaveSchoolRankCommand rtn = (SaveSchoolRankCommand) success;
                entry.getApplication().setId(rtn.getSavedApplicationID());
            }
        });

        Utilities.reOrder(rankedEntries, entry, rank);
View Full Code Here

TOP

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

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.