Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects
In directory sc8-pr-cvs1:/tmp/cvs-serv29790/src/core/com/mockobjects
Modified Files:
ReturnObjectList.java ReturnObjectBag.java
Log Message:
Allow multiple return values from executeQuery
Index: ReturnObjectList.java
===================================================================
RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnObjectList.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ReturnObjectList.java 30 Aug 2002 14:49:57 -0000 1.4
+++ ReturnObjectList.java 23 Apr 2003 11:52:46 -0000 1.5
@@ -31,7 +31,7 @@
/**
* Add a next object to the end of the list.
- * @param anOjectToReturn object to be added to the list
+ * @param anObjectToReturn object to be added to the list
*/
public void addObjectToReturn(Object anObjectToReturn){
myObjects.add(anObjectToReturn);
Index: ReturnObjectBag.java
===================================================================
RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/ReturnObjectBag.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ReturnObjectBag.java 10 Apr 2003 10:33:22 -0000 1.3
+++ ReturnObjectBag.java 23 Apr 2003 11:52:46 -0000 1.4
@@ -59,6 +59,30 @@
}
/**
+ * Places an int into the list of return objects for a particular key. The value can be retrieved
+ * using the getNextReturnInt method
+ * @param key the key against which the object will be stored
+ * @param value the value to be added to the list for that key
+ * @see ReturnObjectList#addObjectToReturn
+ * @see #getNextReturnInt
+ */
+ public void putObjectToReturn(Object key, int value) {
+ putObjectToReturn(key, new Integer(value));
+ }
+
+ /**
+ * Places an boolean into the list of return objects for a particular key. The value can be retrieved
+ * using the getNextReturnBoolean method
+ * @param key the key against which the object will be stored
+ * @param value the value to be added to the list for that key
+ * @see ReturnObjectList#addObjectToReturn
+ * @see #getNextReturnBoolean
+ */
+ public void putObjectToReturn(Object key, boolean value) {
+ putObjectToReturn(key, new Boolean(value));
+ }
+
+ /**
* Checks each the list for each key to verify that all no objects remain
* in the list for that key.
* @see ReturnObjectList#verify
@@ -98,4 +122,15 @@
return getNextReturnObject(new Integer(key));
}
+ public Hashtable getHashTable(){
+ return returnObjectLists;
+ }
+
+ public int getNextReturnInt(Object key) {
+ return ((Integer)getNextReturnObject(key)).intValue();
+ }
+
+ public boolean getNextReturnBoolean(Object key) {
+ return ((Boolean)getNextReturnObject(key)).booleanValue();
+ }
}
|