You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by el...@apache.org on 2026/04/26 11:37:57 UTC
(xerces-j) branch simple created (now 824168201)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a change to branch simple
in repository https://gitbox.apache.org/repos/asf/xerces-j.git
at 824168201 Simplify AbstractTestCase
This branch includes the following new commits:
new 824168201 Simplify AbstractTestCase
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org
(xerces-j) 01/01: Simplify AbstractTestCase
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch simple
in repository https://gitbox.apache.org/repos/asf/xerces-j.git
commit 8241682013fe3b23f5df15fb57beb47bfcc0a31b
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sun Apr 26 06:37:47 2026 -0500
Simplify AbstractTestCase
---
tests/dom/traversal/AbstractTestCase.java | 42 ++++++++-----------------------
1 file changed, 10 insertions(+), 32 deletions(-)
diff --git a/tests/dom/traversal/AbstractTestCase.java b/tests/dom/traversal/AbstractTestCase.java
index ebc8bc67a..d3b979b2c 100644
--- a/tests/dom/traversal/AbstractTestCase.java
+++ b/tests/dom/traversal/AbstractTestCase.java
@@ -41,43 +41,21 @@ public abstract class AbstractTestCase extends TestCase {
private DocumentBuilder fDocumentBuilder;
- protected final void setUp() {
- try {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- dbf.setNamespaceAware(true);
- dbf.setExpandEntityReferences(false);
- fDocumentBuilder = dbf.newDocumentBuilder();
- }
- catch (ParserConfigurationException pce) {
- pce.printStackTrace();
- fail(pce.getMessage());
- }
+ protected final void setUp() throws ParserConfigurationException {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ dbf.setNamespaceAware(true);
+ dbf.setExpandEntityReferences(false);
+ fDocumentBuilder = dbf.newDocumentBuilder();
}
- protected final void tearDown() {
- fDocumentBuilder = null;
- }
-
- protected final ElementTraversal parse(String input) {
- try {
- Document doc = fDocumentBuilder.parse(new InputSource(new StringReader(input)));
- DOMImplementation domImpl = doc.getImplementation();
- assertTrue(domImpl.hasFeature("ElementTraversal", "1.0"));
- return toElementTraversal(doc.getDocumentElement());
- }
- catch (SAXException se) {
- se.printStackTrace();
- fail(se.getMessage());
- }
- catch (IOException ioe) {
- ioe.printStackTrace();
- fail(ioe.getMessage());
- }
- return null;
+ protected final ElementTraversal parse(String input) throws IOException, SAXException {
+ Document doc = fDocumentBuilder.parse(new InputSource(new StringReader(input)));
+ DOMImplementation domImpl = doc.getImplementation();
+ assertTrue(domImpl.hasFeature("ElementTraversal", "1.0"));
+ return toElementTraversal(doc.getDocumentElement());
}
protected final ElementTraversal toElementTraversal(Element e) {
- assertTrue("e instanceof ElementTraversal", e == null || e instanceof ElementTraversal);
return (ElementTraversal) e;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org