cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r751526 - in /cxf/trunk: parent/pom.xml rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java systests/pom.xml
Date Sun, 08 Mar 2009 20:58:26 GMT
Author: dkulp
Date: Sun Mar  8 20:58:26 2009
New Revision: 751526

URL: http://svn.apache.org/viewvc?rev=751526&view=rev
Log:
Updates to get tests passing with newer rhino

Modified:
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java
    cxf/trunk/systests/pom.xml

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=751526&r1=751525&r2=751526&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Sun Mar  8 20:58:26 2009
@@ -934,6 +934,26 @@
                         <groupId>stax</groupId>
                         <artifactId>stax-api</artifactId>
                     </exclusion>
+            		<exclusion>
+            		  <artifactId>xmlParserAPIs</artifactId>
+            		  <groupId>xerces</groupId>
+            		</exclusion>
+            		<exclusion>
+            		  <artifactId>xercesImpl</artifactId>
+            		  <groupId>xerces</groupId>
+            		</exclusion>
+            		<exclusion>
+            		  <artifactId>xom</artifactId>
+            		  <groupId>xom</groupId>
+            		</exclusion>
+            		<exclusion>
+            		  <artifactId>xalan</artifactId>
+            		  <groupId>xalan</groupId>
+            		</exclusion>
+            		<exclusion>
+            		  <artifactId>xml-apis</artifactId>
+            		  <groupId>xml-apis</groupId>
+            		</exclusion>
 		    <exclusion>
 		      <groupId>org.codehaus.woodstox</groupId>
 		      <artifactId>wstx-asl</artifactId>
@@ -957,10 +977,30 @@
                         <groupId>stax</groupId>
                         <artifactId>stax-api</artifactId>
                     </exclusion>
-		    <exclusion>
-		      <groupId>org.codehaus.woodstox</groupId>
-		      <artifactId>wstx-asl</artifactId>
-		    </exclusion>
+                    <exclusion>
+                      <artifactId>xmlParserAPIs</artifactId>
+                      <groupId>xerces</groupId>
+                    </exclusion>
+                    <exclusion>
+                      <artifactId>xercesImpl</artifactId>
+                      <groupId>xerces</groupId>
+                    </exclusion>
+                    <exclusion>
+                      <artifactId>xom</artifactId>
+                      <groupId>xom</groupId>
+                    </exclusion>
+                    <exclusion>
+                      <artifactId>xalan</artifactId>
+                      <groupId>xalan</groupId>
+                    </exclusion>
+                    <exclusion>
+                      <artifactId>xml-apis</artifactId>
+                      <groupId>xml-apis</groupId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.codehaus.woodstox</groupId>
+                        <artifactId>wstx-asl</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
             <dependency>

Modified: cxf/trunk/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java?rev=751526&r1=751525&r2=751526&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java
(original)
+++ cxf/trunk/rt/frontend/js/src/main/java/org/apache/cxf/js/rhino/AbstractDOMProvider.java
Sun Mar  8 20:58:26 2009
@@ -32,15 +32,14 @@
 
 import org.w3c.dom.Node;
 
-import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 
 import org.mozilla.javascript.Context;
 import org.mozilla.javascript.ContextFactory;
 import org.mozilla.javascript.Function;
 import org.mozilla.javascript.Scriptable;
-import org.mozilla.javascript.ScriptableObject;
 import org.mozilla.javascript.Wrapper;
+import org.mozilla.javascript.xml.XMLObject;
 
 
 public abstract class AbstractDOMProvider {
@@ -162,19 +161,9 @@
             Object inDoc = null;
             if (isE4X) {
                 try {
-                    XmlObject xo = XmlObject.Factory.parse(node);
-                    XmlCursor cursor = xo.newCursor();
-                    // strip comments out, as xmlbeans doesn't
-                    // seem to like them
-                    do {
-                        if (cursor.isComment()) {
-                            cursor.removeXml();
-                        }
-                    } while (cursor.toNextToken() != XmlCursor.TokenType.NONE);
-                    cursor.dispose();           
-                    inDoc = Context.toObject(xo, scope);
+                    inDoc = Context.toObject(node, scope);
                     Object[] args = {inDoc};
-                    inDoc = cx.newObject(scriptScope, "XML", args);
+                    inDoc = cx.newObject(scope, "XML", args);
                 } catch (Exception ex) {
                     ex.printStackTrace();
                 }
@@ -183,25 +172,18 @@
             }
             Object[] args = {inDoc};
             Object jsResp = invokeFunc.call(cx, scope, scope, args);
-            if (isE4X) {
-                // need to check return type and throw exception
-                // if wrong type
-                Scriptable s = (Scriptable)jsResp;
-                Object out = ScriptableObject.callMethod(s,
-                                                         "getXmlObject",
-                                                         Context.emptyArgs);
-                Wrapper wrapped = (Wrapper)out;
-                XmlObject xml = (XmlObject)wrapped.unwrap();
-                node = xml.getDomNode();
-                response.setNode(node.getOwnerDocument());
-            } else {
-                if (jsResp instanceof Wrapper) {
-                    jsResp = ((Wrapper)jsResp).unwrap();
-                }
-                if (jsResp instanceof Node) {
-                    node = (Node)jsResp;
-                    response.setNode(node);
-                }
+            if (jsResp instanceof Wrapper) {
+                jsResp = ((Wrapper)jsResp).unwrap();
+            }
+            if (jsResp instanceof XMLObject) {
+                jsResp = org.mozilla.javascript.xmlimpl.XMLLibImpl.toDomNode(jsResp);
+            }
+            if (jsResp instanceof XmlObject) {
+                jsResp = ((XmlObject)jsResp).getDomNode();
+            }
+            if (jsResp instanceof Node) {
+                node = (Node)jsResp;
+                response.setNode(node);
             }
         } catch (Exception ex) {
             ex.printStackTrace();

Modified: cxf/trunk/systests/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/pom.xml?rev=751526&r1=751525&r2=751526&view=diff
==============================================================================
--- cxf/trunk/systests/pom.xml (original)
+++ cxf/trunk/systests/pom.xml Sun Mar  8 20:58:26 2009
@@ -425,7 +425,6 @@
         <dependency>
             <groupId>rhino</groupId>
             <artifactId>js</artifactId>
-            <version>1.6R7</version>
             <scope>test</scope>
         </dependency>
         <dependency>



Mime
View raw message