db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1484256 - in /db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque: BaseDatabaseTestCase.java DataTest.java DocsTest.java util/BasePeerTest.java
Date Sun, 19 May 2013 10:03:24 GMT
Author: tfischer
Date: Sun May 19 10:03:24 2013
New Revision: 1484256

URL: http://svn.apache.org/r1484256
Log:
TORQUE-279 Remove deprecated methods and classes from the runtime

Modified:
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DocsTest.java
    db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/BasePeerTest.java

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java?rev=1484256&r1=1484255&r2=1484256&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/BaseDatabaseTestCase.java
Sun May 19 10:03:24 2013
@@ -32,7 +32,7 @@ import org.apache.torque.test.dbobject.A
 import org.apache.torque.test.dbobject.Book;
 import org.apache.torque.test.peer.AuthorPeer;
 import org.apache.torque.test.peer.BookPeer;
-import org.apache.torque.util.BasePeer;
+import org.apache.torque.util.BasePeerImpl;
 import org.apache.torque.util.CountHelper;
 
 /**
@@ -83,7 +83,7 @@ public abstract class BaseDatabaseTestCa
                     "getMysqlVersion called but database adapter is "
                         + adapter.getClass().getName());
         }
-        List<String> records = BasePeer.doSelect(
+        List<String> records = new BasePeerImpl().doSelect(
                 "show variables like \"version\"",
                 new StringMapper(1),
                 (String) null);
@@ -189,7 +189,7 @@ public abstract class BaseDatabaseTestCa
      *
      * @throws TorqueException if reading data fails.
      */
-    protected void verifyBookstore(List<Author> toVerify) throws TorqueException
+    protected void verifyBookstore(final List<Author> toVerify) throws TorqueException
     {
         int numBooks = 0;
 

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java?rev=1484256&r1=1484255&r2=1484256&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java (original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/DataTest.java Sun
May 19 10:03:24 2013
@@ -34,7 +34,6 @@ import org.apache.torque.adapter.DerbyAd
 import org.apache.torque.adapter.MssqlAdapter;
 import org.apache.torque.adapter.MysqlAdapter;
 import org.apache.torque.criteria.Criteria;
-import org.apache.torque.criteria.CriteriaInterface;
 import org.apache.torque.criteria.Criterion;
 import org.apache.torque.om.mapper.CompositeMapper;
 import org.apache.torque.om.mapper.IntegerMapper;
@@ -72,7 +71,7 @@ import org.apache.torque.test.peer.NopkP
 import org.apache.torque.test.peer.VarcharTypePeer;
 import org.apache.torque.test.recordmapper.AuthorRecordMapper;
 import org.apache.torque.test.recordmapper.BookRecordMapper;
-import org.apache.torque.util.BasePeer;
+import org.apache.torque.util.BasePeerImpl;
 import org.apache.torque.util.CountHelper;
 import org.apache.torque.util.Transaction;
 
@@ -392,13 +391,13 @@ public class DataTest extends BaseDataba
         Criteria criteria = new Criteria();
         criteria.addSelectColumn(
                 new ColumnImpl("count(distinct(" + BookPeer.BOOK_ID + "))"));
-        BasePeer.doSelect(criteria, new IntegerMapper());
+        new BasePeerImpl<Object>().doSelect(criteria, new IntegerMapper());
 
         // test qualifiers in function in select columns
         criteria = new Criteria();
         criteria.addSelectColumn(
                 new ColumnImpl("count(distinct " + BookPeer.BOOK_ID + ")"));
-        BasePeer.doSelect(criteria, new IntegerMapper());
+        new BasePeerImpl<Object>().doSelect(criteria, new IntegerMapper());
     }
 
     /**
@@ -411,7 +410,7 @@ public class DataTest extends BaseDataba
 
         criteria.addSelectColumn(BookPeer.BOOK_ID);
 
-        BasePeer.doSelect(criteria, new IntegerMapper());
+        new BasePeerImpl<Object>().doSelect(criteria, new IntegerMapper());
     }
 
     /**
@@ -835,7 +834,7 @@ public class DataTest extends BaseDataba
         // we need an additional column to select from,
         // to indicate the table we want use
         criteria.addSelectColumn(AuthorPeer.AUTHOR_ID);
-        BasePeer.doSelect(criteria, new DoNothingMapper());
+        new BasePeerImpl<Object>().doSelect(criteria, new DoNothingMapper());
     }
 
     /**
@@ -1373,7 +1372,7 @@ public class DataTest extends BaseDataba
      * @param fullyQualifiedColumnName the fully qualified column name, not null
      * @return the column name stripped from the table (and schema) prefixes
      */
-    public static String getRawColumnName(String fullyQualifiedColumnName)
+    public static String getRawColumnName(final String fullyQualifiedColumnName)
     {
         int dotPosition = fullyQualifiedColumnName.lastIndexOf(".");
         if (dotPosition == -1)
@@ -1390,9 +1389,9 @@ public class DataTest extends BaseDataba
     {
 
         public Object processRow(
-                    ResultSet resultSet,
-                    int rowOffset,
-                    CriteriaInterface<?> criteria)
+                    final ResultSet resultSet,
+                    final int rowOffset,
+                    final Criteria criteria)
                 throws TorqueException
         {
             return null;

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=1484256&r1=1484255&r2=1484256&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
May 19 10:03:24 2013
@@ -31,7 +31,7 @@ import org.apache.torque.test.dbobject.A
 import org.apache.torque.test.dbobject.Book;
 import org.apache.torque.test.peer.AuthorPeer;
 import org.apache.torque.test.peer.BookPeer;
-import org.apache.torque.util.BasePeer;
+import org.apache.torque.util.BasePeerImpl;
 
 /**
  * Runtime tests to make sure that the code which is supplied
@@ -219,7 +219,7 @@ public class DocsTest extends BaseDataba
         List<List<Object>> result = null;
         try
         {
-            result = BasePeer.doSelect(
+            result = new BasePeerImpl<Object>().doSelect(
                     "SELECT book.* FROM book "
                         + "INNER JOIN author "
                         + "ON book.AUTHOR_ID=author.AUTHOR_ID",
@@ -242,7 +242,7 @@ public class DocsTest extends BaseDataba
         result = null;
         try
         {
-            result = BasePeer.doSelect(
+            result = new BasePeerImpl<Object>().doSelect(
                     "SELECT book.* FROM book,author "
                         + "WHERE book.AUTHOR_ID=author.AUTHOR_ID",
                     new ObjectListMapper(),

Modified: db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/BasePeerTest.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/BasePeerTest.java?rev=1484256&r1=1484255&r2=1484256&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/BasePeerTest.java
(original)
+++ db/torque/torque4/trunk/torque-test/src/test/java/org/apache/torque/util/BasePeerTest.java
Sun May 19 10:03:24 2013
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.torque.BaseDatabaseTestCase;
+import org.apache.torque.criteria.Criteria;
 import org.apache.torque.test.dbobject.Author;
 import org.apache.torque.test.peer.BookPeer;
 
@@ -42,16 +43,17 @@ public class BasePeerTest extends BaseDa
         cleanBookstore();
         insertBookstoreData();
         Criteria criteria = new Criteria(BookPeer.DATABASE_NAME);
-        criteria.add(BookPeer.TITLE, "Book 1 - Author 1");
+        criteria.where(BookPeer.TITLE, "Book 1 - Author 1");
 
         // execute
-        int deleted = BasePeer.doDelete(criteria);
+        BasePeerImpl<?> basePeerImpl = new BasePeerImpl<Object>();
+        int deleted = basePeerImpl.doDelete(criteria);
 
         // verify
         assertEquals(1, deleted);
         assertEquals(99, countHelper.count(BookPeer.getTableMap()));
         criteria = new Criteria();
-        criteria.add(BookPeer.TITLE, "Book 1 - Author 1");
+        criteria.where(BookPeer.TITLE, "Book 1 - Author 1");
         assertEquals(0, countHelper.count(criteria));
     }
 



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