Examples of LibraryDTO


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

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

      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

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

          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

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

      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

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

          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

Examples of ma.glasnost.orika.test.unenhance.SuperTypeTestCaseClasses.LibraryDTO

    MapperFactory factory = MappingUtil.getMapperFactory();

    Library lib = createLibrary();
    Book book = lib.getBooks().get(0);
   
    LibraryDTO mappedLib = factory.getMapperFacade(Library.class, LibraryDTO.class).map(lib);
   
    Assert.assertNotNull(mappedLib);

    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

Examples of ma.glasnost.orika.test.unenhance.SuperTypeTestCaseClasses.LibraryDTO

    MapperFactory factory = MappingUtil.getMapperFactory();

    Library lib = createLibrary();
    Book book = lib.getBooks().get(0);
   
    LibraryDTO mappedLib = factory.getMapperFacade().map(lib, LibraryDTO.class);
   
    Assert.assertNotNull(mappedLib);

    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
TOP
Copyright © 2018 www.massapi.com. 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.