Package org.apache.rave.portal.model.impl

Examples of org.apache.rave.portal.model.impl.PersonImpl


        verify(repository, pageContext, servletContext, wContext, writer);
    }

    @Test
    public void doStartTag_noResult_ScopeSet() throws IOException, JspException {
        Person p = new PersonImpl();

        expect(repository.get(null)).andReturn(null);
        expect(pageContext.getServletContext()).andReturn(servletContext).anyTimes();
        expect(servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)).andReturn(wContext).anyTimes();
        expect(wContext.getBean(PersonRepository.class)).andReturn(repository).anyTimes();
View Full Code Here


        return sb.toString();
    }

    @Override
    public Person toPerson() {
        PersonImpl p = new PersonImpl();
        p.setAboutMe(this.getAboutMe());
        p.setAdditionalName(this.getAdditionalName());
        p.setAddresses(this.getAddresses());
        p.setDisplayName(this.getDisplayName());
        p.setEmail(this.getEmail());
        p.setFamilyName(this.getFamilyName());
        p.setGivenName(this.getGivenName());
        p.setHonorificPrefix(this.getHonorificPrefix());
        p.setHonorificSuffix(this.getHonorificSuffix());
        p.setOrganizations(this.getOrganizations());
        p.setPreferredName(this.getPreferredName());
        p.setProperties(this.getProperties());
        p.setStatus(this.getStatus());
        p.setUsername(this.getUsername());
        return p;
    }
View Full Code Here

        ids.add(new UserId(UserId.Type.userId, ID_3));
        return ids;
    }

    private org.apache.rave.model.Person getDbPerson() {
        PersonImpl dbPerson = new PersonImpl();
        dbPerson.setUsername(ID_1);
        dbPerson.setDisplayName(DISPLAY_NAME);
        return dbPerson;
    }
View Full Code Here

        dbPerson.setDisplayName(DISPLAY_NAME);
        return dbPerson;
    }

    private org.apache.rave.model.Person getDbPerson(String id) {
        PersonImpl dbPerson = new PersonImpl();
        dbPerson.setUsername(id);
        dbPerson.setDisplayName(DISPLAY_NAME);
        List<PersonProperty> properties = new ArrayList<PersonProperty>();
        properties.add(new PersonPropertyImpl("1", Person.Field.TAGS.toString(), TAG, null, null, null));
        properties.add(new PersonPropertyImpl("2", Person.Field.HAPPIEST_WHEN.toString(), HAPPIEST_WHEN, null, null, null));
        dbPerson.setProperties(properties);
        return dbPerson;
    }
View Full Code Here

    public void setHappiestWhen() {
        new FieldRestrictingPerson(null, null).setHappiestWhen(SUFFIX);
    }

    private org.apache.rave.model.Person getTestPerson() {
        org.apache.rave.model.Person person = new PersonImpl();
        person.setUsername(USERNAME);
        person.setAboutMe(ABOUT_ME);
        person.setAdditionalName(ADDITIONAL_NAME);
        person.setDisplayName(DISPLAY_NAME);
        person.setEmail(E_MAIL_ADDRESS);
        person.setFamilyName(FIRST_NAME);
        person.setGivenName(GIVEN_NAME);
        person.setHonorificPrefix(PREFIX);
        person.setHonorificSuffix(SUFFIX);
        person.setPreferredName(PREFERRED_NAME);
        person.setStatus(STATUS);
        List<PersonProperty> properties = new ArrayList<PersonProperty>();
        properties.add(new PersonPropertyImpl("1", "gender", Person.Gender.female.toString(), null, "", false));
        properties.add(new PersonPropertyImpl("1", "drinker", Drinker.HEAVILY.toString(), null, "", false));
        properties.add(new PersonPropertyImpl("1", "age", AGE.toString(), null, "", false));
        properties.add(new PersonPropertyImpl("1", "birthday", BIRTHDAY_STRING, null, "", false));
        properties.add(new PersonPropertyImpl("1", "bodyType", BODY_BUILD, null, "build", false));
        properties.add(new PersonPropertyImpl("1", "bodyType", BODY_EYE_COLOR, null, "eyeColor", false));
        properties.add(new PersonPropertyImpl("1", "bodyType", "25.24", null, "height", false));
        properties.add(new PersonPropertyImpl("1", "ims", IM_1, null, IM_PROVIDER_1, true));
        properties.add(new PersonPropertyImpl("1", "ims", IM_2, null, IM_PROVIDER_2, false));
        properties.add(new PersonPropertyImpl("1", "emails", E_MAIL_ADDRESS_2, null, "personal", false));
        properties.add(new PersonPropertyImpl("1", "emails", E_MAIL_ADDRESS_3, null, "junk", true));
        properties.add(new PersonPropertyImpl("1", "activities", ACTIVITY_1, null, "", false));
        properties.add(new PersonPropertyImpl("1", "activities", ACTIVITY_2, null, "", false));
        properties.add(new PersonPropertyImpl("1", "profileSong", LINK_VALUE, LINK_TEXT, null, false));
        properties.add(new PersonPropertyImpl("1", "lookingFor", LookingFor.FRIENDS.toString(), null, null, false));
        properties.add(new PersonPropertyImpl("1", "currentLocation", QUALIFIER, null, null, null));
        properties.add(new PersonPropertyImpl("1", "account", IM_1, "1", IM_PROVIDER_1, false));
        person.setProperties(properties);
        org.apache.rave.model.Address address = new AddressImpl();
        address.setCountry(COUNTRY);
        address.setLatitude(LATITUDE);
        address.setLongitude(LONGITUDE);
        address.setLocality(CITY);
        address.setRegion(STATE);
        address.setPostalCode(POSTAL_CODE);
        address.setStreetAddress(STREET);
        address.setQualifier(QUALIFIER);
        List<org.apache.rave.model.Address> addresses = new ArrayList<org.apache.rave.model.Address>();
        addresses.add(new AddressImpl());
        addresses.add(address);
        person.setAddresses(addresses);

        return person;
    }
View Full Code Here

    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_implObject() {
        Person person = repository.get(VALID_ID);
        assertThat(person, is(notNullValue()));
        PersonImpl impl = new PersonImpl();
        impl.setUsername(person.getUsername());
        repository.delete(impl);
        person = repository.get(VALID_ID);
        assertThat(person, is(nullValue()));
    }
View Full Code Here

        validApplicationDataMap.put("speed", "fast");
        validApplicationDataMap.put("state", "MA");
        validApplicationData = new ApplicationDataImpl(VALID_APPLICATION_DATA_ID, VALID_VIEWER_ID, VALID_APPLICATION_ID,
                validApplicationDataMap);

        validPerson = new PersonImpl();
        validPerson.setUsername(VALID_VIEWER_ID);
    }
View Full Code Here

    }


    @Test
    public void convertValid() {
        Person template = new PersonImpl();
        template.setUsername("TEST_A");
        template.setEmail("TEST_B");
        template.setDisplayName("TEST_C");
        template.setAdditionalName("TEST_D");
        template.setFamilyName("TEST_E");
        template.setGivenName("TEST_F");
        template.setHonorificPrefix("TEST_G");
        template.setHonorificSuffix("TEST_H");
        template.setPreferredName("TEST_I");
        template.setAboutMe("TEST_J");
        template.setStatus("TEST_K");
        template.setAddresses(new ArrayList<Address>());
        template.setOrganizations(new ArrayList<Organization>());
        template.setProperties(new ArrayList<PersonProperty>());
        template.setFriends(new ArrayList<Person>());

        JpaPerson jpaTemplate = converter.convert(template);

        assertThat(jpaTemplate, is(not(sameInstance(template))));
        assertThat(jpaTemplate, is(instanceOf(JpaPerson.class)));
        assertThat(jpaTemplate.getUsername(), is(equalTo(template.getUsername())));
        assertThat(jpaTemplate.getEmail(), is(equalTo(template.getEmail())));
        assertThat(jpaTemplate.getDisplayName(), is(equalTo(template.getDisplayName())));
        assertThat(jpaTemplate.getUsername(), is(equalTo(template.getUsername())));
        assertThat(jpaTemplate.getFamilyName(), is(equalTo(template.getFamilyName())));
        assertThat(jpaTemplate.getGivenName(), is(equalTo(template.getGivenName())));
        assertThat(jpaTemplate.getHonorificPrefix(), is(equalTo(template.getHonorificPrefix())));
        assertThat(jpaTemplate.getHonorificSuffix(), is(equalTo(template.getHonorificSuffix())));
        assertThat(jpaTemplate.getPreferredName(), is(equalTo(template.getPreferredName())));
        assertThat(jpaTemplate.getAboutMe(), is(equalTo(template.getAboutMe())));
        assertThat(jpaTemplate.getStatus(), is(equalTo(template.getStatus())));
        assertThat(jpaTemplate.getAddresses(), is(equalTo(template.getAddresses())));
        assertThat(jpaTemplate.getOrganizations(), is(equalTo(template.getOrganizations())));
        assertThat(jpaTemplate.getProperties(), is(equalTo(template.getProperties())));
        assertThat(jpaTemplate.getFriends(), is(equalTo(template.getFriends())));
    }
View Full Code Here

        return sb.toString();
    }

    @Override
    public Person toPerson() {
        PersonImpl p = new PersonImpl();
        p.setAboutMe(this.getAboutMe());
        p.setAdditionalName(this.getAdditionalName());
        p.setAddresses(this.getAddresses());
        p.setDisplayName(this.getDisplayName());
        p.setEmail(this.getEmail());
        p.setFamilyName(this.getFamilyName());
        p.setFriends(this.getFriends());
        p.setGivenName(this.getGivenName());
        p.setHonorificPrefix(this.getHonorificPrefix());
        p.setHonorificSuffix(this.getHonorificSuffix());
        p.setOrganizations(this.getOrganizations());
        p.setPreferredName(this.getPreferredName());
        p.setProperties(this.getProperties());
        p.setStatus(this.getStatus());
        p.setUsername(this.getUsername());
        return p;
    }
View Full Code Here

    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_implObject() {
        Person person = repository.get(VALID_ID);
        assertThat(person, is(notNullValue()));
        PersonImpl impl = new PersonImpl();
        impl.setUsername(person.getUsername());
        repository.delete(impl);
        person = repository.get(VALID_ID);
        assertThat(person, is(nullValue()));
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.impl.PersonImpl

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.