Examples of LibraryMyDTO


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

        Book book = createBook(BookParent.class);
        book.setAuthor(createAuthor(AuthorParent.class));
        Library lib = createLibrary(LibraryParent.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertNotNull(mappedLib);
        Assert.assertTrue(mappedLib.getMyBooks().isEmpty());
    }
View Full Code Here

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

        Book book = createBook(BookParent.class);
        book.setAuthor(createAuthor(AuthorParent.class));
        Library lib = createLibrary(LibraryParent.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
    }
View Full Code Here

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

        Book book = createBook(BookParent.class);
        book.setAuthor(createAuthor(AuthorParent.class));
        Library lib = createLibrary(LibraryParent.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
       
        // Now, map it back to the original...
       
        Library lib2 = mapper.map(mappedLib, Library.class);
        Assert.assertEquals(lib.getTitle(), lib2.getTitle());
View Full Code Here

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

       
      };
    factory.registerDefaultFieldMapper(fieldDefault);
   
    MapperFacade mapper = factory.getMapperFacade();
    LibraryMyDTO mappedLib;
    {
      File projectRoot = MavenProjectUtil.findProjectRoot();
     
      ClassLoader threadContextLoader = Thread.currentThread().getContextClassLoader();
     
      EclipseJdtCompiler complier = new EclipseJdtCompiler(threadContextLoader);
      ClassLoader childLoader = complier.compile(new File(projectRoot, "src/main/java-hidden"),threadContextLoader);
     
      @SuppressWarnings("unchecked")
      Class<? extends Author> hiddenAuthorType = (Class<? extends Author>)childLoader.loadClass("types.AuthorHidden");
      @SuppressWarnings("unchecked")
      Class<? extends Book> hiddenBookType = (Class<? extends Book>)childLoader.loadClass("types.BookHidden");
      @SuppressWarnings("unchecked")
      Class<? extends Library> hiddenLibraryType = (Class<? extends Library>)childLoader.loadClass("types.LibraryHidden");
     
      try {
        threadContextLoader.loadClass("types.LibraryHidden");
        Assert.fail("types.LibraryHidden should not be accessible to the thread context class loader");
      } catch (ClassNotFoundException e0) {
        try {
          threadContextLoader.loadClass("types.AuthorHidden");
          Assert.fail("types.AuthorHidden should not be accessible to the thread context class loader");
        } catch (ClassNotFoundException e1) {
          try {
            threadContextLoader.loadClass("types.BookHidden");
            Assert.fail("types.BookHidden should not be accessible to the thread context class loader");
          } catch (ClassNotFoundException e2) {
            /* good: all of these types should be inaccessible */
          }
        }
      }
      // Now, these types are hidden from the current class-loader, but they implement types
      // that are accessible to this loader
      // -----------------------------------------------------------------------------
     
      Book book = createBook(hiddenBookType);
      book.setAuthor(createAuthor(hiddenAuthorType));
      Library lib = createLibrary(hiddenLibraryType);
      lib.getBooks().add(book);
     
      mappedLib = mapper.map(lib, LibraryMyDTO.class);
     
      // Just to be sure things mapped as expected
      Assert.assertEquals(lib.getTitle(),mappedLib.getMyTitle());
      Assert.assertEquals(book.getTitle(),mappedLib.getMyBooks().get(0).getMyTitle());
      Assert.assertEquals(book.getAuthor().getName(),mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
   
      // Now, set the soft reference before our hard references go out of scope
      childLoaderRef = new SoftReference<ClassLoader>(childLoader);
   
      book = null;
View Full Code Here

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

        Book book = createBook(BookParent.class);
        book.setAuthor(createAuthor(AuthorParent.class));
        Library lib = createLibrary(LibraryParent.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
    }
View Full Code Here

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

        Book book = createBook(BookChild.class);
        book.setAuthor(createAuthor(AuthorChild.class));
        Library lib = createLibrary(LibraryChild.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
    }
View Full Code Here

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

        Book book = createBook(hiddenBookType);
        book.setAuthor(createAuthor(hiddenAuthorType));
        Library lib = createLibrary(hiddenLibraryType);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
       
    }
View Full Code Here

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

        Book book = createBook(BookParent.class);
        book.setAuthor(createAuthor(AuthorParent.class));
        Library lib = createLibrary(LibraryParent.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
    }
View Full Code Here

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

        Book book = createBook(BookChild.class);
        book.setAuthor(createAuthor(AuthorChild.class));
        Library lib = createLibrary(LibraryChild.class);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
    }
View Full Code Here

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

        Book book = createBook(hiddenBookType);
        book.setAuthor(createAuthor(hiddenAuthorType));
        Library lib = createLibrary(hiddenLibraryType);
        lib.getBooks().add(book);
       
        LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
       
        Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
        Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
        Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
       
    }
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.