summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorJesse Wilson <jessewilson@google.com>2010-03-26 14:03:36 -0700
committerJesse Wilson <jessewilson@google.com>2010-03-26 14:03:36 -0700
commit5ab82b77afbc8af3b91e90ab46b0a7cc0a090f04 (patch)
treef12feeb7afa1f141a989bf159f9b844272a294bd /dom
parentf6b1c58bf436ad2091de956d4a027d615aebfade (diff)
downloadlibcore-5ab82b77afbc8af3b91e90ab46b0a7cc0a090f04.zip
libcore-5ab82b77afbc8af3b91e90ab46b0a7cc0a090f04.tar.gz
libcore-5ab82b77afbc8af3b91e90ab46b0a7cc0a090f04.tar.bz2
Fixing tests to handle changes in our behaviour since DOM 3.
Our exception priority has changed for DOM attributes. We previously used to throw DOMExceptions with namespace error codes and now throw DOMExceptions with character error codes when the attribute name is malformed. This caused changes to many tests. Another notable behaviour change is that we now supply the qname (like the RI) where previously we did not. It is optional, but we now include it for RI-consistency. Yet another behaviour change is that we don't look at System properties when choosing a SAX implementation. This simplifies our internals significantly. End users who want an alternative SAX implementation should construct it manually. Also adding @KnownFailure tags for new tests that we have never yet passed. Change-Id: I6f81bedd7c2a0867086dc507b3220c2b07c4d3d3
Diffstat (limited to 'dom')
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java9
-rw-r--r--dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java7
2 files changed, 9 insertions, 7 deletions
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java
index bc7b323..bae9800 100644
--- a/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java
+++ b/dom/src/test/java/org/w3c/domts/level2/core/documentcreateattributeNS04.java
@@ -92,13 +92,14 @@ public final class documentcreateattributeNS04 extends DOMTestCase {
qualifiedName = (String) qualifiedNames.get(indexN1004E);
{
- boolean success = false;
+ // BEGIN android-changed
+ // Our exception priorities differ from the spec
try {
attribute = doc.createAttributeNS(namespaceURI, qualifiedName);
- } catch (DOMException ex) {
- success = (ex.code == DOMException.NAMESPACE_ERR);
+ fail("documentcreateattributeNS04");
+ } catch (DOMException expected) {
}
- assertTrue("documentcreateattributeNS04", success);
+ // END android-changed
}
}
}
diff --git a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java
index 7300f80..9a83561 100644
--- a/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java
+++ b/dom/src/test/java/org/w3c/domts/level2/core/setAttributeNS02.java
@@ -75,13 +75,14 @@ public final class setAttributeNS02 extends DOMTestCase {
testAddr = elementList.item(0);
{
- boolean success = false;
+ // BEGIN android-changed
+ // Our exception priorities differ from the spec
try {
((Element) /*Node */testAddr).setAttributeNS(namespaceURI, qualifiedName, "newValue");
+ fail("throw_NAMESPACE_ERR");
} catch (DOMException ex) {
- success = (ex.code == DOMException.NAMESPACE_ERR);
}
- assertTrue("throw_NAMESPACE_ERR", success);
+ // END android-changed
}
}
/**