Package com.inspiresoftware.lib.dto.geda.benchmark.domain

Examples of com.inspiresoftware.lib.dto.geda.benchmark.domain.Person


public class ModelMapperBasicMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntity();
        final PersonDTO dto = getDto();

        final Mapper mapper = new ModelMapperBasicMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here


public class ManualBasicMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntity();
        final PersonDTO dto = getDto();

        final Mapper mapper = new ManualBasicMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here

public class ModelMapperListMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntityWithHistory();
        final PersonDTO dto = getDtoWithHistory();

        final Mapper mapper = new ModelMapperListMapper();

        final Person fromDto = (Person) mapper.fromDto(dto);
        assertEquals(entity, fromDto);
        assertNotNull(fromDto.getPreviousAddresses());
        assertEquals(2, fromDto.getPreviousAddresses().size());
        assertEquals(entity.getPreviousAddresses().get(0), fromDto.getPreviousAddresses().get(0));

        final PersonWithHistoryDTO fromEntity = (PersonWithHistoryDTO) mapper.fromEntity(entity);
        assertEquals(dto, fromEntity);
        assertNotNull(fromEntity.getPreviousAddresses());
        assertEquals(2, fromEntity.getPreviousAddresses().size());
View Full Code Here

public class GeDABasicMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntity();
        final PersonDTO dto = getDto();

        final Mapper mapper = new GeDABasicMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here

    public static Person providePersonEntity(final boolean withHistory) {

        final Name name = new Name("Sherlock", "Holmes");
        final Country country = new Country("United Kingdom");
        final Address home = new Address("221B Baker Street", null, "London", country, "NW1 6XE");
        final Person entity = new Person(123456789012L, name, home);

        if (withHistory) {
            final Address baskervilleHall = new Address("Baskerville Hall", null, "Hay-on-Wye", country, "HR3 5LE");
            entity.setPreviousAddresses(new ArrayList<Address>(Arrays.asList(home, baskervilleHall)));
        }

        return entity;

    }
View Full Code Here

    private static final int PERFORMANCE_TEST_CYCLES = 1000000000;

    @Test
    public void testCollectionsMapper() throws Exception {

        final Person entity = getEntityWithHistory();
        final PersonDTO dto = getDtoWithHistory();

        final Mapper mapper = new GeDAListMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here

    }

    @Test
    public void testMapMapper() throws Exception {

        final Person entity = getEntityWithHistory();
        final PersonDTO dto = getDtoWithHistoryByCity();

        final Mapper mapper = new GeDABasicMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here

public class OrikaBasicMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntity();
        final PersonDTO dto = getDto();

        final Mapper mapper = new OrikaBasicMapper();

        assertEquals(entity, mapper.fromDto(dto));
View Full Code Here

public class OrikaListMapperTest extends AbstractMapperTest {

    @Test
    public void testMapper() throws Exception {

        final Person entity = getEntityWithHistory();
        final PersonDTO dto = getDtoWithHistory();

        final Mapper mapper = new OrikaListMapper();


        final Person fromDto = (Person) mapper.fromDto(dto);
        assertEquals(entity, fromDto);
        assertNotNull(fromDto.getPreviousAddresses());
        assertEquals(2, fromDto.getPreviousAddresses().size());
        assertEquals(entity.getPreviousAddresses().get(0), fromDto.getPreviousAddresses().get(0));

        final PersonWithHistoryDTO fromEntity = (PersonWithHistoryDTO) mapper.fromEntity(entity);
        assertEquals(dto, fromEntity);
        assertNotNull(fromEntity.getPreviousAddresses());
        assertEquals(2, fromEntity.getPreviousAddresses().size());
View Full Code Here

        asm.assembleDto(person, entity, null, bf);
        return person;
    }

    public Object fromDto(final Object dto) {
        final Person person = new Person();
        asm.assembleEntity(dto, person, null, bf);
        return person;
    }
View Full Code Here

TOP

Related Classes of com.inspiresoftware.lib.dto.geda.benchmark.domain.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.