kward 2002/06/11 19:12:25
Modified: java/scratchpad/tests/src XMLRPCAPITestCase.java
Log:
cleaned up tests
Revision Changes Path
1.3 +28 -7
xml-xindice/java/scratchpad/tests/src/XMLRPCAPITestCase.java
Index: XMLRPCAPITestCase.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/scratchpad/tests/src/XMLRPCAPITestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLRPCAPITestCase.java 11 Jun 2002 04:28:37 -0000 1.2
+++ XMLRPCAPITestCase.java 12 Jun 2002 02:12:25 -0000 1.3
@@ -119,7 +119,8 @@
// Utility functions
- protected void createCollection(String collection) throws Exception {
+ protected String createCollection(String collection) throws Exception {
+ Hashtable result = new Hashtable();
Hashtable message = new Hashtable();
message.put("message", "CreateCollection");
@@ -130,7 +131,8 @@
params.addElement(message);
- client.execute("run", params);
+ result = (Hashtable) client.execute("run", params);
+ return (String) result.get("result");
}
protected void dropCollection(String collection) throws Exception {
@@ -147,7 +149,8 @@
}
- protected void createIndexer(String name, String pattern) throws
Exception {
+ protected String createIndexer(String name, String pattern) throws
Exception {
+ Hashtable result = new Hashtable();
Hashtable message = new Hashtable();
message.put("message", "CreateIndexer");
@@ -159,7 +162,8 @@
params.addElement(message);
- client.execute("run", params);
+ result = (Hashtable) client.execute("run", params);
+ return (String) result.get("result");
}
@@ -178,7 +182,8 @@
}
- protected void insertDocument(String name, String doc) throws Exception {
+ protected String insertDocument(String name, String doc) throws
Exception {
+ Hashtable result = new Hashtable();
Hashtable message = new Hashtable();
message.put("message", "InsertDocument");
@@ -190,8 +195,24 @@
params.addElement(message);
- client.execute("run", params);
+ result = (Hashtable) client.execute("run", params);
+ return (String) result.get("result");
+
+ }
+
+ protected void removeDocument(String name) throws Exception {
+ Hashtable message = new Hashtable();
+ message.put("message", "RemoveDocument");
+ message.put("collection", "/" + INSTANCE_NAME + "/" +
TEST_COLLECTION_NAME );
+ message.put("name", name);
+
+ Vector params = new Vector();
+
+ params.addElement(message);
+
+ client.execute("run", params);
+
}
}