commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r419469 - in /jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils: MockResultSet.java MockResultSetMetaData.java
Date Thu, 06 Jul 2006 06:56:57 GMT
Author: bayard
Date: Wed Jul  5 23:56:56 2006
New Revision: 419469

URL: http://svn.apache.org/viewvc?rev=419469&view=rev
Log:
Changed mocks to throw UnsupportedOperationException for unimplemented methods instead of
being stubbed out as requested in DBUTILS-7

Modified:
    jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
    jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java

Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java?rev=419469&r1=419468&r2=419469&view=diff
==============================================================================
--- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
(original)
+++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSet.java
Wed Jul  5 23:56:56 2006
@@ -315,7 +315,7 @@
             return Boolean.valueOf(proxy == args[0]); 
         }
 
-        return null;
+        throw new UnsupportedOperationException("Unsupported method: " + methodName);
     }
 
     protected Boolean isLast() throws SQLException {
@@ -342,4 +342,4 @@
     protected Boolean wasNull() throws SQLException {
         return this.wasNull;
     }
-}
\ No newline at end of file
+}

Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java?rev=419469&r1=419468&r2=419469&view=diff
==============================================================================
--- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
(original)
+++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/MockResultSetMetaData.java
Wed Jul  5 23:56:56 2006
@@ -72,19 +72,8 @@
         } else if (methodName.equals("equals")) { 
             return Boolean.valueOf(proxy == args[0]); 
 
-            // stub out other methods for now
         } else {
-            Class returnType = method.getReturnType();
-
-            if (returnType.equals(String.class)) {
-                return "";
-
-            } else if (returnType.equals(Integer.TYPE)) {
-                return new Integer(0);
-
-            } else {
-                return Boolean.FALSE;
-            }
+            throw new UnsupportedOperationException("Unsupported method: " + methodName);
         }
     }
-}
\ No newline at end of file
+}



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


Mime
View raw message