Examples of PersonImpl


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

    private static final String ownerId = "12345";

    @Before
    public void setup() {
        members = new ArrayList<String>();
        owner = new PersonImpl();
        owner.setDisplayName(ownerDisplayName);
        owner.setGivenName(ownerGivenName);
        members.add(ownerId);

        group = new GroupImpl();
View Full Code Here

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

    @Test
    public void converts() {
        new JpaConverter(converters);
        assertThat(JpaConverter.getInstance().convert(new AddressImpl(), Address.class), is(instanceOf(JpaAddress.class)));
        assertThat(JpaConverter.getInstance().convert(new PersonImpl(), Person.class), is(instanceOf(JpaPerson.class)));

    }
View Full Code Here

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

        tag.setPageContext(pageContext);
    }

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

        expect(repository.get(VALID_ID)).andReturn(p);
        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

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

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

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

        expect(repository.get(VALID_ID)).andReturn(p);
        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

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

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

    @Test
    public void doStartTag_novar() throws IOException, JspException {
        Person p = new PersonImpl();
        p.setUsername("FOO");

        expect(repository.get(VALID_ID)).andReturn(p);
        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();
        expect(pageContext.getOut()).andReturn(writer).anyTimes();
        writer.print(p.getUsername());
        expectLastCall();
        replay(repository, pageContext, servletContext, wContext, writer);

        tag.setId(VALID_ID);
        int result = tag.doEndTag();
View Full Code Here

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

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

    @Test
    public void doStartTag_noResult() 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

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

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

        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

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

        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

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

        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
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.