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

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


  @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


      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);
     
View Full Code Here

          factory.classMap(AuthorNested.class, AuthorDTO.class)
            .field("name.fullName", "name").byDefault().toClassMap());
   
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
     
      assertValidMapping(library,mapped);
     
      /*
      // this situation is a bit too complicated to handle normally;
View Full Code Here

      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);
     
View Full Code Here

          factory.classMap(AuthorNested.class, AuthorDTO.class)
            .field("name.fullName", "name").byDefault().toClassMap());
   
      MapperFacade mapper = factory.getMapperFacade();
     
      LibraryDTO mapped = mapper.map(library, LibraryDTO.class);
     
      assertValidMapping(library,mapped);
     
      /*
      // this situation is a bit too complicated to handle normally;
View Full Code Here

TOP

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

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.