Examples of TeeShirtSize


Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        // TODO 1
        // Get the displayName and teeShirtSize sent by the request.

        String displayName = profileForm.getDisplayName();
        TeeShirtSize teeShirtSize = profileForm.getTeeShirtSize();

        // Get the Profile from the datastore if it exists
        // otherwise create a new one
        Profile profile = ofy().load().key(Key.create(Profile.class, userId))
                .now();
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        // TODO 1
        // Get the displayName and teeShirtSize sent by the request.

        String displayName = profileForm.getDisplayName();
        TeeShirtSize teeShirtSize = profileForm.getTeeShirtSize();

        // Get the Profile from the datastore if it exists
        // otherwise create a new one
        Profile profile = ofy().load().key(Key.create(Profile.class, userId))
                .now();
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
        assertEquals(DISPLAY_NAME, profile.getDisplayName());
        // Then try to update it.
        String newDisplayName = "Kay's Daddy";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
        conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
        profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
        assertEquals(DISPLAY_NAME, profile.getDisplayName());
        // Then try to update it.
        String newDisplayName = "New Name";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
        conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
        profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        // TODO 1
        // Get the displayName and teeShirtSize sent by the request.

        String displayName = profileForm.getDisplayName();
        TeeShirtSize teeShirtSize = profileForm.getTeeShirtSize();

        // Get the Profile from the datastore if it exists
        // otherwise create a new one
        Profile profile = ofy().load().key(Key.create(Profile.class, userId))
                .now();
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

    public Profile saveProfile() throws UnauthorizedException {

        String userId = null;
        String mainEmail = null;
        String displayName = "Your name will go here";
        TeeShirtSize teeShirtSize = TeeShirtSize.NOT_SPECIFIED;

        // TODO 2
        // If the user is not logged in, throw an UnauthorizedException

        // TODO 1
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
        assertEquals(DISPLAY_NAME, profile.getDisplayName());
        // Then try to update it.
        String newDisplayName = "New Name";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
        conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
        profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

      throws UnauthorizedException {

    String userId = "";
    String mainEmail = "";
    String displayName = "Your name will go here";
    TeeShirtSize teeShirtSize = TeeShirtSize.NOT_SPECIFIED;

    // TODO 2
    // If the user is not logged in, throw an UnauthorizedException
    if (user == null) {
            throw new UnauthorizedException("Authorization required");
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(TEE_SHIRT_SIZE, profile.getTeeShirtSize());
        assertEquals(DISPLAY_NAME, profile.getDisplayName());
        // Then try to update it.
        String newDisplayName = "New Name";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.L;
        conferenceApi.saveProfile(user, new ProfileForm(newDisplayName, newTeeShirtSize));
        profile = ofy().load().key(Key.create(Profile.class, user.getUserId())).now();
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
View Full Code Here

Examples of com.google.devrel.training.conference.form.ProfileForm.TeeShirtSize

    }

    @Test
    public void testUpdate() throws Exception {
        String newDisplayName = "Kay's Daddy";
        TeeShirtSize newTeeShirtSize = TeeShirtSize.M;
        profile.update(newDisplayName, newTeeShirtSize);
        assertEquals(USER_ID, profile.getUserId());
        assertEquals(newDisplayName, profile.getDisplayName());
        assertEquals(EMAIL, profile.getMainEmail());
        assertEquals(newTeeShirtSize, profile.getTeeShirtSize());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.