Package ma.glasnost.orika.test.property.TestCaseClasses

Examples of ma.glasnost.orika.test.property.TestCaseClasses.Book


       
        return author;
    }
   
    private Book createBook(Class<? extends Book> type) throws InstantiationException, IllegalAccessException {
        Book book = type.newInstance();
        book.title = "The Prophet";
       
        return book;
    }
View Full Code Here


                };
        MapperFactory factory = MappingUtil.getMapperFactory();
        factory.registerDefaultFieldMapper(myHint);
        MapperFacade mapper = factory.getMapperFacade();
       
        Book book = createBook(BookChild.class);
        book.setAuthor(createAuthor(AuthorChild.class));
       
        BookMyDTO mappedBook = mapper.map(book, BookMyDTO.class);
        Book mapBack = mapper.map(mappedBook, Book.class);
       
        Assert.assertNotNull(mappedBook);
        Assert.assertNotNull(mapBack);
       
        Assert.assertEquals(book.getAuthor().getName(), mappedBook.getMyAuthor().getMyName());
        Assert.assertEquals(book.title, mappedBook.getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mapBack.getAuthor().getName());
        Assert.assertEquals(book.title, mapBack.title);
    }
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.test.property.TestCaseClasses.Book

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.