db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1371377 - /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java
Date Thu, 09 Aug 2012 18:48:48 GMT
Author: tv
Date: Thu Aug  9 18:48:48 2012
New Revision: 1371377

URL: http://svn.apache.org/viewvc?rev=1371377&view=rev
Log:
Use new LargeSelect signatures

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

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java?rev=1371377&r1=1371376&r2=1371377&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/LargeSelectTest.java
Thu Aug  9 18:48:48 2012
@@ -28,7 +28,6 @@ import org.apache.torque.criteria.Criter
 import org.apache.torque.om.mapper.IntegerMapper;
 import org.apache.torque.test.Author;
 import org.apache.torque.test.AuthorPeer;
-import org.apache.torque.test.AuthorRecordMapper;
 
 /**
  * Test code for LargeSelect.
@@ -103,7 +102,7 @@ public class LargeSelectTest extends Bas
         try
         {
             new LargeSelect<Author>(criteria, TEST_PAGE_SIZE,
-                    new AuthorRecordMapper());
+                    AuthorPeer.getAuthorPeerImpl());
         }
         catch (IllegalArgumentException success)
         {
@@ -120,7 +119,7 @@ public class LargeSelectTest extends Bas
         try
         {
             new LargeSelect<Author>(criteria, TEST_PAGE_SIZE,
-                    new AuthorRecordMapper());
+                    AuthorPeer.getAuthorPeerImpl());
         }
         catch (IllegalArgumentException success)
         {
@@ -136,7 +135,7 @@ public class LargeSelectTest extends Bas
         try
         {
             new LargeSelect<Author>(criteria, 0,
-                    new AuthorRecordMapper());
+                    AuthorPeer.getAuthorPeerImpl());
         }
         catch (IllegalArgumentException success)
         {
@@ -152,7 +151,7 @@ public class LargeSelectTest extends Bas
         try
         {
             new LargeSelect<Author>(criteria, TEST_PAGE_SIZE, 0,
-                    new AuthorRecordMapper());
+                    AuthorPeer.getAuthorPeerImpl());
         }
         catch (IllegalArgumentException success)
         {
@@ -161,35 +160,39 @@ public class LargeSelectTest extends Bas
     }
 
     /**
-     * Test a couple of static methods.
+     * Test a couple of setter/getter methods.
      */
-/*    public void testStaticMethods() throws TorqueException
+    public void testSetterMethods()
     {
-        assertEquals("Memory page limit", 5, LargeSelect.getMemoryPageLimit());
-        LargeSelect.setMemoryPageLimit(10);
-        assertEquals("Memory page limit", 10, LargeSelect.getMemoryPageLimit());
-        LargeSelect.setMemoryPageLimit(LargeSelect.DEFAULT_MEMORY_LIMIT_PAGES);
-        assertEquals("Memory page limit", 5, LargeSelect.getMemoryPageLimit());
+        LargeSelect<Author> ls = new LargeSelect<Author>(
+                criteria,
+                TEST_PAGE_SIZE,
+                AuthorPeer.getAuthorPeerImpl());
 
-        assertEquals("More indicator", "&gt;", LargeSelect.getMoreIndicator());
+        assertEquals("Memory page limit", 5, ls.getMemoryPageLimit());
+        ls.setMemoryPageLimit(10);
+        assertEquals("Memory page limit", 10, ls.getMemoryPageLimit());
+        ls.setMemoryPageLimit(LargeSelect.DEFAULT_MEMORY_LIMIT_PAGES);
+        assertEquals("Memory page limit", 5, ls.getMemoryPageLimit());
+
+        assertEquals("More indicator", "&gt;", ls.getMoreIndicator());
         String newMoreIndicator = "more than";
-        LargeSelect.setMoreIndicator(newMoreIndicator);
+        ls.setMoreIndicator(newMoreIndicator);
         assertEquals("More indicator", newMoreIndicator,
-                LargeSelect.getMoreIndicator());
-        LargeSelect.setMoreIndicator(LargeSelect.DEFAULT_MORE_INDICATOR);
-        assertEquals("More indicator", "&gt;", LargeSelect.getMoreIndicator());
+                ls.getMoreIndicator());
+        ls.setMoreIndicator(LargeSelect.DEFAULT_MORE_INDICATOR);
+        assertEquals("More indicator", "&gt;", ls.getMoreIndicator());
     }
-*/
+
     /**
      * Test a bunch of different methods when everything is set up correctly.
      */
     public void testLargeSelect() throws TorqueException
     {
-        AuthorPeer.addSelectColumns(criteria);
         LargeSelect<Author> ls = new LargeSelect<Author>(
                 criteria,
                 TEST_PAGE_SIZE,
-                new AuthorRecordMapper());
+                AuthorPeer.getAuthorPeerImpl());
 
         assertEquals("Page size", TEST_PAGE_SIZE, ls.getPageSize());
         assertTrue("Paginated", ls.getPaginated());
@@ -314,12 +317,10 @@ public class LargeSelectTest extends Bas
     {
         // Alter criteria to retrieve only one row
         criteria.where(AuthorPeer.AUTHOR_ID, firstAuthorId);
-        AuthorPeer.addSelectColumns(criteria);
-
         LargeSelect<Author> ls = new LargeSelect<Author>(
                 criteria,
                 TEST_PAGE_SIZE,
-                new AuthorRecordMapper());
+                AuthorPeer.getAuthorPeerImpl());
 
         // Page 1
         List<Author> results = ls.getNextResults();
@@ -344,11 +345,10 @@ public class LargeSelectTest extends Bas
      */
     public void testInvalidateResult() throws Exception
     {
-        AuthorPeer.addSelectColumns(criteria);
         LargeSelect<Author> ls = new LargeSelect<Author>(
                 criteria,
                 TEST_PAGE_SIZE,
-                new AuthorRecordMapper());
+                AuthorPeer.getAuthorPeerImpl());
 
         assertEquals("Page size", TEST_PAGE_SIZE, ls.getPageSize());
         assertTrue("Paginated", ls.getPaginated());



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