Package com.consol.citrus.exceptions

Examples of com.consol.citrus.exceptions.CitrusRuntimeException


        } else if (replyPayload instanceof Document) {
            return new DOMSource((Document) replyPayload);
        } else if (replyPayload instanceof String) {
            return new StringSource((String) replyPayload);
        } else {
            throw new CitrusRuntimeException("Unknown type for reply message payload (" + replyPayload.getClass().getName() + ") " +
                    "Supported types are " + "'" + Source.class.getName() + "', " + "'" + Document.class.getName() + "'" +
                    ", or '" + String.class.getName() + "'");
        }
    }
View Full Code Here


     */
    public T payload(Resource payloadResource) {
        try {
            getPayloadTemplateMessageBuilder().setPayloadData(FileUtils.readToString(payloadResource));
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read payload resource", e);
        }

        return self;
    }
View Full Code Here

        StringResult result = new StringResult();

        try {
            marshaller.marshal(payload, result);
        } catch (XmlMappingException e) {
            throw new CitrusRuntimeException("Failed to marshal object graph for message payload", e);
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to marshal object graph for message payload", e);
        }

        getPayloadTemplateMessageBuilder().setPayloadData(result.toString());

        return self;
View Full Code Here

     */
    public T header(Resource resource) {
        try {
            getMessageContentBuilder().getHeaderData().add(FileUtils.readToString(resource));
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read header resource", e);
        }

        return self;
    }
View Full Code Here

        initializeScriptValidationContext();
       
        try {
            scriptValidationContext.setValidationScriptResourcePath(scriptResource.getFile().getAbsolutePath());
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to read script resource file", e);
        }

        return self;
    }
View Full Code Here

        initializeValidationContext();

        if (validationContext instanceof XmlMessageValidationContext) {
            return ((XmlMessageValidationContext)validationContext);
        } else {
            throw new CitrusRuntimeException("Unable to set XML property on validation context type " + validationContext);
        }
    }
View Full Code Here

    @Override
    public EndpointAdapter getEndpointAdapter(String mappingKey) {
        try {
            return applicationContext.getBean(mappingKey, EndpointAdapter.class);
        } catch (NoSuchBeanDefinitionException e) {
            throw new CitrusRuntimeException("Unable to find matching endpoint adapter with bean name '" +
                    mappingKey + "' in Spring bean application context", e);
        }
    }
View Full Code Here

* @author Christoph Deppisch
*/
public class SoapFaultGeneratingEndpoint implements MessageEndpoint {

  public void invoke(MessageContext messageContext) throws Exception {
    throw new CitrusRuntimeException();
  }
View Full Code Here

    @Override
    public EndpointAdapter getEndpointAdapter(String mappingKey) {
        if (adapterMappings.containsKey(mappingKey)) {
            return adapterMappings.get(mappingKey);
        } else {
            throw new CitrusRuntimeException("Unable to find matching endpoint adapter with mapping key '" + mappingKey + "'");

        }
    }
View Full Code Here

    @Override
    public String getMappingKey(Message request) {
        if (request.getHeader(headerName) != null) {
            return request.getHeader(headerName).toString();
        } else {
            throw new CitrusRuntimeException(String.format("Unable to find header '%s' in request message", headerName));
        }
    }
View Full Code Here

TOP

Related Classes of com.consol.citrus.exceptions.CitrusRuntimeException

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.