[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Mon Jan 14 23:00:45 UTC 2008


gordonp
Mon Jan 14 18:00:44 EST 2008
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test
In directory dev.open-bio.org:/tmp/cvs-serv8988/src/main/ca/ucalgary/seahawk/gui/test

Modified Files:
	MobyContentGUITestCase.java 
Log Message:
Updates for javax.xml.xpath support rather than Aapache Xalan
moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test MobyContentGUITestCase.java,1.2,1.3
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java	2006/10/25 13:54:50	1.2
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/seahawk/gui/test/MobyContentGUITestCase.java	2008/01/14 23:00:44	1.3
@@ -132,15 +132,17 @@
 	// work out, in which case we can check what services we can run
 	org.w3c.dom.Node context_node = null;
 	org.w3c.dom.Node doc_root = domDoc.getDocumentElement();
-	org.apache.xpath.objects.XObject xobject = null;
+	Object xobject = null;
 	try{
-	    xobject = org.apache.xpath.XPathAPI.eval(doc_root, testNode);
-	    if(xobject == null || !(xobject instanceof org.apache.xpath.objects.XNodeSet)){
+	    xobject = javax.xml.xpath.XPathFactory.newInstance().newXPath().evaluate(testNode,
+										     doc_root,
+										     javax.xml.xpath.XPathConstants.NODESET);
+	    if(xobject == null || !(xobject instanceof org.w3c.dom.NodeList)){
 		fail("The returned value from running context node specifier " +
 		     "(" + testNode + ") was not a XNodeSet as expected, cannot test MobyClient test" +
 		     " without a context node");
 	    }
-	    org.w3c.dom.NodeList result = ((org.apache.xpath.objects.XNodeSet) xobject).nodelist();
+	    org.w3c.dom.NodeList result = (org.w3c.dom.NodeList) xobject;
 	    System.out.println("There are " + result.getLength() + 
 			       " instances of " + testNode + " in the document");
 	    if(result.getLength() == 0){
@@ -151,20 +153,22 @@
 	    // Take the first node context node of the right type that we find in the document
 	    context_node = result.item(0);
 	    System.out.println("Context node ID: " + ((org.w3c.dom.Element) context_node).getAttribute("element_id"));
-	}catch(javax.xml.transform.TransformerException te){
+	}catch(javax.xml.xpath.XPathExpressionException xpe){
 	    fail("The context node specifier XPath (" + testNode +
-		 ") could not be evaluated, cannot test MobyClient without a context: " + te);
+		 ") could not be evaluated, cannot test MobyClient without a context: " + xpe);
 	}
 
 	//tmp
 	try{
-	    xobject = org.apache.xpath.XPathAPI.eval(context_node, testXPath);
-	    if(xobject == null || !(xobject instanceof org.apache.xpath.objects.XNodeSet)){
+	    xobject = javax.xml.xpath.XPathFactory.newInstance().newXPath().evaluate(testXPath, 
+										     context_node,
+										     javax.xml.xpath.XPathConstants.NODESET);
+	    if(xobject == null || !(xobject instanceof org.w3c.dom.NodeList)){
 		fail("The returned value from running context node specifier " +
 		     "(" + testNode + ") was not a XNodeSet as expected, cannot test MobyClient test" +
 		     " without a context node");
 	    }
-	    org.w3c.dom.NodeList result = ((org.apache.xpath.objects.XNodeSet) xobject).nodelist();
+	    org.w3c.dom.NodeList result = (org.w3c.dom.NodeList) xobject;
 	    System.out.println("There are " + result.getLength() + 
 			       " instances of " + testXPath + " in the context node");
 	    if(result.getLength() == 0){
@@ -172,9 +176,9 @@
 		     ") did not return any nodes under " +
 		     context_node + ". Cannot test MobyClient without a MOBY data node");
 	    }
-	}catch(javax.xml.transform.TransformerException te){
+	}catch(javax.xml.xpath.XPathExpressionException xpe){
 	    fail("The MOBY node specifier XPath (" + testXPath +
-		 ") could not be evaluated, cannot test MobyClient without a context: " + te);
+		 ") could not be evaluated, cannot test MobyClient without a context: " + xpe);
 	}
 	//end tmp
 	




More information about the MOBY-guts mailing list