Package com.eviware.soapui.model.testsuite

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


            }
        } catch (Throwable e) {
            String msg = "XQuery Match Assertion failed for path [" + path + "] : " + e.getClass().getSimpleName() + ":"
                    + e.getMessage();

            throw new AssertionException(new AssertionError(msg));
        }

        return type + " matches content for [" + path + "]";
    }
View Full Code Here


            } else {
                ix = ignoreCase ? content.toUpperCase().indexOf(replToken.toUpperCase()) : content.indexOf(replToken);
            }

            if (ix == -1) {
                throw new AssertionException(new AssertionError("Missing token [" + replToken + "] in " + type));
            }
        }

        return type + " contains token [" + replToken + "]";
    }
View Full Code Here

        if (missingResourcesList != null && !missingResourcesList.isEmpty()) {
            StringBuilder sb = new StringBuilder("Missing resources: \n");
            for (String url : missingResourcesList) {
                sb.append(url + "  ;\n");
            }
            throw new AssertionException(new AssertionError(sb.toString()));
        }

        return "HTTP Download all resources OK";
    }
View Full Code Here

            scriptEngine.setVariable("assertion", this);

            Object result = scriptEngine.run();
            return result == null ? null : result.toString();
        } catch (Throwable e) {
            throw new AssertionException(new AssertionError(e.getMessage()));
        } finally {
            scriptEngine.clearVariables();
        }
    }
View Full Code Here

    }

    protected String internalAssertProperty(TestPropertyHolder source, String propertyName,
                                            MessageExchange messageExchange, SubmitContext context) throws AssertionException {
        if (!XmlUtils.seemsToBeXml(source.getPropertyValue(propertyName))) {
            throw new AssertionException(new AssertionError("Property '" + propertyName
                    + "' has value which is not xml!"));
        }
        return assertContent(source.getPropertyValue(propertyName), context, propertyName);
    }
View Full Code Here

            } else {
                msg = "XPathContains assertion failed for path [" + path + "] : " + e.getClass().getSimpleName() + ":"
                        + e.getMessage();
            }

            throw new AssertionException(new AssertionError(msg));
        }

        return type + " matches content for [" + path + "]";
    }
View Full Code Here

            } else {
                ix = ignoreCase ? content.toUpperCase().indexOf(replToken.toUpperCase()) : content.indexOf(replToken);
            }

            if (ix != -1) {
                throw new AssertionException(new AssertionError(type + " contains token [" + replToken + "]"));
            }
        }

        return type + " does not contain token [" + replToken + "]";
    }
View Full Code Here

        Response response = messageExchange.getResponse();
        long timeTaken = response == null ? messageExchange.getTimeTaken() : response.getTimeTaken();

        // assert!
        if (timeTaken > Long.parseLong(PropertyExpander.expandProperties(context, SLA))) {
            throw new AssertionException(new AssertionError("Response did not meet SLA " + timeTaken + "/" + SLA));
        }

        return "Response meets SLA";
    }
View Full Code Here

            return assertWsdlResponse((WsdlMessageExchange) messageExchange, context);
        } else if (messageExchange instanceof RestMessageExchange) {
            return assertWadlResponse((RestMessageExchange) messageExchange, context);
        }

        throw new AssertionException(new AssertionError("Unknown MessageExchange type"));
    }
View Full Code Here

            throws AssertionException {
        WadlDefinitionContext wadlContext = null;
        try {
            definitionContext = getWadlContext(messageExchange, context);
        } catch (Exception e1) {
            throw new AssertionException(new AssertionError(e1.getMessage()));
        }

        WadlValidator validator = new WadlValidator(wadlContext);

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

        return "Schema compliance OK";
    }
View Full Code Here

TOP

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

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.