Package batch.model

Examples of batch.model.ISchema


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


        private final File src;
        public ISchema schema;

        public void runTest() throws Exception {
            // load grammar
            ISchema source = firstValidator.parseSchema(src);
            if (source == null)
                fail("failed to parse the original grammar"); // unexpected result

            // then convert it to the target grammar,
            // and parse it by the target grammar reader parser.
            GrammarWriter writer = getWriter();

            // serialize it into the XML representation
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            writer.setDocumentHandler(new XMLSerializer(baos, new OutputFormat("xml", null, true)));
            writer.write(source.asGrammar());

            // then parse it again
            schema = secondValidator.parseSchema(new ByteArrayInputStream(baos.toByteArray()));
            if (schema == null)
                fail("conversion failed"); // unexpected result
View Full Code Here

TOP

Related Classes of batch.model.ISchema

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.