Skip to content

Commit

Permalink
Activating xsdlib test
Browse files Browse the repository at this point in the history
  • Loading branch information
svanteschubert committed Mar 10, 2024
1 parent 4ac0c6c commit e4bd774
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.junit.Test;
import org.relaxng.datatype.Datatype;
import org.relaxng.datatype.DatatypeException;

Expand All @@ -24,18 +25,29 @@
*
* @author <a href="mailto:[email protected]">Kohsuke KAWAGUCHI</a>
*/
class TestDriver implements ErrorReceiver
public class TestDriverTest implements ErrorReceiver
{


String parser;

public static void main (String args[]) throws Exception {

TestDriverTest testDriver = new TestDriverTest();
if( args.length>=1 ) testDriver.parser = args[0];
else testDriver.parser = "org.apache.xerces.parsers.SAXParser";
// reads test case file
testDriver.runTests();
}

@Test
public void runTests() throws Exception {

try {
String parser;
if( args.length>=1 ) parser = args[0];
else parser = "org.apache.xerces.parsers.SAXParser";
// reads test case file
Document doc = new SAXBuilder(parser).build(
TestDriver.class.getResourceAsStream("DataTypeTest.xml") );
Document doc = new SAXBuilder(parser).build(TestDriverTest.class.getResourceAsStream("DataTypeTest.xml") );

DataTypeTester tester = new DataTypeTester(System.out,new TestDriver());
DataTypeTester tester = new DataTypeTester(System.out,this);
// perform test for each "case" item
Iterator itr = doc.getRootElement().getChildren("case").iterator();
while(itr.hasNext())
Expand Down

0 comments on commit e4bd774

Please sign in to comment.