*/
public void runTest() throws Exception {
System.out.println(schemaFile.getPath());
Driver driver = new Driver(); // generator instance.
// parse parameters
driver.parseArguments(new String[]{"-seed","0", "-n","30", "-quiet"});
// parse example documents
Iterator itr = examples.iterator();
while( itr.hasNext() ) {
File example = (File)itr.next();
reader.setContentHandler( new ExampleReader(driver.exampleTokens) );
reader.parse( com.sun.msv.util.Util.getInputSource(example.getAbsolutePath()) );
}
// set the grammar
ISchema schema = validator.parseSchema(schemaFile);
assertNotNull( "failed to parse the schema", schema );
driver.grammar = schema.asGrammar();
driver.outputName = "NUL";
// run the test
assertEquals( "generator for "+schemaFile.getName(), driver.run(System.out), 0 );
// parse additional parameter
// generally, calling the parseArguments method more than once
// is not supported. So this is a hack.
driver.parseArguments(new String[]{"-error","10/100"});
assertEquals( "generator for "+schemaFile.getName(), driver.run(System.out), 0 );
}