Package ma.glasnost.orika.test.common.types.TestCaseClasses

Examples of ma.glasnost.orika.test.common.types.TestCaseClasses.Library


 
  @Test
  @Concurrent(20)
  public void testGenerateMappers() {
    BookImpl book = new BookImpl("The Book Title", new AuthorImpl("The Author Name"));
    Library lib = new LibraryImpl("The Library", Arrays.<Book>asList(book));
   
    LibraryDTO mappedLib = mapper.map(lib, LibraryDTO.class);
   
    // Just to be sure things mapped as expected
    Assert.assertEquals(lib.getTitle(),mappedLib.getTitle());
    Assert.assertEquals(book.getTitle(),mappedLib.getBooks().get(0).getTitle());
    Assert.assertEquals(book.getAuthor().getName(),mappedLib.getBooks().get(0).getAuthor().getName());
 
  }
View Full Code Here


      books.add(new BookImpl("Book #1", author1));
      books.add(new BookImpl("Book #2", author1));
      books.add(new BookImpl("Book #3", author2));
      books.add(new BookImpl("Book #4", author2));
     
      Library library = new LibraryImpl("Library #1", books);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
     
      assertValidMapping(library,mapped);
     
      Library libraryMapBack = mapper.map(mapped, LibraryImpl.class);
     
      assertValidMapping(libraryMapBack,mapped);
     
    }
View Full Code Here

      books.add(new BookImpl("Book #1", author1));
      books.add(new BookImpl("Book #2", author1));
      books.add(new BookImpl("Book #3", author2));
      books.add(new BookImpl("Book #4", author2));
     
      Library library = new LibraryImpl("Library #1", books);
     
      MapperFactory factory = MappingUtil.getMapperFactory();
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
     
      assertValidMapping(library,mapped);
     
      Library libraryMapBack = mapper.map(mapped, LibraryImpl.class);
     
      assertValidMapping(libraryMapBack,mapped);
     
    }
View Full Code Here

TOP

Related Classes of ma.glasnost.orika.test.common.types.TestCaseClasses.Library

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.