Permalink
Browse files

Include xml-apis. Needed for xerces DocumentBuilder.

convert TestDOMOutputter to JUnit4, add to allTests, and fix package
reference from org.jdom to org.jdom2.
  • Loading branch information...
1 parent 296ecb3 commit 3d76842509c352e50578fa515c661992cce0f162 @rolfl rolfl committed Aug 4, 2011
@@ -217,7 +217,7 @@ else if (node instanceof DocType) {
try {
DOMAdapter adapter =
(DOMAdapter)Class.forName(
- "org.jdom.adapters.JAXPDOMAdapter").newInstance();
+ "org.jdom2.adapters.JAXPDOMAdapter").newInstance();
// System.out.println("using JAXP");
return adapter.createDocument(dt);
}
View
Binary file not shown.
@@ -58,6 +58,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
import junit.framework.*;
import org.jdom2.test.cases.input.*;
+import org.jdom2.test.cases.output.TestDOMOutputter;
import org.jdom2.test.cases.output.TestXMLOutputter;
@@ -104,6 +105,7 @@ public static Test suite() {
suite.addTest(new JUnit4TestAdapter(TestSerialization.class));
suite.addTest(new JUnit4TestAdapter(TestSAXBuilder.class));
suite.addTest(new JUnit4TestAdapter(TestXMLOutputter.class));
+ suite.addTest(new JUnit4TestAdapter(TestDOMOutputter.class));
return suite;
}
}
@@ -7,65 +7,25 @@
* @author unascribed
* @version 0.1
*/
-import junit.framework.*;
import org.jdom2.*;
import java.util.*;
import org.jdom2.output.*;
+import org.junit.Test;
+import org.junit.runner.JUnitCore;
+import static org.junit.Assert.*;
-public final class TestDOMOutputter
-extends junit.framework.TestCase
-{
- /**
- * Resource Bundle for various testing resources
- */
- private ResourceBundle rb = ResourceBundle.getBundle("org.jdom2.test.Test");
+public final class TestDOMOutputter {
- /**
- * the directory where needed resource files will be kept
- */
- private String resourceDir = "";
-
- /**
- * a directory for temporary storage of files
- */
- private String scratchDir = "";
- /**
- * Construct a new instance.
- */
- public TestDOMOutputter(String name) {
- super(name);
- }
/**
* The main method runs all the tests in the text ui
*/
public static void main (String args[])
{
- junit.textui.TestRunner.run(suite());
- }
- /**
- * This method is called before a test is executed.
- */
- public void setUp() {
- resourceDir = rb.getString("test.resourceRoot");
- scratchDir = rb.getString("test.scratchDirectory");
-
- }
- /**
- * The suite method runs all the tests
- */
-public static Test suite () {
- TestSuite suite = new TestSuite(TestDOMOutputter.class);
- return suite;
- }
- /**
- * This method is called after a test is executed.
- */
- public void tearDown() {
- // your code goes here.
+ JUnitCore.runClasses(TestDOMOutputter.class);
}
-
+ @Test
public void test_ForceNamespaces() throws JDOMException {
Document doc = new Document();
Element root = new Element("root");

0 comments on commit 3d76842

Please sign in to comment.