db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1152581 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
Date Sun, 31 Jul 2011 13:56:19 GMT
Author: tfischer
Date: Sun Jul 31 13:56:18 2011
New Revision: 1152581

URL: http://svn.apache.org/viewvc?rev=1152581&view=rev
Log:
used generics for Lists

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

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java?rev=1152581&r1=1152580&r2=1152581&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java Sun
Jul 31 13:56:18 2011
@@ -154,7 +154,7 @@ public class DocsTest extends BaseRuntim
      */
     public void testCriteriaOrderBy()
     {
-        List books = null;
+        List<Book> books = null;
         try
         {
             Criteria criteria = new Criteria();
@@ -171,7 +171,7 @@ public class DocsTest extends BaseRuntim
                      + " : " + e.getMessage());
         }
 
-        Book book = (Book) books.get(0);
+        Book book = books.get(0);
         assertTrue(
                 "title of first book is not"
                 + BOOK_1_TITLE
@@ -180,7 +180,7 @@ public class DocsTest extends BaseRuntim
                 BOOK_1_TITLE.equals(book.getTitle())
                 );
 
-        book = (Book) books.get(2);
+        book = books.get(2);
         assertTrue(
                 "ISBN of third book is not"
                 + BOOK_3_ISBN
@@ -195,7 +195,7 @@ public class DocsTest extends BaseRuntim
     public void testCriteriaJoins()
     {
         // inner joins
-        List bookAuthors = null;
+        List<Author> bookAuthors = null;
         try
         {
             Criteria criteria = new Criteria();
@@ -207,8 +207,8 @@ public class DocsTest extends BaseRuntim
             bookAuthors = AuthorPeer.doSelect(criteria);
 
             // from Details section
-            Author author = (Author) bookAuthors.get(0);
-            List books = author.getBooks();
+            Author author = bookAuthors.get(0);
+            List<Book> books = author.getBooks();
         }
         catch (Exception e)
         {
@@ -302,7 +302,7 @@ public class DocsTest extends BaseRuntim
      */
     public void testDistinct()
     {
-        List bookAuthors = null;
+        List<Author> bookAuthors = null;
         try
         {
             Criteria criteria = new Criteria();
@@ -332,7 +332,7 @@ public class DocsTest extends BaseRuntim
      */
     public void testJoinOrderDistinct()
     {
-        List bookAuthors = null;
+        List<Author> bookAuthors = null;
         try
         {
             Criteria criteria = new Criteria();
@@ -357,7 +357,7 @@ public class DocsTest extends BaseRuntim
             + bookAuthors.size(),
             bookAuthors.size() == 2);
 
-        Author author = (Author) bookAuthors.get(0);
+        Author author = bookAuthors.get(0);
         assertTrue(
             "Author of first book is not"
             + AUTHOR_1_NAME
@@ -365,7 +365,7 @@ public class DocsTest extends BaseRuntim
             + author.getName(),
             AUTHOR_1_NAME.equals(author.getName()));
 
-        author = (Author) bookAuthors.get(1);
+        author = bookAuthors.get(1);
         assertTrue(
             "Author of second book is not"
             + AUTHOR_2_NAME
@@ -398,7 +398,7 @@ public class DocsTest extends BaseRuntim
         Criteria criteria = new Criteria();
         criteria.add(AuthorPeer.AUTHOR_ID, subquery);
     
-        List authors = AuthorPeer.doSelect(criteria);
+        List<Author> authors = AuthorPeer.doSelect(criteria);
         assertEquals("Expected list of size 1 but got " + authors.size(),
                 1,
                 authors.size());



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