Package com.sun.msv.generator

Examples of com.sun.msv.generator.Driver$CommandLineException


       */
    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 );
    }
View Full Code Here

TOP

Related Classes of com.sun.msv.generator.Driver$CommandLineException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.