jakarta-bsf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r931119 - /jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
Date Tue, 06 Apr 2010 12:38:26 GMT
Author: sebb
Date: Tue Apr  6 12:38:26 2010
New Revision: 931119

URL: http://svn.apache.org/viewvc?rev=931119&view=rev
Log:
Skip tests if .js engine does not support E4X

Modified:
    jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java

Modified: jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java?rev=931119&r1=931118&r2=931119&view=diff
==============================================================================
--- jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
(original)
+++ jakarta/bsf/branches/bsf3.x/bsf-utils/src/test/java/org/apache/bsf/xml/JavaScriptXMLHelperTestCase.java
Tue Apr  6 12:38:26 2010
@@ -38,7 +38,13 @@ public class JavaScriptXMLHelperTestCase
     private XMLHelper xmlHelper;
 
     public void testToOmElement() throws ScriptException {
-        Object scriptXML = engine.eval("<a><b>petra</b></a>");
+        Object scriptXML;
+        try {
+            scriptXML = engine.eval("<a><b>petra</b></a>");
+        } catch (ScriptException e) {
+            System.out.println("*** Skipping testToOmElement() because engine does not support
E4X: "+engine.getClass().getName());
+            return;
+        }
         assertTrue(scriptXML instanceof XMLObject);
 
         OMElement om = xmlHelper.toOMElement(scriptXML);
@@ -47,7 +53,16 @@ public class JavaScriptXMLHelperTestCase
     }
 
     public void testToScriptXML() throws ScriptException {
-        OMElement om = xmlHelper.toOMElement(engine.eval("<a><b>petra</b></a>"));
+        Object scriptXML;
+        try {
+            scriptXML = engine.eval("<a><b>petra</b></a>");
+        } catch (ScriptException e) {
+            System.out.println("*** Skipping testToScriptXML() because engine does not support
E4X: "+engine.getClass().getName());
+            return;
+        }
+        assertTrue(scriptXML instanceof XMLObject);
+
+        OMElement om = xmlHelper.toOMElement(scriptXML);
 
         Bindings bindings = engine.createBindings();
         bindings.put("xml", xmlHelper.toScriptXML(om));



---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Mime
View raw message