Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.Person


        assertThat(p.getUsername(), is(VALID_USER));
    }

    @Test
    public void findByUsername_valid() {
        Person person = repository.findByUsername(VALID_USER);
        assertThat(person, is(not(nullValue())));
        assertThat(person.getUsername(), is(equalTo(VALID_USER)));
    }
View Full Code Here


        assertThat(person, is(not(nullValue())));
        assertThat(person.getUsername(), is(equalTo(VALID_USER)));
    }
    @Test
    public void findByUsername_null() {
        Person person = repository.findByUsername(INVALID_USERNAME);
        assertThat(person, is(nullValue()));
    }
View Full Code Here

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void save_existing() {
        final String UPDATED_ABOUT_ME = "updated about me";
        Person person = repository.get(VALID_ID);
        assertThat(person.getAboutMe(), is(not(UPDATED_ABOUT_ME)));
        person.setAboutMe(UPDATED_ABOUT_ME);
        repository.save(person);
        assertThat(repository.get(VALID_ID).getAboutMe(), is(UPDATED_ABOUT_ME));
    }
View Full Code Here

    @Test
    @Transactional(readOnly=false)
    @Rollback(true)
    public void delete_jpaObject() {
        Person person = repository.get(VALID_ID);
        assertThat(person, is(notNullValue()));
        repository.delete(person);
        person = repository.get(VALID_ID);
        assertThat(person, is(nullValue()));
    }
View Full Code Here

    @Test
    @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

        assertThat(person, is(nullValue()));
    }

    @Test
    public void read_properties() {
        Person person = repository.get(VALID_ID);
      assertThat(person.getProperties().size(), is(1));
    }
View Full Code Here

    public void proxyAdd() {
        List<ModelConverter> converters = new ArrayList<ModelConverter>();
        ModelConverter converterMock = createMock(ModelConverter.class);
        expect(converterMock.getSourceType()).andReturn(Person.class).anyTimes();
        converters.add(converterMock);
        Person personImpl1 = new PersonImpl();
        PersonImpl personImpl2 = new PersonImpl();
        expect(converterMock.convert(personImpl1)).andReturn(personImpl2);
        replay(converterMock);
        List<PersonImpl> underlying = createMock(List.class);
        expect(underlying.add(personImpl2)).andReturn(true);
View Full Code Here

    public void proxySet() {
        List<ModelConverter> converters = new ArrayList<ModelConverter>();
        ModelConverter converterMock = createMock(ModelConverter.class);
        expect(converterMock.getSourceType()).andReturn(Person.class).anyTimes();
        converters.add(converterMock);
        Person personImpl1 = new PersonImpl();
        Person personImpl2 = new PersonImpl();
        expect(converterMock.convert(personImpl1)).andReturn(personImpl2);
        replay(converterMock);
        List<PersonImpl> underlying = createMock(List.class);
        expect(underlying.set(0, (PersonImpl)personImpl2)).andReturn((PersonImpl) personImpl2);
        replay(underlying);
        new JpaConverter(converters);

        List<Person> personProxy = ConvertingListProxyFactory.createProxyList(Person.class, underlying);
        Person good = personProxy.set(0, personImpl1);
        assertThat(good, is(sameInstance(personImpl2)));
        verify(converterMock);
        verify(underlying);
    }
View Full Code Here

    }

    @Test
    public void proxyAddAll() {

        Person personImpl1 = new PersonImpl();
        Person personImpl2 = new PersonImpl();
        Person personImpl3 = new PersonImpl();
        Person personImpl4 = new PersonImpl();

        List<ModelConverter> converters = new ArrayList<ModelConverter>();
        ModelConverter converterMock = createMock(ModelConverter.class);
        expect(converterMock.getSourceType()).andReturn(Person.class).anyTimes();
        converters.add(converterMock);
View Full Code Here

        assertThat(p.getUsername(), is(VALID_USER));
    }

    @Test
    public void findByUsername_valid() {
        Person person = repository.findByUsername(VALID_USER);
        assertThat(person, is(not(nullValue())));
        assertThat(person.getUsername(), is(equalTo(VALID_USER)));
    }
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.Person

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.