Package com.eviware.soapui.model.testsuite

Examples of com.eviware.soapui.model.testsuite.AssertionException


        WsdlValidator validator = new WsdlValidator(wsdlContext);

        try {
            AssertionError[] errors = validator.assertResponse((WsdlMessageExchange) messageExchange, true);
            if (errors.length > 0) {
                throw new AssertionException(errors);
            }
        } catch (AssertionException e) {
            throw e;
        } catch (Exception e) {
            throw new AssertionException(new AssertionError(e.getMessage()));
        }

        return "Response Envelope OK";
    }
View Full Code Here


        if (StringUtils.hasContent(rootElementXPath)) {
          SoapUI.log.debug("Root XPath is: " + rootElementXPath);
          nodes = xmlHolder.getDomNodes(rootElementXPath);
        } else {
          AssertionError error = new AssertionError("XPath for validation root element is missing");
          throw new AssertionException(error);
        }
      } else {
        XmlObject xmlObject = xmlHolder.getXmlObject();
        nodes = new Node[1];
        nodes[0] = xmlObject.getDomNode();
      }
    } catch (XmlException e) {
      AssertionError error = new AssertionError(e.getError());
      throw new AssertionException(error);
    }
   
    if (nodes.length == 0) {
      AssertionError error = new AssertionError("XPath '" + rootElementXPath + "' returned no nodes");
      throw new AssertionException(error);
    }
    return nodes;
  }
View Full Code Here

      for (int i = 0; i < definitionPaths.length; ++i) {
        fileSources[i] = new StreamSource(buildAbsoluteFilepath(context, definitionPaths[i]));
      }
    } catch (FileNotFoundException e) {
      AssertionError error = new AssertionError(e.getLocalizedMessage());
      throw new AssertionException(error);
    }
   
    SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Validator validator = null;
    try {
      Schema schema = schemaFactory.newSchema(fileSources);
      validator = schema.newValidator();
    }
    catch (SAXException e) {
      AssertionError error = new AssertionError("Could not process XML schema at " + fileSources + ": " + e.getLocalizedMessage());
      throw new AssertionException(error);
    }
    return validator;
  }
View Full Code Here

      Source source = new SAXSource(new InputSource(reader));
      try {
        validator.validate(source);
      } catch (SAXException e) {
        AssertionError error = new AssertionError("Schema validation failed: " + e.getLocalizedMessage());
        throw new AssertionException(error);
      } catch (IOException e) {
        AssertionError error = new AssertionError("Schema validation failed: " + e.getLocalizedMessage());
        throw new AssertionException(error);
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.eviware.soapui.model.testsuite.AssertionException

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.