-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ac0c6c
commit e4bd774
Showing
1 changed file
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
||
|
@@ -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()) | ||
|