kward       2002/06/10 21:28:37

  Modified:    java/scratchpad/tests/src XMLRPCAPITestCase.java
  Log:
  Modified assertTrue() statements
  
  Revision  Changes    Path
  1.2       +109 -1    
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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XMLRPCAPITestCase.java    2 May 2002 03:58:40 -0000       1.1
  +++ XMLRPCAPITestCase.java    11 Jun 2002 04:28:37 -0000      1.2
  @@ -80,10 +80,118 @@
         XmlRpc.setEncoding("UTF8");
         XmlRpc.setDriver("xerces");
         client = new XmlRpcClient("http://localhost:4080/RPC2";);
  +
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "CreateCollection");
  +      message.put("collection", "/" + INSTANCE_NAME );
  +      message.put("name", TEST_COLLECTION_NAME);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      try {
  +         client.execute("run", params);
  +      } catch( Exception e ) {
  +         fail( e.getMessage() );
  +      }
      }
   
      public void tearDown() throws Exception {
   
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "RemoveCollection");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      try {
  +         client.execute("run", params);
  +      } catch( Exception e ) {
  +         fail( e.getMessage() );
  +      }
  +
      }
  +
  +
  +   // Utility functions
  +   protected void createCollection(String collection) throws Exception {
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "CreateCollection");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME );
  +      message.put("name", collection);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      client.execute("run", params);
  +   }
  +
  +   protected void dropCollection(String collection) throws Exception {
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "RemoveCollection");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME + "/" + collection);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      client.execute("run", params);
  +
  +    }
  +
  +    protected void createIndexer(String name, String pattern) throws 
Exception {
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "CreateIndexer");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME );
  +      message.put("name", name);
  +      message.put("pattern", pattern);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      client.execute("run", params);
  +
  +    }
  +
  +    protected void dropIndexer(String name) throws Exception {
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "RemoveIndexer");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME );
  +      message.put("name", name);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      client.execute("run", params);
  +
  +    }
  +
  +    protected void insertDocument(String name, String doc) throws Exception {
  +      Hashtable message = new Hashtable();
  +
  +      message.put("message", "InsertDocument");
  +      message.put("collection", "/" + INSTANCE_NAME + "/" + 
TEST_COLLECTION_NAME );
  +      message.put("name", name);
  +      message.put("document", doc);
  +
  +      Vector params = new Vector();
  +
  +      params.addElement(message);
  +
  +      client.execute("run", params);
  +
  +    }
   
    }
  
  
  

Reply via email to