commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r694353 - in /commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model: dom/DOMModelTest.java jdom/JDOMModelTest.java
Date Thu, 11 Sep 2008 17:04:59 GMT
Author: mbenson
Date: Thu Sep 11 10:04:57 2008
New Revision: 694353

URL: http://svn.apache.org/viewvc?rev=694353&view=rev
Log:
further tests for [JXPATH-12]

Modified:
    commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java
    commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/jdom/JDOMModelTest.java

Modified: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java?rev=694353&r1=694352&r2=694353&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java
(original)
+++ commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/dom/DOMModelTest.java
Thu Sep 11 10:04:57 2008
@@ -17,6 +17,7 @@
 package org.apache.commons.jxpath.ri.model.dom;
 
 import org.apache.commons.jxpath.AbstractFactory;
+import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.ri.model.XMLModelTestCase;
 import org.apache.commons.jxpath.xml.DocumentContainer;
 
@@ -49,7 +50,13 @@
         assertXPathNodeType(context, "//location/@name", Attr.class);
         assertXPathNodeType(context, "//vendor", Element.class);
     }
-    
+
+    public void testGetElementDescendantOrSelf() {
+        JXPathContext childContext = context.getRelativeContext(context.getPointer("/vendor"));
+        assertTrue(childContext.getContextBean() instanceof Element);
+        assertXPathNodeType(childContext, "//vendor", Element.class);
+    }
+
     protected String getXMLSignature(
         Object node,
         boolean elements,

Modified: commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/jdom/JDOMModelTest.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/jdom/JDOMModelTest.java?rev=694353&r1=694352&r2=694353&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/jdom/JDOMModelTest.java
(original)
+++ commons/proper/jxpath/trunk/src/test/org/apache/commons/jxpath/ri/model/jdom/JDOMModelTest.java
Thu Sep 11 10:04:57 2008
@@ -19,6 +19,7 @@
 import java.util.List;
 
 import org.apache.commons.jxpath.AbstractFactory;
+import org.apache.commons.jxpath.JXPathContext;
 import org.apache.commons.jxpath.ri.model.XMLModelTestCase;
 import org.apache.commons.jxpath.xml.DocumentContainer;
 
@@ -46,7 +47,13 @@
         assertXPathNodeType(context, "//location/@name", Attribute.class);
         assertXPathNodeType(context, "//vendor", Element.class); //bugzilla #38586
     }
-    
+
+    public void testGetElementDescendantOrSelf() {
+        JXPathContext childContext = context.getRelativeContext(context.getPointer("/vendor"));
+        assertTrue(childContext.getContextBean() instanceof Element);
+        assertXPathNodeType(childContext, "//vendor", Element.class);
+    }
+
     public void testID() {
         // id() is not supported by JDOM
     }



Mime
View raw message