Examples of BookImpl


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

  }
 
  @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

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

      List<Book> books = new ArrayList<Book>(4);
     
      Author author1 = new AuthorImpl("Author #1");
      Author author2 = new AuthorImpl("Author #2");
     
      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();
View Full Code Here

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

      List<Book> books = new ArrayList<Book>(4);
     
      Author author1 = new AuthorImpl("Author #1");
      Author author2 = new AuthorImpl("Author #2");
     
      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();
View Full Code Here

Examples of ma.glasnost.orika.test.enums.EnumsTestCaseClasses.BookImpl

import org.junit.Test;

public class EnumsTestCase {
   
    private Book createBook() {
        Book book = new BookImpl();
        book.setTitle("The Prophet");
        book.setFormat(PublicationFormat.EBOOK);
        return book;
    }
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

  }
  public void removePrecedent(Reference ref) {
    // do nothing.
  }
  public void update() {
    final BookImpl book = (BookImpl) getSheet().getBook();
    book.fireSSDataEvent(this, SSDataEvent.CONTENTS_CHANGE, 0);
  }
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

    super(name);
  }

  protected void setUp() throws Exception {
    super.setUp();
    _book = new BookImpl("Mybook");
    _sheet = new SheetImpl(_book, "Sheet1", 256, 64*1024);
  }
 
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

    assertTokenEquals((Token) tokens.get(j++), "function", "start", "SUM");
    assertTokenEquals((Token) tokens.get(j++), "operand", "range", "A");
    assertTokenEquals((Token) tokens.get(j++), "function", "stop", "");

   
    Token root = parser.parse(tokens, null, new BookImpl("Mybook"));
    assertTokenEquals((Token) root, "function", "start", "SUM");
    assertTokenEquals((Token) root.getOperands().get(0), "operand", "var", "A");
  }
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

    assertTokenEquals((Token) tokens.get(j++), "operand", "range", "a");
    assertTokenEquals((Token) tokens.get(j++), "operator-infix", "math", "+");
    assertTokenEquals((Token) tokens.get(j++), "operand", "range", "b");
    assertTokenEquals((Token) tokens.get(j++), "operator-postfix","", "%");
    assertTokenEquals((Token) tokens.get(j++), "subexpression", "stop", "");
    Token root = parser.parse(tokens, null, new BookImpl("Mybook"));

    assertTokenEquals(root, "operator-infix", "math", "+");
    assertTokenEquals((Token)root.getOperands().get(0), "operand", "var", "a");
    assertTokenEquals((Token)root.getOperands().get(1), "operator-postfix","", "%");
  }
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

    List tokens = parser.parseFormulaTokens(expr);
   
    assertNotNull(tokens);
    assertEquals(23, tokens.size());

    Token root = parser.parse(tokens, null, new BookImpl("Mybook"));

    assertTokenEquals(root, "function", "start", "SUM");
  }
View Full Code Here

Examples of org.zkoss.zss.model.impl.BookImpl

  throws XelException {
    if (_type == TokenType.OPERAND && _subtype == TokenSubtype.VAR) { //refer to a variable
      final VariableResolver resolver = ctx.getVariableResolver();
      final Reference ref =
        (Reference) resolver.resolveVariable("zkoss.ss.Ref");
      final BookImpl book = (BookImpl) ref.getSheet().getBook();
      book.removeVariable((String)_value, ref);
    }
   
    //scan thru kid tokens
    if (_operands != null) {
      for (final Iterator it = _operands.iterator(); it.hasNext(); ) {
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.