db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1333975 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java
Date Fri, 04 May 2012 14:13:40 GMT
Author: tfischer
Date: Fri May  4 14:13:39 2012
New Revision: 1333975

URL: http://svn.apache.org/viewvc?rev=1333975&view=rev
Log:
Fix bean test

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java?rev=1333975&r1=1333974&r2=1333975&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BeanTestConditional.java
Fri May  4 14:13:39 2012
@@ -29,11 +29,12 @@ import org.apache.torque.test.Author;
 import org.apache.torque.test.AuthorPeer;
 import org.apache.torque.test.Book;
 import org.apache.torque.test.BookPeer;
-import org.apache.torque.util.Criteria;
+import org.apache.torque.test.bean.AuthorBean;
+import org.apache.torque.test.bean.BookBean;
+import org.apache.torque.criteria.Criteria;
 
 /**
- * Runtime tests to make sure that the code which is supplied
- * in the documentation actually works ;-)
+ * Test generated bean classes.
  *
  * @author <a href="mailto:fischer@seitenbau.de">Thomas Fischer</a>
  * @version $Id$
@@ -163,7 +164,7 @@ public class BeanTestConditional extends
                 author == book.getAuthor());
 
         AuthorBean authorBean = author.getBean();
-        BookBean bookBean = (BookBean) authorBean.getBookBeans().get(0);
+        BookBean bookBean = authorBean.getBookBeans().get(0);
         assertTrue("authorBean from BookBean should be the same "
                 + "object as authorBean",
                 bookBean.getAuthorBean() == authorBean);
@@ -227,7 +228,7 @@ public class BeanTestConditional extends
                 author != book.getAuthor());
 
         AuthorBean authorBean = author.getBean();
-        BookBean bookBean = (BookBean) authorBean.getBookBeans().get(0);
+        BookBean bookBean = authorBean.getBookBeans().get(0);
         assertTrue("authorBean from BookBean should not be the same "
                 + "object as authorBean",
                 bookBean.getAuthorBean() != authorBean);
@@ -262,11 +263,11 @@ public class BeanTestConditional extends
     public void testSaves() throws Exception
     {
         Criteria criteria = new Criteria();
-        criteria.add(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
+        criteria.where(BookPeer.BOOK_ID, (Long) null, Criteria.NOT_EQUAL);
         BookPeer.doDelete(criteria);
 
         criteria = new Criteria();
-        criteria.add(AuthorPeer.AUTHOR_ID, (Long) null, Criteria.NOT_EQUAL);
+        criteria.where(AuthorPeer.AUTHOR_ID, (Long) null, Criteria.NOT_EQUAL);
         AuthorPeer.doDelete(criteria);
 
         Author author = new Author();
@@ -310,8 +311,8 @@ public class BeanTestConditional extends
 
         author.save();
 
-        List authorList = AuthorPeer.doSelect(new Criteria());
-        Author readAuthor = (Author) authorList.get(0);
+        List<Author> authorList = AuthorPeer.doSelect(new Criteria());
+        Author readAuthor = authorList.get(0);
         assertEquals("name from read Author is " + readAuthor.getName()
                 +" but should be " + authorBean.getName(),
                 readAuthor.getName(),
@@ -331,7 +332,7 @@ public class BeanTestConditional extends
         book.setAuthor(author);
         book.save();
 
-        List bookList = BookPeer.doSelect(new Criteria());
+        List<Book> bookList = BookPeer.doSelect(new Criteria());
         assertTrue("Ther should be one book in DB but there are "
                 + bookList.size(),
                 bookList.size() == 1);



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message