[MOBY-guts] biomoby commit

senger@ebi.ac.uk senger at pub.open-bio.org
Sun Mar 2 20:48:24 UTC 2003


senger
Sun Mar  2 15:48:24 EST 2003
Update of /home/repository/moby/moby-live/Java/Clients
In directory pub.open-bio.org:/tmp/cvs-serv25704/Clients

Modified Files:
	Makefile TestingCentral.java 
Added Files:
	MobyCmdLineClient.java 
Removed Files:
	Test.java 
Log Message:
updated Moby in Java, add new client, add documentation
moby-live/Java/Clients MobyCmdLineClient.java,NONE,1.1 Makefile,1.2,1.3 TestingCentral.java,1.3,1.4 Test.java,1.1,NONE
===================================================================
RCS file: /home/repository/moby/moby-live/Java/Clients/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/Clients/Makefile	2003/02/27 16:28:29	1.2
+++ /home/repository/moby/moby-live/Java/Clients/Makefile	2003/03/02 20:48:24	1.3
@@ -5,7 +5,7 @@
 # -----------------------------------------------------------------------------
 
 SOURCE += TestingCentral
-SOURCE += Test
+SOURCE += MobyCmdLineClient
 ##SOURCE += CDATATest
 
 # -----------------------------------------------------------------------------

===================================================================
RCS file: /home/repository/moby/moby-live/Java/Clients/TestingCentral.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- /home/repository/moby/moby-live/Java/Clients/TestingCentral.java	2003/02/27 16:37:03	1.3
+++ /home/repository/moby/moby-live/Java/Clients/TestingCentral.java	2003/03/02 20:48:24	1.4
@@ -14,29 +14,52 @@
 import java.util.*;
 
 /**
- * An example how to call Moby Central services. It uses dynamic
- * invocation - which means that it does not use any WSDL. It is
- * written for <a href="http://xml.apache.org/axis/" target="_top">Apache Axis</a>
+ * An example how to call Moby registry directly.
+ * It is written using <a href="http://xml.apache.org/axis/" target="_top">Apache Axis</a>
  * (tested with Axis version 1.0).
  *<p>
  *
- * This is a testing client that calls all "pasive" services (those
- * that do not change the Moby Central database) using some hard-coded
- * values. Its main purpose is to show how to do it, especially how to
- * deal with deserialization/serialization of the Moby Central object.
- *<P>
+ * This is a testing client that calls as many Moby method as possible
+ * in order to test whether they return an error or not. Many pieces are
+ * there hard-coded - so there is no much sense to use it for anything
+ * else than just testing.
+ *<p>
  *
  * The command-line arguments for this client are:
  * <pre>
  *    -e &lt;endpoint&gt;
  *    -u &lt;uri&gt;
  * </pre>
- * where <em>endpoint</em> is a URL of a Moby Central service (default
- * value is <tt>http://mobycentral.cbr.nrc.ca/cgi-bin/MOBY-Central.pl</tt>),
- * and where <em>uri</em> is a namespace used by that service (default
- * value is <tt>http://mobycentral.cbr.nrc.ca/MOBY/Central</tt>).
+ * where <em>endpoint</em> is a URL of a Moby Central service
+ * and <em>uri</em> is a namespace used by that service (some default
+ * values applied if not given on the command-line).
  *<p>
  *
+ * By default it does all tests. But you can signal not to do any tests
+ * by the command-line option <tt>-na</tt>, or by one or more specific
+ * command-line options:
+ *<pre>
+ *  -no   ... do not test object type
+ *  -nt   ... do not test service type
+ *  -ns   ... do not test service
+ *  -ms   ... do not test namespace
+ *  -nl   ... do not do retrieval tests
+ *</pre>
+ * Of course, this makes sense only if you specify what tests you really
+ * want to do using one or more other command-line options:
+ *<pre>
+ *  -o    ... do object test
+ *  -t    ... do service type test
+ *  -m    ... do namespace test
+ *  -s    ... do service test
+ *  -l    ... do all retrieval tests
+ *  -ls   ... do service names retrieval
+ *  -lt   ... do service types retrieval
+ *  -lp   ... do providers retrieval
+ *  -ln   ... do namespaces retrieval
+ *  -lo   ... do object retrieval
+ *</pre>
+ *
  * @author <A HREF="mailto:senger at ebi.ac.uk">Martin Senger</A>
  * @version $Id$ */
 public class TestingCentral {
@@ -419,6 +442,7 @@
 						    "</registerService>"
 						});
 		System.out.println ("----------------------------\n" + result);
+		String serviceId = client.extractId (result);
 
 		// 2. locate service byte service type
 		System.out.println ("METHOD: locateServiceByType '" + serviceType + "'");
@@ -480,24 +504,24 @@
 		System.out.println ("-----------------------\n" + result);
 
 		// 6. deregister service
-// 		System.out.println ("METHOD: deregisterService \"" + serviceTypeId + "\"");
-// 		result = (String)client.doCall ("deregisterService",
-// 						new Object[] {
-// 						    "<deregisterService>" +
-// 						      "<serviceID>" + serviceId + "</serviceID>" +
-// 						    "</deregisterService>"
+		System.out.println ("METHOD: deregisterService \"" + serviceTypeId + "\"");
+		result = (String)client.doCall ("deregisterService",
+						new Object[] {
+						    "<deregisterService>" +
+						      "<serviceID>" + serviceId + "</serviceID>" +
+						    "</deregisterService>"
 
-// 						});
-// 		System.out.println ("---------------------------\n" + result);
+						});
+		System.out.println ("---------------------------\n" + result);
 
-		//
+		// 7. deregister the rest
 		result = client.deregisterServiceType (serviceTypeId);
+		result = client.deregisterObject (objectId1);
+		result = client.deregisterObject (objectId2);
+		result = client.deregisterObject (objectId3);
+		result = client.deregisterObject (objectId4);
 		result = client.deregisterNamespace (namespaceId1);
 		result = client.deregisterNamespace (namespaceId2);
-		result = client.deregisterNamespace (objectId1);
-		result = client.deregisterNamespace (objectId2);
-		result = client.deregisterNamespace (objectId3);
-		result = client.deregisterNamespace (objectId4);
 
 	    }
 

rcsdiff: /home/repository/moby/moby-live/Java/Clients/RCS/Test.java,v: No such file or directory



More information about the MOBY-guts mailing list