Examples of SchemaValidator


Examples of com.globant.google.mendoza.malbec.SchemaValidator

   */
  public void setMerchantCalculation(final String callbackMsg,
      final String resultMsg, final Date startTime, final Date endTime) {
    log.trace("Entering setMerchantCalculation");

    SchemaValidator validator = new SchemaValidator();
    SchemaValidationResult result = validator.validate(resultMsg);
    boolean resultXMLValid = result.isXmlValid();
    String validationMessage = "Merchant calculation results XML is valid.";
    if (!resultXMLValid) {
      validationMessage = "Merchant calculation results XML is not valid.\n";
      validationMessage = validationMessage + result.getMessage();
View Full Code Here

Examples of com.globant.google.mendoza.malbec.SchemaValidator

        log.trace("Leaving execute");
        throw new RuntimeException(
                "No shopping cart found."
            + " Please checkout one first.");
      }
      SchemaValidator validator = new SchemaValidator();
      SchemaValidationResult validationResult =
        validator.validate(getMendozaState().getShoppingCart());
      if (!validationResult.isXmlValid()) {
        log.trace("Leaving execute");
        throw new RuntimeException(
            "The shopping cart XML is not valid. "
            + validationResult.getMessage());
View Full Code Here

Examples of com.volantis.xml.schema.validator.SchemaValidator

            String expectedString = readAsString(expected);
            String actualString = output.toString();

            // Create the validator.
            SchemaValidator schemaValidator = new SchemaValidator();
            schemaValidator.addSchema(PolicySchemas.MARLIN_LPDM_V3_0);
            schemaValidator.addSchemata(PolicySchemas.MARLIN_RPDM_DTDS);
            schemaValidator.addSchemata(PolicySchemas.REPOSITORY_2005_09);
            schemaValidator.addSchemata(PolicySchemas.REPOSITORY_2005_12);
            schemaValidator.addSchemata(PolicySchemas.REPOSITORY_2006_02);

            // Make sure that the input result is valid before comparing.
            schemaValidator.validate(new StringContentInput(inputString));

            // Make sure that the expected result is valid before comparing.
            schemaValidator.validate(new StringContentInput(expectedString));

            boolean worked = false;
            try {
                XMLAssert.assertXMLEqual("Result should be as expected",
                        new StringReader(expectedString),
View Full Code Here

Examples of com.volantis.xml.schema.validator.SchemaValidator

        assertNull(third.getNext());
    }

    public void testSchema() throws SAXException, IOException {
        final SchemaValidator validator = new SchemaValidator();
        validator.addSchemata(XDIMESchemata.ALL_XDIME2_SCHEMATA);
        validator.validate(new BinaryContentInput(
            getClass().getResourceAsStream("res/script-test.xml")));
        try {
            validator.validate(new BinaryContentInput(
                getClass().getResourceAsStream("res/invalid-script-test.xml")));
            fail("should fail with exception");
        } catch (SAXException e) {
            // expected
        }
View Full Code Here

Examples of com.volantis.xml.schema.validator.SchemaValidator

     * @param schemata  The schemata that is to be tested.
     */
    public SchemaTestBuilder(Class testClass, final Schemata schemata) {
        this.testClass = testClass;
        suite = new TestSuite();
        schemaValidator = new SchemaValidator();
        schemaValidator.addSchemata(schemata);
    }
View Full Code Here

Examples of edu.indiana.extreme.gfac.schemas.SchemaValidator

    }
   
    public static String createWsdl(String serviceMapAsStr,boolean isAbstract) throws XregistryException{
        try {
            ServiceMapType serviceMap = ServiceMapDocument.Factory.parse(serviceMapAsStr).getServiceMap();
            SchemaValidator validator = new SchemaValidator(serviceMap);
            validator.validate();
            QName serviceQname = new QName(serviceMap.getService().getServiceName()
                    .getTargetNamespace(), serviceMap.getService().getServiceName()
                    .getStringValue());
            WSDLGenerator wsdlGenerator = new WSDLGenerator();
            Hashtable serviceTable = wsdlGenerator.generateWSDL(null, serviceQname, null,
View Full Code Here

Examples of net.sf.saxon.s9api.SchemaValidator

        Receiver receiver = destination.getReceiver(controller.getConfiguration());
        PipelineConfiguration pipe = controller.makePipelineConfiguration();
        pipe.setRecoverFromValidationErrors(false);
        receiver.setPipelineConfiguration(pipe);

        SchemaValidator validator = manager.newSchemaValidator();
        validator.setDestination(destination);

        dumpTree(document, "Input");

        validator.validate(document.asSource());

        XdmNode valid = destination.getXdmNode();

        dumpTree(valid, "Output");
    }
View Full Code Here

Examples of net.sf.saxon.s9api.SchemaValidator

        Receiver receiver = destination.getReceiver(controller.getConfiguration());
        PipelineConfiguration pipe = controller.makePipelineConfiguration();
        pipe.setRecoverFromValidationErrors(!getOption(_assert_valid,false));
        receiver.setPipelineConfiguration(pipe);

        SchemaValidator validator = manager.newSchemaValidator();
        validator.setDestination(destination);
        validator.setErrorListener(new XSDErrorHandler());

        String mode = getOption(_mode, "strict");
        validator.setLax("lax".equals(mode));

        boolean useHints = getOption(_use_location_hints, false);
        validator.setUseXsiSchemaLocation(useHints);
       
        try {
            logger.trace(MessageFormatter.nodeMessage(step.getNode(),
                    "Validating: " + doc.getBaseURI().toASCIIString()));

            validator.validate(doc.asSource());
            if (validationException != null) {
                throw (SaxonApiException) validationException;
            }
        } catch (SaxonApiException sae) {
            if (getOption(_assert_valid,false)) {
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaValidator

    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( cfg, settings ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( cfg, settings ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( cfg, settings );
    }
View Full Code Here

Examples of org.hibernate.tool.hbm2ddl.SchemaValidator

    }
    if ( settings.isAutoUpdateSchema() ) {
      new SchemaUpdate( cfg, settings ).execute( false, true );
    }
    if ( settings.isAutoValidateSchema() ) {
      new SchemaValidator( cfg, settings ).validate();
    }
    if ( settings.isAutoDropSchema() ) {
      schemaExport = new SchemaExport( cfg, settings );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.