Package org.apache.torque.test.dbobject

Examples of org.apache.torque.test.dbobject.Book


     *
     * @throws Exception if the test fails.
     */
    public void testSelectSimpleKey() throws Exception
    {
        Book bookToSelect = authorList.get(0).getBooks().get(0);
        Criteria criteria = new Criteria()
                .where(BookPeer.BOOK_ID, bookToSelect.getPrimaryKey());

        List<Book> books = BookPeer.doSelect(criteria);
        assertEquals(1, books.size());
        assertEquals(bookToSelect.getBookId(), books.get(0).getBookId());
    }
View Full Code Here


        List<Book> result = BookPeer.doSelect(criteria);
        assertEquals("Expected result of size 11 but got " + result.size(),
                11,
                result.size());
        Book book = result.get(0);
        assertEquals("Expected book with Id "
                + authorList.get(0).getBooks().get(0).getBookId()
                + " at first position but got "
                + book.getBookId(),
                authorList.get(0).getBooks().get(0).getBookId(),
                book.getBookId());
        book = result.get(1);
        assertEquals("Expected book with ISBN null "
                + " at second position but got "
                + book.getIsbn(),
                null,
                book.getIsbn());
    }
View Full Code Here

TOP

Related Classes of org.apache.torque.test.dbobject.Book

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.