repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/GroovyActionBuilder.java
GroovyActionBuilder.script
public GroovyActionBuilder script(Resource scriptResource, Charset charset) { try { action.setScript(FileUtils.readToString(scriptResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script resource file", e); } return this; }
java
public GroovyActionBuilder script(Resource scriptResource, Charset charset) { try { action.setScript(FileUtils.readToString(scriptResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script resource file", e); } return this; }
[ "public", "GroovyActionBuilder", "script", "(", "Resource", "scriptResource", ",", "Charset", "charset", ")", "{", "try", "{", "action", ".", "setScript", "(", "FileUtils", ".", "readToString", "(", "scriptResource", ",", "charset", ")", ")", ";", "}", "catch"...
Sets the Groovy script to execute. @param scriptResource @param charset @return
[ "Sets", "the", "Groovy", "script", "to", "execute", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/GroovyActionBuilder.java#L75-L82
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/GroovyActionBuilder.java
GroovyActionBuilder.template
public GroovyActionBuilder template(Resource scriptTemplate, Charset charset) { try { action.setScriptTemplate(FileUtils.readToString(scriptTemplate, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script template file", e); } return this; }
java
public GroovyActionBuilder template(Resource scriptTemplate, Charset charset) { try { action.setScriptTemplate(FileUtils.readToString(scriptTemplate, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script template file", e); } return this; }
[ "public", "GroovyActionBuilder", "template", "(", "Resource", "scriptTemplate", ",", "Charset", "charset", ")", "{", "try", "{", "action", ".", "setScriptTemplate", "(", "FileUtils", ".", "readToString", "(", "scriptTemplate", ",", "charset", ")", ")", ";", "}",...
Use a script template resource. @param scriptTemplate the scriptTemplate to set @param charset
[ "Use", "a", "script", "template", "resource", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/GroovyActionBuilder.java#L106-L113
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/actions/JavaAction.java
JavaAction.getObjectInstanceFromClass
private Object getObjectInstanceFromClass(TestContext context) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { if (!StringUtils.hasText(className)) { throw new CitrusRuntimeException("Neither class name nor object instance reference " + "is set for Java reflection call"); } log.info("Instantiating class for name '" + className + "'"); Class<?> classToRun = Class.forName(className); Class<?>[] constructorTypes = new Class<?>[constructorArgs.size()]; Object[] constructorObjects = new Object[constructorArgs.size()]; for (int i = 0; i < constructorArgs.size(); i++) { constructorTypes[i] = constructorArgs.get(i).getClass(); if (constructorArgs.get(i).getClass().equals(String.class)) { constructorObjects[i] = context.replaceDynamicContentInString(constructorArgs.get(i).toString()); } else { constructorObjects[i] = constructorArgs.get(i); } } Constructor<?> constr = classToRun.getConstructor(constructorTypes); return constr.newInstance(constructorObjects); }
java
private Object getObjectInstanceFromClass(TestContext context) throws ClassNotFoundException, SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { if (!StringUtils.hasText(className)) { throw new CitrusRuntimeException("Neither class name nor object instance reference " + "is set for Java reflection call"); } log.info("Instantiating class for name '" + className + "'"); Class<?> classToRun = Class.forName(className); Class<?>[] constructorTypes = new Class<?>[constructorArgs.size()]; Object[] constructorObjects = new Object[constructorArgs.size()]; for (int i = 0; i < constructorArgs.size(); i++) { constructorTypes[i] = constructorArgs.get(i).getClass(); if (constructorArgs.get(i).getClass().equals(String.class)) { constructorObjects[i] = context.replaceDynamicContentInString(constructorArgs.get(i).toString()); } else { constructorObjects[i] = constructorArgs.get(i); } } Constructor<?> constr = classToRun.getConstructor(constructorTypes); return constr.newInstance(constructorObjects); }
[ "private", "Object", "getObjectInstanceFromClass", "(", "TestContext", "context", ")", "throws", "ClassNotFoundException", ",", "SecurityException", ",", "NoSuchMethodException", ",", "IllegalArgumentException", ",", "InstantiationException", ",", "IllegalAccessException", ",",...
Instantiate class for name. Constructor arguments are supported if specified. @param context the current test context. @return @throws ClassNotFoundException @throws NoSuchMethodException @throws SecurityException @throws InvocationTargetException @throws IllegalAccessException @throws InstantiationException @throws IllegalArgumentException
[ "Instantiate", "class", "for", "name", ".", "Constructor", "arguments", "are", "supported", "if", "specified", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/JavaAction.java#L135-L161
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/report/MessageListeners.java
MessageListeners.onInboundMessage
public void onInboundMessage(Message message, TestContext context) { if (message != null) { for (MessageListener listener : messageListener) { listener.onInboundMessage(message, context); } } }
java
public void onInboundMessage(Message message, TestContext context) { if (message != null) { for (MessageListener listener : messageListener) { listener.onInboundMessage(message, context); } } }
[ "public", "void", "onInboundMessage", "(", "Message", "message", ",", "TestContext", "context", ")", "{", "if", "(", "message", "!=", "null", ")", "{", "for", "(", "MessageListener", "listener", ":", "messageListener", ")", "{", "listener", ".", "onInboundMess...
Delegate to all known message listener instances. @param message @param context
[ "Delegate", "to", "all", "known", "message", "listener", "instances", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/report/MessageListeners.java#L44-L50
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/XmlValidationMatcher.java
XmlValidationMatcher.removeCDataElements
private String removeCDataElements(String value) { String data = value.trim(); if (data.startsWith(CDATA_SECTION_START)) { data = value.substring(CDATA_SECTION_START.length()); data = data.substring(0, data.length() - CDATA_SECTION_END.length()); } return data; }
java
private String removeCDataElements(String value) { String data = value.trim(); if (data.startsWith(CDATA_SECTION_START)) { data = value.substring(CDATA_SECTION_START.length()); data = data.substring(0, data.length() - CDATA_SECTION_END.length()); } return data; }
[ "private", "String", "removeCDataElements", "(", "String", "value", ")", "{", "String", "data", "=", "value", ".", "trim", "(", ")", ";", "if", "(", "data", ".", "startsWith", "(", "CDATA_SECTION_START", ")", ")", "{", "data", "=", "value", ".", "substri...
Cut off CDATA elements. @param value @return
[ "Cut", "off", "CDATA", "elements", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/XmlValidationMatcher.java#L77-L86
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/XmlValidationMatcher.java
XmlValidationMatcher.afterPropertiesSet
public void afterPropertiesSet() throws Exception { // try to find xml message validator in registry for (MessageValidator<? extends ValidationContext> messageValidator : messageValidatorRegistry.getMessageValidators()) { if (messageValidator instanceof DomXmlMessageValidator && messageValidator.supportsMessageType(MessageType.XML.name(), new DefaultMessage(""))) { xmlMessageValidator = (DomXmlMessageValidator) messageValidator; } } if (xmlMessageValidator == null) { LOG.warn("No XML message validator found in Spring bean context - setting default validator"); xmlMessageValidator = new DomXmlMessageValidator(); xmlMessageValidator.setApplicationContext(applicationContext); } }
java
public void afterPropertiesSet() throws Exception { // try to find xml message validator in registry for (MessageValidator<? extends ValidationContext> messageValidator : messageValidatorRegistry.getMessageValidators()) { if (messageValidator instanceof DomXmlMessageValidator && messageValidator.supportsMessageType(MessageType.XML.name(), new DefaultMessage(""))) { xmlMessageValidator = (DomXmlMessageValidator) messageValidator; } } if (xmlMessageValidator == null) { LOG.warn("No XML message validator found in Spring bean context - setting default validator"); xmlMessageValidator = new DomXmlMessageValidator(); xmlMessageValidator.setApplicationContext(applicationContext); } }
[ "public", "void", "afterPropertiesSet", "(", ")", "throws", "Exception", "{", "// try to find xml message validator in registry", "for", "(", "MessageValidator", "<", "?", "extends", "ValidationContext", ">", "messageValidator", ":", "messageValidatorRegistry", ".", "getMes...
Initialize xml message validator if not injected by Spring bean context. @throws Exception
[ "Initialize", "xml", "message", "validator", "if", "not", "injected", "by", "Spring", "bean", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/core/XmlValidationMatcher.java#L101-L115
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java
DynamicEndpointUriResolver.appendRequestPath
private String appendRequestPath(String uri, Map<String, Object> headers) { if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) { return uri; } String requestUri = uri; String path = headers.get(REQUEST_PATH_HEADER_NAME).toString(); while (requestUri.endsWith("/")) { requestUri = requestUri.substring(0, requestUri.length() - 1); } while (path.startsWith("/") && path.length() > 0) { path = path.length() == 1 ? "" : path.substring(1); } return requestUri + "/" + path; }
java
private String appendRequestPath(String uri, Map<String, Object> headers) { if (!headers.containsKey(REQUEST_PATH_HEADER_NAME)) { return uri; } String requestUri = uri; String path = headers.get(REQUEST_PATH_HEADER_NAME).toString(); while (requestUri.endsWith("/")) { requestUri = requestUri.substring(0, requestUri.length() - 1); } while (path.startsWith("/") && path.length() > 0) { path = path.length() == 1 ? "" : path.substring(1); } return requestUri + "/" + path; }
[ "private", "String", "appendRequestPath", "(", "String", "uri", ",", "Map", "<", "String", ",", "Object", ">", "headers", ")", "{", "if", "(", "!", "headers", ".", "containsKey", "(", "REQUEST_PATH_HEADER_NAME", ")", ")", "{", "return", "uri", ";", "}", ...
Appends optional request path to endpoint uri. @param uri @param headers @return
[ "Appends", "optional", "request", "path", "to", "endpoint", "uri", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/endpoint/resolver/DynamicEndpointUriResolver.java#L76-L93
train
citrusframework/citrus
modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsSyncConsumer.java
JmsSyncConsumer.saveReplyDestination
public void saveReplyDestination(JmsMessage jmsMessage, TestContext context) { if (jmsMessage.getReplyTo() != null) { String correlationKeyName = endpointConfiguration.getCorrelator().getCorrelationKeyName(getName()); String correlationKey = endpointConfiguration.getCorrelator().getCorrelationKey(jmsMessage); correlationManager.saveCorrelationKey(correlationKeyName, correlationKey, context); correlationManager.store(correlationKey, jmsMessage.getReplyTo()); } else { log.warn("Unable to retrieve reply to destination for message \n" + jmsMessage + "\n - no reply to destination found in message headers!"); } }
java
public void saveReplyDestination(JmsMessage jmsMessage, TestContext context) { if (jmsMessage.getReplyTo() != null) { String correlationKeyName = endpointConfiguration.getCorrelator().getCorrelationKeyName(getName()); String correlationKey = endpointConfiguration.getCorrelator().getCorrelationKey(jmsMessage); correlationManager.saveCorrelationKey(correlationKeyName, correlationKey, context); correlationManager.store(correlationKey, jmsMessage.getReplyTo()); } else { log.warn("Unable to retrieve reply to destination for message \n" + jmsMessage + "\n - no reply to destination found in message headers!"); } }
[ "public", "void", "saveReplyDestination", "(", "JmsMessage", "jmsMessage", ",", "TestContext", "context", ")", "{", "if", "(", "jmsMessage", ".", "getReplyTo", "(", ")", "!=", "null", ")", "{", "String", "correlationKeyName", "=", "endpointConfiguration", ".", "...
Store the reply destination either straight forward or with a given message correlation key. @param jmsMessage @param context
[ "Store", "the", "reply", "destination", "either", "straight", "forward", "or", "with", "a", "given", "message", "correlation", "key", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsSyncConsumer.java#L105-L115
train
citrusframework/citrus
modules/citrus-ws/src/main/java/com/consol/citrus/ws/validation/SimpleSoapAttachmentValidator.java
SimpleSoapAttachmentValidator.validateAttachmentContentData
protected void validateAttachmentContentData(String receivedContent, String controlContent, String controlContentId) { if (ignoreAllWhitespaces) { controlContent = StringUtils.trimAllWhitespace(controlContent); receivedContent = StringUtils.trimAllWhitespace(receivedContent); } Assert.isTrue(receivedContent.equals(controlContent), "Values not equal for attachment content '" + controlContentId + "', expected '" + controlContent.trim() + "' but was '" + receivedContent.trim() + "'"); }
java
protected void validateAttachmentContentData(String receivedContent, String controlContent, String controlContentId) { if (ignoreAllWhitespaces) { controlContent = StringUtils.trimAllWhitespace(controlContent); receivedContent = StringUtils.trimAllWhitespace(receivedContent); } Assert.isTrue(receivedContent.equals(controlContent), "Values not equal for attachment content '" + controlContentId + "', expected '" + controlContent.trim() + "' but was '" + receivedContent.trim() + "'"); }
[ "protected", "void", "validateAttachmentContentData", "(", "String", "receivedContent", ",", "String", "controlContent", ",", "String", "controlContentId", ")", "{", "if", "(", "ignoreAllWhitespaces", ")", "{", "controlContent", "=", "StringUtils", ".", "trimAllWhitespa...
Validates content data. @param receivedContent @param controlContent @param controlContentId
[ "Validates", "content", "data", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/validation/SimpleSoapAttachmentValidator.java#L76-L87
train
citrusframework/citrus
modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/server/RmiServerBuilder.java
RmiServerBuilder.remoteInterfaces
public RmiServerBuilder remoteInterfaces(Class<? extends Remote> ... remoteInterfaces) { endpoint.setRemoteInterfaces(Arrays.asList(remoteInterfaces)); return this; }
java
public RmiServerBuilder remoteInterfaces(Class<? extends Remote> ... remoteInterfaces) { endpoint.setRemoteInterfaces(Arrays.asList(remoteInterfaces)); return this; }
[ "public", "RmiServerBuilder", "remoteInterfaces", "(", "Class", "<", "?", "extends", "Remote", ">", "...", "remoteInterfaces", ")", "{", "endpoint", ".", "setRemoteInterfaces", "(", "Arrays", ".", "asList", "(", "remoteInterfaces", ")", ")", ";", "return", "this...
Sets the remote interfaces property. @param remoteInterfaces @return
[ "Sets", "the", "remote", "interfaces", "property", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-rmi/src/main/java/com/consol/citrus/rmi/server/RmiServerBuilder.java#L106-L109
train
citrusframework/citrus
modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/endpoint/VertxProducer.java
VertxProducer.sendOrPublishMessage
private void sendOrPublishMessage(Message message) { if (endpointConfiguration.isPubSubDomain()) { if (log.isDebugEnabled()) { log.debug("Publish Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'"); } vertx.eventBus().publish(endpointConfiguration.getAddress(), message.getPayload()); } else { if (log.isDebugEnabled()) { log.debug("Sending Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'"); } vertx.eventBus().send(endpointConfiguration.getAddress(), message.getPayload()); } }
java
private void sendOrPublishMessage(Message message) { if (endpointConfiguration.isPubSubDomain()) { if (log.isDebugEnabled()) { log.debug("Publish Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'"); } vertx.eventBus().publish(endpointConfiguration.getAddress(), message.getPayload()); } else { if (log.isDebugEnabled()) { log.debug("Sending Vert.x event bus message to address: '" + endpointConfiguration.getAddress() + "'"); } vertx.eventBus().send(endpointConfiguration.getAddress(), message.getPayload()); } }
[ "private", "void", "sendOrPublishMessage", "(", "Message", "message", ")", "{", "if", "(", "endpointConfiguration", ".", "isPubSubDomain", "(", ")", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Publish...
Sends or publishes new outbound message depending on eventbus nature. @param message
[ "Sends", "or", "publishes", "new", "outbound", "message", "depending", "on", "eventbus", "nature", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-vertx/src/main/java/com/consol/citrus/vertx/endpoint/VertxProducer.java#L84-L96
train
citrusframework/citrus
modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/container/StepTemplate.java
StepTemplate.getParameterTypes
public Type[] getParameterTypes() { Type[] types = new Type[parameterNames.size()]; for (int i = 0; i < types.length; i++) { types[i] = String.class; } return types; }
java
public Type[] getParameterTypes() { Type[] types = new Type[parameterNames.size()]; for (int i = 0; i < types.length; i++) { types[i] = String.class; } return types; }
[ "public", "Type", "[", "]", "getParameterTypes", "(", ")", "{", "Type", "[", "]", "types", "=", "new", "Type", "[", "parameterNames", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", ...
Provide parameter types for this step. @return
[ "Provide", "parameter", "types", "for", "this", "step", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/container/StepTemplate.java#L82-L89
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/channel/MessageSelectingQueueChannel.java
MessageSelectingQueueChannel.receive
public Message<?> receive(MessageSelector selector) { Object[] array = this.queue.toArray(); for (Object o : array) { Message<?> message = (Message<?>) o; if (selector.accept(message) && this.queue.remove(message)) { return message; } } return null; }
java
public Message<?> receive(MessageSelector selector) { Object[] array = this.queue.toArray(); for (Object o : array) { Message<?> message = (Message<?>) o; if (selector.accept(message) && this.queue.remove(message)) { return message; } } return null; }
[ "public", "Message", "<", "?", ">", "receive", "(", "MessageSelector", "selector", ")", "{", "Object", "[", "]", "array", "=", "this", ".", "queue", ".", "toArray", "(", ")", ";", "for", "(", "Object", "o", ":", "array", ")", "{", "Message", "<", "...
Supports selective consumption of messages on the channel. The first message to be accepted by given message selector is returned as result. @param selector @return
[ "Supports", "selective", "consumption", "of", "messages", "on", "the", "channel", ".", "The", "first", "message", "to", "be", "accepted", "by", "given", "message", "selector", "is", "returned", "as", "result", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/MessageSelectingQueueChannel.java#L77-L87
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/channel/MessageSelectingQueueChannel.java
MessageSelectingQueueChannel.receive
public Message<?> receive(MessageSelector selector, long timeout) { long timeLeft = timeout; Message<?> message = receive(selector); while (message == null && timeLeft > 0) { timeLeft -= pollingInterval; if (RETRY_LOG.isDebugEnabled()) { RETRY_LOG.debug("No message received with message selector - retrying in " + (timeLeft > 0 ? pollingInterval : pollingInterval + timeLeft) + "ms"); } try { Thread.sleep(timeLeft > 0 ? pollingInterval : pollingInterval + timeLeft); } catch (InterruptedException e) { RETRY_LOG.warn("Thread interrupted while waiting for retry", e); } message = receive(selector); } return message; }
java
public Message<?> receive(MessageSelector selector, long timeout) { long timeLeft = timeout; Message<?> message = receive(selector); while (message == null && timeLeft > 0) { timeLeft -= pollingInterval; if (RETRY_LOG.isDebugEnabled()) { RETRY_LOG.debug("No message received with message selector - retrying in " + (timeLeft > 0 ? pollingInterval : pollingInterval + timeLeft) + "ms"); } try { Thread.sleep(timeLeft > 0 ? pollingInterval : pollingInterval + timeLeft); } catch (InterruptedException e) { RETRY_LOG.warn("Thread interrupted while waiting for retry", e); } message = receive(selector); } return message; }
[ "public", "Message", "<", "?", ">", "receive", "(", "MessageSelector", "selector", ",", "long", "timeout", ")", "{", "long", "timeLeft", "=", "timeout", ";", "Message", "<", "?", ">", "message", "=", "receive", "(", "selector", ")", ";", "while", "(", ...
Consume messages on the channel via message selector. Timeout forces several retries with polling interval setting. @param selector @param timeout @return
[ "Consume", "messages", "on", "the", "channel", "via", "message", "selector", ".", "Timeout", "forces", "several", "retries", "with", "polling", "interval", "setting", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/MessageSelectingQueueChannel.java#L97-L118
train
citrusframework/citrus
modules/citrus-ws/src/main/java/com/consol/citrus/ws/client/WebServiceEndpointConfiguration.java
WebServiceEndpointConfiguration.setInterceptors
public void setInterceptors(List<ClientInterceptor> interceptors) { this.interceptors = interceptors; getWebServiceTemplate().setInterceptors(interceptors.toArray(new ClientInterceptor[interceptors.size()])); }
java
public void setInterceptors(List<ClientInterceptor> interceptors) { this.interceptors = interceptors; getWebServiceTemplate().setInterceptors(interceptors.toArray(new ClientInterceptor[interceptors.size()])); }
[ "public", "void", "setInterceptors", "(", "List", "<", "ClientInterceptor", ">", "interceptors", ")", "{", "this", ".", "interceptors", "=", "interceptors", ";", "getWebServiceTemplate", "(", ")", ".", "setInterceptors", "(", "interceptors", ".", "toArray", "(", ...
Sets the client interceptors. @param interceptors
[ "Sets", "the", "client", "interceptors", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/client/WebServiceEndpointConfiguration.java#L217-L220
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/functions/core/RandomEnumValueFunction.java
RandomEnumValueFunction.randomValue
protected String randomValue(List<String> values) { if (values == null || values.isEmpty()) { throw new InvalidFunctionUsageException("No values to choose from"); } final int idx = random.nextInt(values.size()); return values.get(idx); }
java
protected String randomValue(List<String> values) { if (values == null || values.isEmpty()) { throw new InvalidFunctionUsageException("No values to choose from"); } final int idx = random.nextInt(values.size()); return values.get(idx); }
[ "protected", "String", "randomValue", "(", "List", "<", "String", ">", "values", ")", "{", "if", "(", "values", "==", "null", "||", "values", ".", "isEmpty", "(", ")", ")", "{", "throw", "new", "InvalidFunctionUsageException", "(", "\"No values to choose from\...
Pseudo-randomly choose one of the supplied values and return it. @param values @return @throws IllegalArgumentException if the values supplied are <code>null</code> or an empty list.
[ "Pseudo", "-", "randomly", "choose", "one", "of", "the", "supplied", "values", "and", "return", "it", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/functions/core/RandomEnumValueFunction.java#L99-L107
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.navigate
public SeleniumActionBuilder navigate(String page) { NavigateAction action = new NavigateAction(); action.setPage(page); action(action); return this; }
java
public SeleniumActionBuilder navigate(String page) { NavigateAction action = new NavigateAction(); action.setPage(page); action(action); return this; }
[ "public", "SeleniumActionBuilder", "navigate", "(", "String", "page", ")", "{", "NavigateAction", "action", "=", "new", "NavigateAction", "(", ")", ";", "action", ".", "setPage", "(", "page", ")", ";", "action", "(", "action", ")", ";", "return", "this", "...
Navigate action.
[ "Navigate", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L115-L120
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.select
public ElementActionBuilder select(String option) { DropDownSelectAction action = new DropDownSelectAction(); action.setOption(option); action(action); return new ElementActionBuilder(action); }
java
public ElementActionBuilder select(String option) { DropDownSelectAction action = new DropDownSelectAction(); action.setOption(option); action(action); return new ElementActionBuilder(action); }
[ "public", "ElementActionBuilder", "select", "(", "String", "option", ")", "{", "DropDownSelectAction", "action", "=", "new", "DropDownSelectAction", "(", ")", ";", "action", ".", "setOption", "(", "option", ")", ";", "action", "(", "action", ")", ";", "return"...
Dropdown select single option action.
[ "Dropdown", "select", "single", "option", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L154-L159
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.select
public ElementActionBuilder select(String ... options) { DropDownSelectAction action = new DropDownSelectAction(); action.setOptions(Arrays.asList(options)); action(action); return new ElementActionBuilder(action); }
java
public ElementActionBuilder select(String ... options) { DropDownSelectAction action = new DropDownSelectAction(); action.setOptions(Arrays.asList(options)); action(action); return new ElementActionBuilder(action); }
[ "public", "ElementActionBuilder", "select", "(", "String", "...", "options", ")", "{", "DropDownSelectAction", "action", "=", "new", "DropDownSelectAction", "(", ")", ";", "action", ".", "setOptions", "(", "Arrays", ".", "asList", "(", "options", ")", ")", ";"...
Dropdown select multiple options action.
[ "Dropdown", "select", "multiple", "options", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L164-L169
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.setInput
public ElementActionBuilder setInput(String value) { SetInputAction action = new SetInputAction(); action.setValue(value); action(action); return new ElementActionBuilder(action); }
java
public ElementActionBuilder setInput(String value) { SetInputAction action = new SetInputAction(); action.setValue(value); action(action); return new ElementActionBuilder(action); }
[ "public", "ElementActionBuilder", "setInput", "(", "String", "value", ")", "{", "SetInputAction", "action", "=", "new", "SetInputAction", "(", ")", ";", "action", ".", "setValue", "(", "value", ")", ";", "action", "(", "action", ")", ";", "return", "new", ...
Set input action.
[ "Set", "input", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L174-L179
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.checkInput
public ElementActionBuilder checkInput(boolean checked) { CheckInputAction action = new CheckInputAction(); action.setChecked(checked); action(action); return new ElementActionBuilder(action); }
java
public ElementActionBuilder checkInput(boolean checked) { CheckInputAction action = new CheckInputAction(); action.setChecked(checked); action(action); return new ElementActionBuilder(action); }
[ "public", "ElementActionBuilder", "checkInput", "(", "boolean", "checked", ")", "{", "CheckInputAction", "action", "=", "new", "CheckInputAction", "(", ")", ";", "action", ".", "setChecked", "(", "checked", ")", ";", "action", "(", "action", ")", ";", "return"...
Check input action.
[ "Check", "input", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L184-L189
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.screenshot
public SeleniumActionBuilder screenshot(String outputDir) { MakeScreenshotAction action = new MakeScreenshotAction(); action.setOutputDir(outputDir); action(action); return this; }
java
public SeleniumActionBuilder screenshot(String outputDir) { MakeScreenshotAction action = new MakeScreenshotAction(); action.setOutputDir(outputDir); action(action); return this; }
[ "public", "SeleniumActionBuilder", "screenshot", "(", "String", "outputDir", ")", "{", "MakeScreenshotAction", "action", "=", "new", "MakeScreenshotAction", "(", ")", ";", "action", ".", "setOutputDir", "(", "outputDir", ")", ";", "action", "(", "action", ")", "...
Make screenshot with custom output directory.
[ "Make", "screenshot", "with", "custom", "output", "directory", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L228-L233
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.store
public SeleniumActionBuilder store(String filePath) { StoreFileAction action = new StoreFileAction(); action.setFilePath(filePath); action(action); return this; }
java
public SeleniumActionBuilder store(String filePath) { StoreFileAction action = new StoreFileAction(); action.setFilePath(filePath); action(action); return this; }
[ "public", "SeleniumActionBuilder", "store", "(", "String", "filePath", ")", "{", "StoreFileAction", "action", "=", "new", "StoreFileAction", "(", ")", ";", "action", ".", "setFilePath", "(", "filePath", ")", ";", "action", "(", "action", ")", ";", "return", ...
Store file. @param filePath
[ "Store", "file", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L239-L244
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.getStored
public SeleniumActionBuilder getStored(String fileName) { GetStoredFileAction action = new GetStoredFileAction(); action.setFileName(fileName); action(action); return this; }
java
public SeleniumActionBuilder getStored(String fileName) { GetStoredFileAction action = new GetStoredFileAction(); action.setFileName(fileName); action(action); return this; }
[ "public", "SeleniumActionBuilder", "getStored", "(", "String", "fileName", ")", "{", "GetStoredFileAction", "action", "=", "new", "GetStoredFileAction", "(", ")", ";", "action", ".", "setFileName", "(", "fileName", ")", ";", "action", "(", "action", ")", ";", ...
Get stored file. @param fileName
[ "Get", "stored", "file", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L250-L255
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java
SeleniumActionBuilder.action
private <T extends SeleniumAction> T action(T delegate) { if (seleniumBrowser != null) { delegate.setBrowser(seleniumBrowser); } action.setDelegate(delegate); return delegate; }
java
private <T extends SeleniumAction> T action(T delegate) { if (seleniumBrowser != null) { delegate.setBrowser(seleniumBrowser); } action.setDelegate(delegate); return delegate; }
[ "private", "<", "T", "extends", "SeleniumAction", ">", "T", "action", "(", "T", "delegate", ")", "{", "if", "(", "seleniumBrowser", "!=", "null", ")", "{", "delegate", ".", "setBrowser", "(", "seleniumBrowser", ")", ";", "}", "action", ".", "setDelegate", ...
Prepare selenium action.
[ "Prepare", "selenium", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SeleniumActionBuilder.java#L327-L334
train
citrusframework/citrus
modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/message/MessageCreators.java
MessageCreators.createMessage
public Message createMessage(final String messageName) { final Message[] message = { null }; for (final Object messageCreator : messageCreators) { ReflectionUtils.doWithMethods(messageCreator.getClass(), new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { if (method.getAnnotation(MessageCreator.class).value().equals(messageName)) { try { message[0] = (Message) method.invoke(messageCreator); } catch (InvocationTargetException e) { throw new CitrusRuntimeException("Unsupported message creator method: " + method.getName(), e); } } } }, new ReflectionUtils.MethodFilter() { @Override public boolean matches(Method method) { return method.getAnnotationsByType(MessageCreator.class).length > 0; } }); } if (message[0] == null) { throw new CitrusRuntimeException("Unable to find message creator for message: " + messageName); } return message[0]; }
java
public Message createMessage(final String messageName) { final Message[] message = { null }; for (final Object messageCreator : messageCreators) { ReflectionUtils.doWithMethods(messageCreator.getClass(), new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException { if (method.getAnnotation(MessageCreator.class).value().equals(messageName)) { try { message[0] = (Message) method.invoke(messageCreator); } catch (InvocationTargetException e) { throw new CitrusRuntimeException("Unsupported message creator method: " + method.getName(), e); } } } }, new ReflectionUtils.MethodFilter() { @Override public boolean matches(Method method) { return method.getAnnotationsByType(MessageCreator.class).length > 0; } }); } if (message[0] == null) { throw new CitrusRuntimeException("Unable to find message creator for message: " + messageName); } return message[0]; }
[ "public", "Message", "createMessage", "(", "final", "String", "messageName", ")", "{", "final", "Message", "[", "]", "message", "=", "{", "null", "}", ";", "for", "(", "final", "Object", "messageCreator", ":", "messageCreators", ")", "{", "ReflectionUtils", ...
Create message by delegating message creation to known message creators that are able to create message with given name. @param messageName @return
[ "Create", "message", "by", "delegating", "message", "creation", "to", "known", "message", "creators", "that", "are", "able", "to", "create", "message", "with", "given", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/message/MessageCreators.java#L43-L70
train
citrusframework/citrus
modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/message/MessageCreators.java
MessageCreators.addType
public void addType(String type) { try { messageCreators.add(Class.forName(type).newInstance()); } catch (ClassNotFoundException | IllegalAccessException e) { throw new CitrusRuntimeException("Unable to access message creator type: " + type, e); } catch (InstantiationException e) { throw new CitrusRuntimeException("Unable to create message creator instance of type: " + type, e); } }
java
public void addType(String type) { try { messageCreators.add(Class.forName(type).newInstance()); } catch (ClassNotFoundException | IllegalAccessException e) { throw new CitrusRuntimeException("Unable to access message creator type: " + type, e); } catch (InstantiationException e) { throw new CitrusRuntimeException("Unable to create message creator instance of type: " + type, e); } }
[ "public", "void", "addType", "(", "String", "type", ")", "{", "try", "{", "messageCreators", ".", "add", "(", "Class", ".", "forName", "(", "type", ")", ".", "newInstance", "(", ")", ")", ";", "}", "catch", "(", "ClassNotFoundException", "|", "IllegalAcc...
Adds new message creator POJO instance from type. @param type
[ "Adds", "new", "message", "creator", "POJO", "instance", "from", "type", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-cucumber/src/main/java/com/consol/citrus/cucumber/message/MessageCreators.java#L76-L84
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/actions/InputAction.java
InputAction.checkAnswer
private boolean checkAnswer(String input) { StringTokenizer tok = new StringTokenizer(validAnswers, ANSWER_SEPARATOR); while (tok.hasMoreTokens()) { if (tok.nextElement().toString().trim().equalsIgnoreCase(input.trim())) { return true; } } log.info("User input is not valid - must be one of " + validAnswers); return false; }
java
private boolean checkAnswer(String input) { StringTokenizer tok = new StringTokenizer(validAnswers, ANSWER_SEPARATOR); while (tok.hasMoreTokens()) { if (tok.nextElement().toString().trim().equalsIgnoreCase(input.trim())) { return true; } } log.info("User input is not valid - must be one of " + validAnswers); return false; }
[ "private", "boolean", "checkAnswer", "(", "String", "input", ")", "{", "StringTokenizer", "tok", "=", "new", "StringTokenizer", "(", "validAnswers", ",", "ANSWER_SEPARATOR", ")", ";", "while", "(", "tok", ".", "hasMoreTokens", "(", ")", ")", "{", "if", "(", ...
Validate given input according to valid answer tokens. @param input @return
[ "Validate", "given", "input", "according", "to", "valid", "answer", "tokens", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/InputAction.java#L108-L120
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.message
public T message(Message controlMessage) { StaticMessageContentBuilder staticMessageContentBuilder = StaticMessageContentBuilder.withMessage(controlMessage); staticMessageContentBuilder.setMessageHeaders(getMessageContentBuilder().getMessageHeaders()); getAction().setMessageBuilder(staticMessageContentBuilder); return self; }
java
public T message(Message controlMessage) { StaticMessageContentBuilder staticMessageContentBuilder = StaticMessageContentBuilder.withMessage(controlMessage); staticMessageContentBuilder.setMessageHeaders(getMessageContentBuilder().getMessageHeaders()); getAction().setMessageBuilder(staticMessageContentBuilder); return self; }
[ "public", "T", "message", "(", "Message", "controlMessage", ")", "{", "StaticMessageContentBuilder", "staticMessageContentBuilder", "=", "StaticMessageContentBuilder", ".", "withMessage", "(", "controlMessage", ")", ";", "staticMessageContentBuilder", ".", "setMessageHeaders"...
Expect a control message in this receive action. @param controlMessage @return
[ "Expect", "a", "control", "message", "in", "this", "receive", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L147-L152
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.setPayload
protected void setPayload(String payload) { MessageContentBuilder messageContentBuilder = getMessageContentBuilder(); if (messageContentBuilder instanceof PayloadTemplateMessageBuilder) { ((PayloadTemplateMessageBuilder) messageContentBuilder).setPayloadData(payload); } else if (messageContentBuilder instanceof StaticMessageContentBuilder) { ((StaticMessageContentBuilder) messageContentBuilder).getMessage().setPayload(payload); } else { throw new CitrusRuntimeException("Unable to set payload on message builder type: " + messageContentBuilder.getClass()); } }
java
protected void setPayload(String payload) { MessageContentBuilder messageContentBuilder = getMessageContentBuilder(); if (messageContentBuilder instanceof PayloadTemplateMessageBuilder) { ((PayloadTemplateMessageBuilder) messageContentBuilder).setPayloadData(payload); } else if (messageContentBuilder instanceof StaticMessageContentBuilder) { ((StaticMessageContentBuilder) messageContentBuilder).getMessage().setPayload(payload); } else { throw new CitrusRuntimeException("Unable to set payload on message builder type: " + messageContentBuilder.getClass()); } }
[ "protected", "void", "setPayload", "(", "String", "payload", ")", "{", "MessageContentBuilder", "messageContentBuilder", "=", "getMessageContentBuilder", "(", ")", ";", "if", "(", "messageContentBuilder", "instanceof", "PayloadTemplateMessageBuilder", ")", "{", "(", "("...
Sets the payload data on the message builder implementation. @param payload @return
[ "Sets", "the", "payload", "data", "on", "the", "message", "builder", "implementation", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L159-L169
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.payload
public T payload(Resource payloadResource, Charset charset) { try { setPayload(FileUtils.readToString(payloadResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read payload resource", e); } return self; }
java
public T payload(Resource payloadResource, Charset charset) { try { setPayload(FileUtils.readToString(payloadResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read payload resource", e); } return self; }
[ "public", "T", "payload", "(", "Resource", "payloadResource", ",", "Charset", "charset", ")", "{", "try", "{", "setPayload", "(", "FileUtils", ".", "readToString", "(", "payloadResource", ",", "charset", ")", ")", ";", "}", "catch", "(", "IOException", "e", ...
Expect this message payload data in received message. @param payloadResource @param charset @return
[ "Expect", "this", "message", "payload", "data", "in", "received", "message", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L206-L214
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.payload
public T payload(Object payload, Marshaller marshaller) { 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); } setPayload(result.toString()); return self; }
java
public T payload(Object payload, Marshaller marshaller) { 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); } setPayload(result.toString()); return self; }
[ "public", "T", "payload", "(", "Object", "payload", ",", "Marshaller", "marshaller", ")", "{", "StringResult", "result", "=", "new", "StringResult", "(", ")", ";", "try", "{", "marshaller", ".", "marshal", "(", "payload", ",", "result", ")", ";", "}", "c...
Expect this message payload as model object which is marshalled to a character sequence using the default object to xml mapper before validation is performed. @param payload @param marshaller @return
[ "Expect", "this", "message", "payload", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "xml", "mapper", "before", "validation", "is", "performed", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L223-L237
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.payload
public T payload(Object payload, ObjectMapper objectMapper) { try { setPayload(objectMapper.writer().writeValueAsString(payload)); } catch (JsonProcessingException e) { throw new CitrusRuntimeException("Failed to map object graph for message payload", e); } return self; }
java
public T payload(Object payload, ObjectMapper objectMapper) { try { setPayload(objectMapper.writer().writeValueAsString(payload)); } catch (JsonProcessingException e) { throw new CitrusRuntimeException("Failed to map object graph for message payload", e); } return self; }
[ "public", "T", "payload", "(", "Object", "payload", ",", "ObjectMapper", "objectMapper", ")", "{", "try", "{", "setPayload", "(", "objectMapper", ".", "writer", "(", ")", ".", "writeValueAsString", "(", "payload", ")", ")", ";", "}", "catch", "(", "JsonPro...
Expect this message payload as model object which is mapped to a character sequence using the default object to json mapper before validation is performed. @param payload @param objectMapper @return
[ "Expect", "this", "message", "payload", "as", "model", "object", "which", "is", "mapped", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "json", "mapper", "before", "validation", "is", "performed", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L246-L254
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.payloadModel
public T payloadModel(Object payload) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) { return payload(payload, applicationContext.getBean(Marshaller.class)); } else if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(ObjectMapper.class))) { return payload(payload, applicationContext.getBean(ObjectMapper.class)); } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
java
public T payloadModel(Object payload) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) { return payload(payload, applicationContext.getBean(Marshaller.class)); } else if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(ObjectMapper.class))) { return payload(payload, applicationContext.getBean(ObjectMapper.class)); } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
[ "public", "T", "payloadModel", "(", "Object", "payload", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "if", "(", "!", "CollectionUtils", ".", "isEmpty", "(", "applicationContext", ...
Expect this message payload as model object which is marshalled to a character sequence using the default object to xml mapper that is available in Spring bean application context. @param payload @return
[ "Expect", "this", "message", "payload", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "xml", "mapper", "that", "is", "available", "in", "Spring", "bean", "application", "con...
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L263-L273
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.header
public T header(String name, Object value) { getMessageContentBuilder().getMessageHeaders().put(name, value); return self; }
java
public T header(String name, Object value) { getMessageContentBuilder().getMessageHeaders().put(name, value); return self; }
[ "public", "T", "header", "(", "String", "name", ",", "Object", "value", ")", "{", "getMessageContentBuilder", "(", ")", ".", "getMessageHeaders", "(", ")", ".", "put", "(", "name", ",", "value", ")", ";", "return", "self", ";", "}" ]
Expect this message header entry in received message. @param name @param value @return
[ "Expect", "this", "message", "header", "entry", "in", "received", "message", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L307-L310
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headers
public T headers(Map<String, Object> headers) { getMessageContentBuilder().getMessageHeaders().putAll(headers); return self; }
java
public T headers(Map<String, Object> headers) { getMessageContentBuilder().getMessageHeaders().putAll(headers); return self; }
[ "public", "T", "headers", "(", "Map", "<", "String", ",", "Object", ">", "headers", ")", "{", "getMessageContentBuilder", "(", ")", ".", "getMessageHeaders", "(", ")", ".", "putAll", "(", "headers", ")", ";", "return", "self", ";", "}" ]
Expect this message header entries in received message. @param headers @return
[ "Expect", "this", "message", "header", "entries", "in", "received", "message", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L317-L320
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerFragment
public T headerFragment(Object model) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) { return headerFragment(model, applicationContext.getBean(Marshaller.class)); } else if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(ObjectMapper.class))) { return headerFragment(model, applicationContext.getBean(ObjectMapper.class)); } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
java
public T headerFragment(Object model) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(Marshaller.class))) { return headerFragment(model, applicationContext.getBean(Marshaller.class)); } else if (!CollectionUtils.isEmpty(applicationContext.getBeansOfType(ObjectMapper.class))) { return headerFragment(model, applicationContext.getBean(ObjectMapper.class)); } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
[ "public", "T", "headerFragment", "(", "Object", "model", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "if", "(", "!", "CollectionUtils", ".", "isEmpty", "(", "applicationContext", ...
Expect this message header data as model object which is marshalled to a character sequence using the default object to xml mapper that is available in Spring bean application context. @param model @return
[ "Expect", "this", "message", "header", "data", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "xml", "mapper", "that", "is", "available", "in", "Spring", "bean", "application...
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L340-L350
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerFragment
public T headerFragment(Object model, String mapperName) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (applicationContext.containsBean(mapperName)) { Object mapper = applicationContext.getBean(mapperName); if (Marshaller.class.isAssignableFrom(mapper.getClass())) { return headerFragment(model, (Marshaller) mapper); } else if (ObjectMapper.class.isAssignableFrom(mapper.getClass())) { return headerFragment(model, (ObjectMapper) mapper); } else { throw new CitrusRuntimeException(String.format("Invalid bean type for mapper '%s' expected ObjectMapper or Marshaller but was '%s'", mapperName, mapper.getClass())); } } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
java
public T headerFragment(Object model, String mapperName) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); if (applicationContext.containsBean(mapperName)) { Object mapper = applicationContext.getBean(mapperName); if (Marshaller.class.isAssignableFrom(mapper.getClass())) { return headerFragment(model, (Marshaller) mapper); } else if (ObjectMapper.class.isAssignableFrom(mapper.getClass())) { return headerFragment(model, (ObjectMapper) mapper); } else { throw new CitrusRuntimeException(String.format("Invalid bean type for mapper '%s' expected ObjectMapper or Marshaller but was '%s'", mapperName, mapper.getClass())); } } throw new CitrusRuntimeException("Unable to find default object mapper or marshaller in application context"); }
[ "public", "T", "headerFragment", "(", "Object", "model", ",", "String", "mapperName", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "if", "(", "applicationContext", ".", "containsBea...
Expect this message header data as model object which is marshalled to a character sequence using the given object to xml mapper that is accessed by its bean name in Spring bean application context. @param model @param mapperName @return
[ "Expect", "this", "message", "header", "data", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "given", "object", "to", "xml", "mapper", "that", "is", "accessed", "by", "its", "bean", "name", "in", ...
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L360-L376
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerFragment
public T headerFragment(Object model, Marshaller marshaller) { StringResult result = new StringResult(); try { marshaller.marshal(model, result); } catch (XmlMappingException e) { throw new CitrusRuntimeException("Failed to marshal object graph for message header data", e); } catch (IOException e) { throw new CitrusRuntimeException("Failed to marshal object graph for message header data", e); } return header(result.toString()); }
java
public T headerFragment(Object model, Marshaller marshaller) { StringResult result = new StringResult(); try { marshaller.marshal(model, result); } catch (XmlMappingException e) { throw new CitrusRuntimeException("Failed to marshal object graph for message header data", e); } catch (IOException e) { throw new CitrusRuntimeException("Failed to marshal object graph for message header data", e); } return header(result.toString()); }
[ "public", "T", "headerFragment", "(", "Object", "model", ",", "Marshaller", "marshaller", ")", "{", "StringResult", "result", "=", "new", "StringResult", "(", ")", ";", "try", "{", "marshaller", ".", "marshal", "(", "model", ",", "result", ")", ";", "}", ...
Expect this message header data as model object which is marshalled to a character sequence using the default object to xml mapper before validation is performed. @param model @param marshaller @return
[ "Expect", "this", "message", "header", "data", "as", "model", "object", "which", "is", "marshalled", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "xml", "mapper", "before", "validation", "is", "performed", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L385-L397
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerFragment
public T headerFragment(Object model, ObjectMapper objectMapper) { try { return header(objectMapper.writer().writeValueAsString(model)); } catch (JsonProcessingException e) { throw new CitrusRuntimeException("Failed to map object graph for message header data", e); } }
java
public T headerFragment(Object model, ObjectMapper objectMapper) { try { return header(objectMapper.writer().writeValueAsString(model)); } catch (JsonProcessingException e) { throw new CitrusRuntimeException("Failed to map object graph for message header data", e); } }
[ "public", "T", "headerFragment", "(", "Object", "model", ",", "ObjectMapper", "objectMapper", ")", "{", "try", "{", "return", "header", "(", "objectMapper", ".", "writer", "(", ")", ".", "writeValueAsString", "(", "model", ")", ")", ";", "}", "catch", "(",...
Expect this message header data as model object which is mapped to a character sequence using the default object to json mapper before validation is performed. @param model @param objectMapper @return
[ "Expect", "this", "message", "header", "data", "as", "model", "object", "which", "is", "mapped", "to", "a", "character", "sequence", "using", "the", "default", "object", "to", "json", "mapper", "before", "validation", "is", "performed", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L406-L412
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.header
public T header(Resource resource, Charset charset) { try { getMessageContentBuilder().getHeaderData().add(FileUtils.readToString(resource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read header resource", e); } return self; }
java
public T header(Resource resource, Charset charset) { try { getMessageContentBuilder().getHeaderData().add(FileUtils.readToString(resource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read header resource", e); } return self; }
[ "public", "T", "header", "(", "Resource", "resource", ",", "Charset", "charset", ")", "{", "try", "{", "getMessageContentBuilder", "(", ")", ".", "getHeaderData", "(", ")", ".", "add", "(", "FileUtils", ".", "readToString", "(", "resource", ",", "charset", ...
Expect this message header data in received message from file resource. Message header data is used in SOAP messages as XML fragment for instance. @param resource @param charset @return
[ "Expect", "this", "message", "header", "data", "in", "received", "message", "from", "file", "resource", ".", "Message", "header", "data", "is", "used", "in", "SOAP", "messages", "as", "XML", "fragment", "for", "instance", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L431-L439
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validateScript
public T validateScript(Resource scriptResource, Charset charset) { try { validateScript(FileUtils.readToString(scriptResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script resource file", e); } return self; }
java
public T validateScript(Resource scriptResource, Charset charset) { try { validateScript(FileUtils.readToString(scriptResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read script resource file", e); } return self; }
[ "public", "T", "validateScript", "(", "Resource", "scriptResource", ",", "Charset", "charset", ")", "{", "try", "{", "validateScript", "(", "FileUtils", ".", "readToString", "(", "scriptResource", ",", "charset", ")", ")", ";", "}", "catch", "(", "IOException"...
Reads validation script file resource and sets content as validation script. @param scriptResource @param charset @return
[ "Reads", "validation", "script", "file", "resource", "and", "sets", "content", "as", "validation", "script", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L477-L485
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.messageType
public T messageType(String messageType) { this.messageType = messageType; getAction().setMessageType(messageType); if (getAction().getValidationContexts().isEmpty()) { getAction().getValidationContexts().add(headerValidationContext); getAction().getValidationContexts().add(xmlMessageValidationContext); getAction().getValidationContexts().add(jsonMessageValidationContext); } return self; }
java
public T messageType(String messageType) { this.messageType = messageType; getAction().setMessageType(messageType); if (getAction().getValidationContexts().isEmpty()) { getAction().getValidationContexts().add(headerValidationContext); getAction().getValidationContexts().add(xmlMessageValidationContext); getAction().getValidationContexts().add(jsonMessageValidationContext); } return self; }
[ "public", "T", "messageType", "(", "String", "messageType", ")", "{", "this", ".", "messageType", "=", "messageType", ";", "getAction", "(", ")", ".", "setMessageType", "(", "messageType", ")", ";", "if", "(", "getAction", "(", ")", ".", "getValidationContex...
Sets a explicit message type for this receive action. @param messageType @return
[ "Sets", "a", "explicit", "message", "type", "for", "this", "receive", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L523-L534
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validateNamespace
public T validateNamespace(String prefix, String namespaceUri) { xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri); return self; }
java
public T validateNamespace(String prefix, String namespaceUri) { xmlMessageValidationContext.getControlNamespaces().put(prefix, namespaceUri); return self; }
[ "public", "T", "validateNamespace", "(", "String", "prefix", ",", "String", "namespaceUri", ")", "{", "xmlMessageValidationContext", ".", "getControlNamespaces", "(", ")", ".", "put", "(", "prefix", ",", "namespaceUri", ")", ";", "return", "self", ";", "}" ]
Validates XML namespace with prefix and uri. @param prefix @param namespaceUri @return
[ "Validates", "XML", "namespace", "with", "prefix", "and", "uri", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L553-L556
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validate
public T validate(String path, Object controlValue) { if (JsonPathMessageValidationContext.isJsonPathExpression(path)) { getJsonPathValidationContext().getJsonPathExpressions().put(path, controlValue); } else { getXPathValidationContext().getXpathExpressions().put(path, controlValue); } return self; }
java
public T validate(String path, Object controlValue) { if (JsonPathMessageValidationContext.isJsonPathExpression(path)) { getJsonPathValidationContext().getJsonPathExpressions().put(path, controlValue); } else { getXPathValidationContext().getXpathExpressions().put(path, controlValue); } return self; }
[ "public", "T", "validate", "(", "String", "path", ",", "Object", "controlValue", ")", "{", "if", "(", "JsonPathMessageValidationContext", ".", "isJsonPathExpression", "(", "path", ")", ")", "{", "getJsonPathValidationContext", "(", ")", ".", "getJsonPathExpressions"...
Adds message element validation. @param path @param controlValue @return
[ "Adds", "message", "element", "validation", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L564-L572
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.ignore
public T ignore(String path) { if (messageType.equalsIgnoreCase(MessageType.XML.name()) || messageType.equalsIgnoreCase(MessageType.XHTML.name())) { xmlMessageValidationContext.getIgnoreExpressions().add(path); } else if (messageType.equalsIgnoreCase(MessageType.JSON.name())) { jsonMessageValidationContext.getIgnoreExpressions().add(path); } return self; }
java
public T ignore(String path) { if (messageType.equalsIgnoreCase(MessageType.XML.name()) || messageType.equalsIgnoreCase(MessageType.XHTML.name())) { xmlMessageValidationContext.getIgnoreExpressions().add(path); } else if (messageType.equalsIgnoreCase(MessageType.JSON.name())) { jsonMessageValidationContext.getIgnoreExpressions().add(path); } return self; }
[ "public", "T", "ignore", "(", "String", "path", ")", "{", "if", "(", "messageType", ".", "equalsIgnoreCase", "(", "MessageType", ".", "XML", ".", "name", "(", ")", ")", "||", "messageType", ".", "equalsIgnoreCase", "(", "MessageType", ".", "XHTML", ".", ...
Adds ignore path expression for message element. @param path @return
[ "Adds", "ignore", "path", "expression", "for", "message", "element", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L579-L587
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.xpath
public T xpath(String xPathExpression, Object controlValue) { validate(xPathExpression, controlValue); return self; }
java
public T xpath(String xPathExpression, Object controlValue) { validate(xPathExpression, controlValue); return self; }
[ "public", "T", "xpath", "(", "String", "xPathExpression", ",", "Object", "controlValue", ")", "{", "validate", "(", "xPathExpression", ",", "controlValue", ")", ";", "return", "self", ";", "}" ]
Adds XPath message element validation. @param xPathExpression @param controlValue @return
[ "Adds", "XPath", "message", "element", "validation", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L595-L598
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.jsonPath
public T jsonPath(String jsonPathExpression, Object controlValue) { validate(jsonPathExpression, controlValue); return self; }
java
public T jsonPath(String jsonPathExpression, Object controlValue) { validate(jsonPathExpression, controlValue); return self; }
[ "public", "T", "jsonPath", "(", "String", "jsonPathExpression", ",", "Object", "controlValue", ")", "{", "validate", "(", "jsonPathExpression", ",", "controlValue", ")", ";", "return", "self", ";", "}" ]
Adds JsonPath message element validation. @param jsonPathExpression @param controlValue @return
[ "Adds", "JsonPath", "message", "element", "validation", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L606-L609
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.namespace
public T namespace(String prefix, String namespaceUri) { getXpathVariableExtractor().getNamespaces().put(prefix, namespaceUri); xmlMessageValidationContext.getNamespaces().put(prefix, namespaceUri); return self; }
java
public T namespace(String prefix, String namespaceUri) { getXpathVariableExtractor().getNamespaces().put(prefix, namespaceUri); xmlMessageValidationContext.getNamespaces().put(prefix, namespaceUri); return self; }
[ "public", "T", "namespace", "(", "String", "prefix", ",", "String", "namespaceUri", ")", "{", "getXpathVariableExtractor", "(", ")", ".", "getNamespaces", "(", ")", ".", "put", "(", "prefix", ",", "namespaceUri", ")", ";", "xmlMessageValidationContext", ".", "...
Adds explicit namespace declaration for later path validation expressions. @param prefix @param namespaceUri @return
[ "Adds", "explicit", "namespace", "declaration", "for", "later", "path", "validation", "expressions", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L656-L660
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.namespaces
public T namespaces(Map<String, String> namespaceMappings) { getXpathVariableExtractor().getNamespaces().putAll(namespaceMappings); xmlMessageValidationContext.getNamespaces().putAll(namespaceMappings); return self; }
java
public T namespaces(Map<String, String> namespaceMappings) { getXpathVariableExtractor().getNamespaces().putAll(namespaceMappings); xmlMessageValidationContext.getNamespaces().putAll(namespaceMappings); return self; }
[ "public", "T", "namespaces", "(", "Map", "<", "String", ",", "String", ">", "namespaceMappings", ")", "{", "getXpathVariableExtractor", "(", ")", ".", "getNamespaces", "(", ")", ".", "putAll", "(", "namespaceMappings", ")", ";", "xmlMessageValidationContext", "....
Sets default namespace declarations on this action builder. @param namespaceMappings @return
[ "Sets", "default", "namespace", "declarations", "on", "this", "action", "builder", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L667-L672
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.selector
public T selector(Map<String, Object> messageSelector) { getAction().setMessageSelectorMap(messageSelector); return self; }
java
public T selector(Map<String, Object> messageSelector) { getAction().setMessageSelectorMap(messageSelector); return self; }
[ "public", "T", "selector", "(", "Map", "<", "String", ",", "Object", ">", "messageSelector", ")", "{", "getAction", "(", ")", ".", "setMessageSelectorMap", "(", "messageSelector", ")", ";", "return", "self", ";", "}" ]
Sets message selector elements. @param messageSelector @return
[ "Sets", "message", "selector", "elements", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L690-L694
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validator
public T validator(MessageValidator<? extends ValidationContext> ... validators) { Stream.of(validators).forEach(getAction()::addValidator); return self; }
java
public T validator(MessageValidator<? extends ValidationContext> ... validators) { Stream.of(validators).forEach(getAction()::addValidator); return self; }
[ "public", "T", "validator", "(", "MessageValidator", "<", "?", "extends", "ValidationContext", ">", "...", "validators", ")", "{", "Stream", ".", "of", "(", "validators", ")", ".", "forEach", "(", "getAction", "(", ")", "::", "addValidator", ")", ";", "ret...
Sets explicit message validators for this receive action. @param validators @return
[ "Sets", "explicit", "message", "validators", "for", "this", "receive", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L701-L704
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validator
@SuppressWarnings("unchecked") public T validator(String ... validatorNames) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); for (String validatorName : validatorNames) { getAction().addValidator(applicationContext.getBean(validatorName, MessageValidator.class)); } return self; }
java
@SuppressWarnings("unchecked") public T validator(String ... validatorNames) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); for (String validatorName : validatorNames) { getAction().addValidator(applicationContext.getBean(validatorName, MessageValidator.class)); } return self; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "validator", "(", "String", "...", "validatorNames", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "for", "(", "S...
Sets explicit message validators by name. @param validatorNames @return
[ "Sets", "explicit", "message", "validators", "by", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L711-L720
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerValidator
public T headerValidator(HeaderValidator... validators) { Stream.of(validators).forEach(headerValidationContext::addHeaderValidator); return self; }
java
public T headerValidator(HeaderValidator... validators) { Stream.of(validators).forEach(headerValidationContext::addHeaderValidator); return self; }
[ "public", "T", "headerValidator", "(", "HeaderValidator", "...", "validators", ")", "{", "Stream", ".", "of", "(", "validators", ")", ".", "forEach", "(", "headerValidationContext", "::", "addHeaderValidator", ")", ";", "return", "self", ";", "}" ]
Sets explicit header validator for this receive action. @param validators @return
[ "Sets", "explicit", "header", "validator", "for", "this", "receive", "action", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L727-L730
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.headerValidator
@SuppressWarnings("unchecked") public T headerValidator(String ... validatorNames) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); for (String validatorName : validatorNames) { headerValidationContext.addHeaderValidator(applicationContext.getBean(validatorName, HeaderValidator.class)); } return self; }
java
@SuppressWarnings("unchecked") public T headerValidator(String ... validatorNames) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); for (String validatorName : validatorNames) { headerValidationContext.addHeaderValidator(applicationContext.getBean(validatorName, HeaderValidator.class)); } return self; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "headerValidator", "(", "String", "...", "validatorNames", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "for", "("...
Sets explicit header validators by name. @param validatorNames @return
[ "Sets", "explicit", "header", "validators", "by", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L737-L746
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.dictionary
@SuppressWarnings("unchecked") public T dictionary(String dictionaryName) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); DataDictionary dictionary = applicationContext.getBean(dictionaryName, DataDictionary.class); getAction().setDataDictionary(dictionary); return self; }
java
@SuppressWarnings("unchecked") public T dictionary(String dictionaryName) { Assert.notNull(applicationContext, "Citrus application context is not initialized!"); DataDictionary dictionary = applicationContext.getBean(dictionaryName, DataDictionary.class); getAction().setDataDictionary(dictionary); return self; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "dictionary", "(", "String", "dictionaryName", ")", "{", "Assert", ".", "notNull", "(", "applicationContext", ",", "\"Citrus application context is not initialized!\"", ")", ";", "DataDictionary", "dicti...
Sets explicit data dictionary by name. @param dictionaryName @return
[ "Sets", "explicit", "data", "dictionary", "by", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L763-L770
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.extractFromHeader
public T extractFromHeader(String headerName, String variable) { if (headerExtractor == null) { headerExtractor = new MessageHeaderVariableExtractor(); getAction().getVariableExtractors().add(headerExtractor); } headerExtractor.getHeaderMappings().put(headerName, variable); return self; }
java
public T extractFromHeader(String headerName, String variable) { if (headerExtractor == null) { headerExtractor = new MessageHeaderVariableExtractor(); getAction().getVariableExtractors().add(headerExtractor); } headerExtractor.getHeaderMappings().put(headerName, variable); return self; }
[ "public", "T", "extractFromHeader", "(", "String", "headerName", ",", "String", "variable", ")", "{", "if", "(", "headerExtractor", "==", "null", ")", "{", "headerExtractor", "=", "new", "MessageHeaderVariableExtractor", "(", ")", ";", "getAction", "(", ")", "...
Extract message header entry as variable. @param headerName @param variable @return
[ "Extract", "message", "header", "entry", "as", "variable", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L778-L787
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.extractFromPayload
public T extractFromPayload(String path, String variable) { if (JsonPathMessageValidationContext.isJsonPathExpression(path)) { getJsonPathVariableExtractor().getJsonPathExpressions().put(path, variable); } else { getXpathVariableExtractor().getXpathExpressions().put(path, variable); } return self; }
java
public T extractFromPayload(String path, String variable) { if (JsonPathMessageValidationContext.isJsonPathExpression(path)) { getJsonPathVariableExtractor().getJsonPathExpressions().put(path, variable); } else { getXpathVariableExtractor().getXpathExpressions().put(path, variable); } return self; }
[ "public", "T", "extractFromPayload", "(", "String", "path", ",", "String", "variable", ")", "{", "if", "(", "JsonPathMessageValidationContext", ".", "isJsonPathExpression", "(", "path", ")", ")", "{", "getJsonPathVariableExtractor", "(", ")", ".", "getJsonPathExpres...
Extract message element via XPath or JSONPath from message payload as new test variable. @param path @param variable @return
[ "Extract", "message", "element", "via", "XPath", "or", "JSONPath", "from", "message", "payload", "as", "new", "test", "variable", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L795-L802
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.validationCallback
public T validationCallback(ValidationCallback callback) { if (callback instanceof ApplicationContextAware) { ((ApplicationContextAware) callback).setApplicationContext(applicationContext); } getAction().setValidationCallback(callback); return self; }
java
public T validationCallback(ValidationCallback callback) { if (callback instanceof ApplicationContextAware) { ((ApplicationContextAware) callback).setApplicationContext(applicationContext); } getAction().setValidationCallback(callback); return self; }
[ "public", "T", "validationCallback", "(", "ValidationCallback", "callback", ")", "{", "if", "(", "callback", "instanceof", "ApplicationContextAware", ")", "{", "(", "(", "ApplicationContextAware", ")", "callback", ")", ".", "setApplicationContext", "(", "applicationCo...
Adds validation callback to the receive action for validating the received message with Java code. @param callback @return
[ "Adds", "validation", "callback", "to", "the", "receive", "action", "for", "validating", "the", "received", "message", "with", "Java", "code", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L810-L817
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.getMessageContentBuilder
protected AbstractMessageContentBuilder getMessageContentBuilder() { if (getAction().getMessageBuilder() != null && getAction().getMessageBuilder() instanceof AbstractMessageContentBuilder) { return (AbstractMessageContentBuilder) getAction().getMessageBuilder(); } else { PayloadTemplateMessageBuilder messageBuilder = new PayloadTemplateMessageBuilder(); getAction().setMessageBuilder(messageBuilder); return messageBuilder; } }
java
protected AbstractMessageContentBuilder getMessageContentBuilder() { if (getAction().getMessageBuilder() != null && getAction().getMessageBuilder() instanceof AbstractMessageContentBuilder) { return (AbstractMessageContentBuilder) getAction().getMessageBuilder(); } else { PayloadTemplateMessageBuilder messageBuilder = new PayloadTemplateMessageBuilder(); getAction().setMessageBuilder(messageBuilder); return messageBuilder; } }
[ "protected", "AbstractMessageContentBuilder", "getMessageContentBuilder", "(", ")", "{", "if", "(", "getAction", "(", ")", ".", "getMessageBuilder", "(", ")", "!=", "null", "&&", "getAction", "(", ")", ".", "getMessageBuilder", "(", ")", "instanceof", "AbstractMes...
Get message builder, if already registered or create a new message builder and register it @return the message builder in use
[ "Get", "message", "builder", "if", "already", "registered", "or", "create", "a", "new", "message", "builder", "and", "register", "it" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L833-L841
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.getXPathValidationContext
private XpathMessageValidationContext getXPathValidationContext() { if (xmlMessageValidationContext instanceof XpathMessageValidationContext) { return ((XpathMessageValidationContext)xmlMessageValidationContext); } else { XpathMessageValidationContext xPathContext = new XpathMessageValidationContext(); xPathContext.setNamespaces(xmlMessageValidationContext.getNamespaces()); xPathContext.setControlNamespaces(xmlMessageValidationContext.getControlNamespaces()); xPathContext.setIgnoreExpressions(xmlMessageValidationContext.getIgnoreExpressions()); xPathContext.setSchema(xmlMessageValidationContext.getSchema()); xPathContext.setSchemaRepository(xmlMessageValidationContext.getSchemaRepository()); xPathContext.setSchemaValidation(xmlMessageValidationContext.isSchemaValidationEnabled()); xPathContext.setDTDResource(xmlMessageValidationContext.getDTDResource()); getAction().getValidationContexts().remove(xmlMessageValidationContext); getAction().getValidationContexts().add(xPathContext); xmlMessageValidationContext = xPathContext; return xPathContext; } }
java
private XpathMessageValidationContext getXPathValidationContext() { if (xmlMessageValidationContext instanceof XpathMessageValidationContext) { return ((XpathMessageValidationContext)xmlMessageValidationContext); } else { XpathMessageValidationContext xPathContext = new XpathMessageValidationContext(); xPathContext.setNamespaces(xmlMessageValidationContext.getNamespaces()); xPathContext.setControlNamespaces(xmlMessageValidationContext.getControlNamespaces()); xPathContext.setIgnoreExpressions(xmlMessageValidationContext.getIgnoreExpressions()); xPathContext.setSchema(xmlMessageValidationContext.getSchema()); xPathContext.setSchemaRepository(xmlMessageValidationContext.getSchemaRepository()); xPathContext.setSchemaValidation(xmlMessageValidationContext.isSchemaValidationEnabled()); xPathContext.setDTDResource(xmlMessageValidationContext.getDTDResource()); getAction().getValidationContexts().remove(xmlMessageValidationContext); getAction().getValidationContexts().add(xPathContext); xmlMessageValidationContext = xPathContext; return xPathContext; } }
[ "private", "XpathMessageValidationContext", "getXPathValidationContext", "(", ")", "{", "if", "(", "xmlMessageValidationContext", "instanceof", "XpathMessageValidationContext", ")", "{", "return", "(", "(", "XpathMessageValidationContext", ")", "xmlMessageValidationContext", ")...
Gets the validation context as XML validation context an raises exception if existing validation context is not a XML validation context. @return
[ "Gets", "the", "validation", "context", "as", "XML", "validation", "context", "an", "raises", "exception", "if", "existing", "validation", "context", "is", "not", "a", "XML", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L874-L893
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.getScriptValidationContext
private ScriptValidationContext getScriptValidationContext() { if (scriptValidationContext == null) { scriptValidationContext = new ScriptValidationContext(messageType.toString()); getAction().getValidationContexts().add(scriptValidationContext); } return scriptValidationContext; }
java
private ScriptValidationContext getScriptValidationContext() { if (scriptValidationContext == null) { scriptValidationContext = new ScriptValidationContext(messageType.toString()); getAction().getValidationContexts().add(scriptValidationContext); } return scriptValidationContext; }
[ "private", "ScriptValidationContext", "getScriptValidationContext", "(", ")", "{", "if", "(", "scriptValidationContext", "==", "null", ")", "{", "scriptValidationContext", "=", "new", "ScriptValidationContext", "(", "messageType", ".", "toString", "(", ")", ")", ";", ...
Creates new script validation context if not done before and gets the script validation context.
[ "Creates", "new", "script", "validation", "context", "if", "not", "done", "before", "and", "gets", "the", "script", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L898-L906
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java
ReceiveMessageBuilder.getJsonPathValidationContext
private JsonPathMessageValidationContext getJsonPathValidationContext() { if (jsonPathValidationContext == null) { jsonPathValidationContext = new JsonPathMessageValidationContext(); getAction().getValidationContexts().add(jsonPathValidationContext); } return jsonPathValidationContext; }
java
private JsonPathMessageValidationContext getJsonPathValidationContext() { if (jsonPathValidationContext == null) { jsonPathValidationContext = new JsonPathMessageValidationContext(); getAction().getValidationContexts().add(jsonPathValidationContext); } return jsonPathValidationContext; }
[ "private", "JsonPathMessageValidationContext", "getJsonPathValidationContext", "(", ")", "{", "if", "(", "jsonPathValidationContext", "==", "null", ")", "{", "jsonPathValidationContext", "=", "new", "JsonPathMessageValidationContext", "(", ")", ";", "getAction", "(", ")",...
Creates new JSONPath validation context if not done before and gets the validation context.
[ "Creates", "new", "JSONPath", "validation", "context", "if", "not", "done", "before", "and", "gets", "the", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L911-L919
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.parseValidationContexts
protected List<ValidationContext> parseValidationContexts(Element messageElement, BeanDefinitionBuilder builder) { List<ValidationContext> validationContexts = new ArrayList<>(); if (messageElement != null) { String messageType = messageElement.getAttribute("type"); if (!StringUtils.hasText(messageType)) { messageType = Citrus.DEFAULT_MESSAGE_TYPE; } else { builder.addPropertyValue("messageType", messageType); } HeaderValidationContext headerValidationContext = new HeaderValidationContext(); validationContexts.add(headerValidationContext); String headerValidator = messageElement.getAttribute("header-validator"); if (StringUtils.hasText(headerValidator)) { headerValidationContext.addHeaderValidator(headerValidator); } String headerValidatorExpression = messageElement.getAttribute("header-validators"); if (StringUtils.hasText(headerValidatorExpression)) { Stream.of(headerValidatorExpression.split(",")) .map(String::trim) .forEach(headerValidationContext::addHeaderValidator); } XmlMessageValidationContext xmlMessageValidationContext = getXmlMessageValidationContext(messageElement); validationContexts.add(xmlMessageValidationContext); XpathMessageValidationContext xPathMessageValidationContext = getXPathMessageValidationContext(messageElement, xmlMessageValidationContext); if (!xPathMessageValidationContext.getXpathExpressions().isEmpty()) { validationContexts.add(xPathMessageValidationContext); } JsonMessageValidationContext jsonMessageValidationContext = getJsonMessageValidationContext(messageElement); validationContexts.add(jsonMessageValidationContext); JsonPathMessageValidationContext jsonPathMessageValidationContext = getJsonPathMessageValidationContext(messageElement); if (!jsonPathMessageValidationContext.getJsonPathExpressions().isEmpty()) { validationContexts.add(jsonPathMessageValidationContext); } ScriptValidationContext scriptValidationContext = getScriptValidationContext(messageElement, messageType); if (scriptValidationContext != null) { validationContexts.add(scriptValidationContext); } ManagedList<RuntimeBeanReference> validators = new ManagedList<>(); String messageValidator = messageElement.getAttribute("validator"); if (StringUtils.hasText(messageValidator)) { validators.add(new RuntimeBeanReference(messageValidator)); } String messageValidatorExpression = messageElement.getAttribute("validators"); if (StringUtils.hasText(messageValidatorExpression)) { Stream.of(messageValidatorExpression.split(",")) .map(String::trim) .map(RuntimeBeanReference::new) .forEach(validators::add); } if (!validators.isEmpty()) { builder.addPropertyValue("validators", validators); } String dataDictionary = messageElement.getAttribute("data-dictionary"); if (StringUtils.hasText(dataDictionary)) { builder.addPropertyReference("dataDictionary", dataDictionary); } } else { validationContexts.add(new HeaderValidationContext()); } return validationContexts; }
java
protected List<ValidationContext> parseValidationContexts(Element messageElement, BeanDefinitionBuilder builder) { List<ValidationContext> validationContexts = new ArrayList<>(); if (messageElement != null) { String messageType = messageElement.getAttribute("type"); if (!StringUtils.hasText(messageType)) { messageType = Citrus.DEFAULT_MESSAGE_TYPE; } else { builder.addPropertyValue("messageType", messageType); } HeaderValidationContext headerValidationContext = new HeaderValidationContext(); validationContexts.add(headerValidationContext); String headerValidator = messageElement.getAttribute("header-validator"); if (StringUtils.hasText(headerValidator)) { headerValidationContext.addHeaderValidator(headerValidator); } String headerValidatorExpression = messageElement.getAttribute("header-validators"); if (StringUtils.hasText(headerValidatorExpression)) { Stream.of(headerValidatorExpression.split(",")) .map(String::trim) .forEach(headerValidationContext::addHeaderValidator); } XmlMessageValidationContext xmlMessageValidationContext = getXmlMessageValidationContext(messageElement); validationContexts.add(xmlMessageValidationContext); XpathMessageValidationContext xPathMessageValidationContext = getXPathMessageValidationContext(messageElement, xmlMessageValidationContext); if (!xPathMessageValidationContext.getXpathExpressions().isEmpty()) { validationContexts.add(xPathMessageValidationContext); } JsonMessageValidationContext jsonMessageValidationContext = getJsonMessageValidationContext(messageElement); validationContexts.add(jsonMessageValidationContext); JsonPathMessageValidationContext jsonPathMessageValidationContext = getJsonPathMessageValidationContext(messageElement); if (!jsonPathMessageValidationContext.getJsonPathExpressions().isEmpty()) { validationContexts.add(jsonPathMessageValidationContext); } ScriptValidationContext scriptValidationContext = getScriptValidationContext(messageElement, messageType); if (scriptValidationContext != null) { validationContexts.add(scriptValidationContext); } ManagedList<RuntimeBeanReference> validators = new ManagedList<>(); String messageValidator = messageElement.getAttribute("validator"); if (StringUtils.hasText(messageValidator)) { validators.add(new RuntimeBeanReference(messageValidator)); } String messageValidatorExpression = messageElement.getAttribute("validators"); if (StringUtils.hasText(messageValidatorExpression)) { Stream.of(messageValidatorExpression.split(",")) .map(String::trim) .map(RuntimeBeanReference::new) .forEach(validators::add); } if (!validators.isEmpty()) { builder.addPropertyValue("validators", validators); } String dataDictionary = messageElement.getAttribute("data-dictionary"); if (StringUtils.hasText(dataDictionary)) { builder.addPropertyReference("dataDictionary", dataDictionary); } } else { validationContexts.add(new HeaderValidationContext()); } return validationContexts; }
[ "protected", "List", "<", "ValidationContext", ">", "parseValidationContexts", "(", "Element", "messageElement", ",", "BeanDefinitionBuilder", "builder", ")", "{", "List", "<", "ValidationContext", ">", "validationContexts", "=", "new", "ArrayList", "<>", "(", ")", ...
Parse message validation contexts. @param messageElement @param builder @return
[ "Parse", "message", "validation", "contexts", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L99-L172
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getVariableExtractors
protected List<VariableExtractor> getVariableExtractors(Element element) { List<VariableExtractor> variableExtractors = new ArrayList<>(); parseExtractHeaderElements(element, variableExtractors); Element extractElement = DomUtils.getChildElementByTagName(element, "extract"); if (extractElement != null) { Map<String, String> extractFromPath = new HashMap<>(); List<Element> messageValueElements = DomUtils.getChildElementsByTagName(extractElement, "message"); messageValueElements.addAll(DomUtils.getChildElementsByTagName(extractElement, "body")); VariableExtractorParserUtil.parseMessageElement(messageValueElements, extractFromPath); if (!CollectionUtils.isEmpty(extractFromPath)) { VariableExtractorParserUtil.addPayloadVariableExtractors(element, variableExtractors, extractFromPath); } } return variableExtractors; }
java
protected List<VariableExtractor> getVariableExtractors(Element element) { List<VariableExtractor> variableExtractors = new ArrayList<>(); parseExtractHeaderElements(element, variableExtractors); Element extractElement = DomUtils.getChildElementByTagName(element, "extract"); if (extractElement != null) { Map<String, String> extractFromPath = new HashMap<>(); List<Element> messageValueElements = DomUtils.getChildElementsByTagName(extractElement, "message"); messageValueElements.addAll(DomUtils.getChildElementsByTagName(extractElement, "body")); VariableExtractorParserUtil.parseMessageElement(messageValueElements, extractFromPath); if (!CollectionUtils.isEmpty(extractFromPath)) { VariableExtractorParserUtil.addPayloadVariableExtractors(element, variableExtractors, extractFromPath); } } return variableExtractors; }
[ "protected", "List", "<", "VariableExtractor", ">", "getVariableExtractors", "(", "Element", "element", ")", "{", "List", "<", "VariableExtractor", ">", "variableExtractors", "=", "new", "ArrayList", "<>", "(", ")", ";", "parseExtractHeaderElements", "(", "element",...
Constructs a list of variable extractors. @param element @return
[ "Constructs", "a", "list", "of", "variable", "extractors", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L179-L197
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getJsonMessageValidationContext
private JsonMessageValidationContext getJsonMessageValidationContext(Element messageElement) { JsonMessageValidationContext context = new JsonMessageValidationContext(); if (messageElement != null) { Set<String> ignoreExpressions = new HashSet<String>(); List<?> ignoreElements = DomUtils.getChildElementsByTagName(messageElement, "ignore"); for (Iterator<?> iter = ignoreElements.iterator(); iter.hasNext(); ) { Element ignoreValue = (Element) iter.next(); ignoreExpressions.add(ignoreValue.getAttribute("path")); } context.setIgnoreExpressions(ignoreExpressions); addSchemaInformationToValidationContext(messageElement, context); } return context; }
java
private JsonMessageValidationContext getJsonMessageValidationContext(Element messageElement) { JsonMessageValidationContext context = new JsonMessageValidationContext(); if (messageElement != null) { Set<String> ignoreExpressions = new HashSet<String>(); List<?> ignoreElements = DomUtils.getChildElementsByTagName(messageElement, "ignore"); for (Iterator<?> iter = ignoreElements.iterator(); iter.hasNext(); ) { Element ignoreValue = (Element) iter.next(); ignoreExpressions.add(ignoreValue.getAttribute("path")); } context.setIgnoreExpressions(ignoreExpressions); addSchemaInformationToValidationContext(messageElement, context); } return context; }
[ "private", "JsonMessageValidationContext", "getJsonMessageValidationContext", "(", "Element", "messageElement", ")", "{", "JsonMessageValidationContext", "context", "=", "new", "JsonMessageValidationContext", "(", ")", ";", "if", "(", "messageElement", "!=", "null", ")", ...
Construct the basic Json message validation context. @param messageElement @return
[ "Construct", "the", "basic", "Json", "message", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L204-L220
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getXmlMessageValidationContext
private XmlMessageValidationContext getXmlMessageValidationContext(Element messageElement) { XmlMessageValidationContext context = new XmlMessageValidationContext(); if (messageElement != null) { addSchemaInformationToValidationContext(messageElement, context); Set<String> ignoreExpressions = new HashSet<String>(); List<?> ignoreElements = DomUtils.getChildElementsByTagName(messageElement, "ignore"); for (Iterator<?> iter = ignoreElements.iterator(); iter.hasNext();) { Element ignoreValue = (Element) iter.next(); ignoreExpressions.add(ignoreValue.getAttribute("path")); } context.setIgnoreExpressions(ignoreExpressions); parseNamespaceValidationElements(messageElement, context); //Catch namespace declarations for namespace context Map<String, String> namespaces = new HashMap<String, String>(); List<?> namespaceElements = DomUtils.getChildElementsByTagName(messageElement, "namespace"); if (namespaceElements.size() > 0) { for (Iterator<?> iter = namespaceElements.iterator(); iter.hasNext();) { Element namespaceElement = (Element) iter.next(); namespaces.put(namespaceElement.getAttribute("prefix"), namespaceElement.getAttribute("value")); } context.setNamespaces(namespaces); } } return context; }
java
private XmlMessageValidationContext getXmlMessageValidationContext(Element messageElement) { XmlMessageValidationContext context = new XmlMessageValidationContext(); if (messageElement != null) { addSchemaInformationToValidationContext(messageElement, context); Set<String> ignoreExpressions = new HashSet<String>(); List<?> ignoreElements = DomUtils.getChildElementsByTagName(messageElement, "ignore"); for (Iterator<?> iter = ignoreElements.iterator(); iter.hasNext();) { Element ignoreValue = (Element) iter.next(); ignoreExpressions.add(ignoreValue.getAttribute("path")); } context.setIgnoreExpressions(ignoreExpressions); parseNamespaceValidationElements(messageElement, context); //Catch namespace declarations for namespace context Map<String, String> namespaces = new HashMap<String, String>(); List<?> namespaceElements = DomUtils.getChildElementsByTagName(messageElement, "namespace"); if (namespaceElements.size() > 0) { for (Iterator<?> iter = namespaceElements.iterator(); iter.hasNext();) { Element namespaceElement = (Element) iter.next(); namespaces.put(namespaceElement.getAttribute("prefix"), namespaceElement.getAttribute("value")); } context.setNamespaces(namespaces); } } return context; }
[ "private", "XmlMessageValidationContext", "getXmlMessageValidationContext", "(", "Element", "messageElement", ")", "{", "XmlMessageValidationContext", "context", "=", "new", "XmlMessageValidationContext", "(", ")", ";", "if", "(", "messageElement", "!=", "null", ")", "{",...
Construct the basic Xml message validation context. @param messageElement @return
[ "Construct", "the", "basic", "Xml", "message", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L227-L256
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.addSchemaInformationToValidationContext
private void addSchemaInformationToValidationContext(Element messageElement, SchemaValidationContext context) { String schemaValidation = messageElement.getAttribute("schema-validation"); if (StringUtils.hasText(schemaValidation)) { context.setSchemaValidation(Boolean.valueOf(schemaValidation)); } String schema = messageElement.getAttribute("schema"); if (StringUtils.hasText(schema)) { context.setSchema(schema); } String schemaRepository = messageElement.getAttribute("schema-repository"); if (StringUtils.hasText(schemaRepository)) { context.setSchemaRepository(schemaRepository); } }
java
private void addSchemaInformationToValidationContext(Element messageElement, SchemaValidationContext context) { String schemaValidation = messageElement.getAttribute("schema-validation"); if (StringUtils.hasText(schemaValidation)) { context.setSchemaValidation(Boolean.valueOf(schemaValidation)); } String schema = messageElement.getAttribute("schema"); if (StringUtils.hasText(schema)) { context.setSchema(schema); } String schemaRepository = messageElement.getAttribute("schema-repository"); if (StringUtils.hasText(schemaRepository)) { context.setSchemaRepository(schemaRepository); } }
[ "private", "void", "addSchemaInformationToValidationContext", "(", "Element", "messageElement", ",", "SchemaValidationContext", "context", ")", "{", "String", "schemaValidation", "=", "messageElement", ".", "getAttribute", "(", "\"schema-validation\"", ")", ";", "if", "("...
Adds information about the validation of the message against a certain schema to the context @param messageElement The message element to get the configuration from @param context The context to set the schema validation configuration to
[ "Adds", "information", "about", "the", "validation", "of", "the", "message", "against", "a", "certain", "schema", "to", "the", "context" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L263-L278
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getXPathMessageValidationContext
private XpathMessageValidationContext getXPathMessageValidationContext(Element messageElement, XmlMessageValidationContext parentContext) { XpathMessageValidationContext context = new XpathMessageValidationContext(); parseXPathValidationElements(messageElement, context); context.setControlNamespaces(parentContext.getControlNamespaces()); context.setNamespaces(parentContext.getNamespaces()); context.setIgnoreExpressions(parentContext.getIgnoreExpressions()); context.setSchema(parentContext.getSchema()); context.setSchemaRepository(parentContext.getSchemaRepository()); context.setSchemaValidation(parentContext.isSchemaValidationEnabled()); context.setDTDResource(parentContext.getDTDResource()); return context; }
java
private XpathMessageValidationContext getXPathMessageValidationContext(Element messageElement, XmlMessageValidationContext parentContext) { XpathMessageValidationContext context = new XpathMessageValidationContext(); parseXPathValidationElements(messageElement, context); context.setControlNamespaces(parentContext.getControlNamespaces()); context.setNamespaces(parentContext.getNamespaces()); context.setIgnoreExpressions(parentContext.getIgnoreExpressions()); context.setSchema(parentContext.getSchema()); context.setSchemaRepository(parentContext.getSchemaRepository()); context.setSchemaValidation(parentContext.isSchemaValidationEnabled()); context.setDTDResource(parentContext.getDTDResource()); return context; }
[ "private", "XpathMessageValidationContext", "getXPathMessageValidationContext", "(", "Element", "messageElement", ",", "XmlMessageValidationContext", "parentContext", ")", "{", "XpathMessageValidationContext", "context", "=", "new", "XpathMessageValidationContext", "(", ")", ";",...
Construct the XPath message validation context. @param messageElement @param parentContext @return
[ "Construct", "the", "XPath", "message", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L286-L300
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getJsonPathMessageValidationContext
private JsonPathMessageValidationContext getJsonPathMessageValidationContext(Element messageElement) { JsonPathMessageValidationContext context = new JsonPathMessageValidationContext(); //check for validate elements, these elements can either have script, jsonPath or namespace validation information //for now we only handle jsonPath validation Map<String, Object> validateJsonPathExpressions = new HashMap<>(); List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate"); if (validateElements.size() > 0) { for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) { Element validateElement = (Element) iter.next(); extractJsonPathValidateExpressions(validateElement, validateJsonPathExpressions); } context.setJsonPathExpressions(validateJsonPathExpressions); } return context; }
java
private JsonPathMessageValidationContext getJsonPathMessageValidationContext(Element messageElement) { JsonPathMessageValidationContext context = new JsonPathMessageValidationContext(); //check for validate elements, these elements can either have script, jsonPath or namespace validation information //for now we only handle jsonPath validation Map<String, Object> validateJsonPathExpressions = new HashMap<>(); List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate"); if (validateElements.size() > 0) { for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) { Element validateElement = (Element) iter.next(); extractJsonPathValidateExpressions(validateElement, validateJsonPathExpressions); } context.setJsonPathExpressions(validateJsonPathExpressions); } return context; }
[ "private", "JsonPathMessageValidationContext", "getJsonPathMessageValidationContext", "(", "Element", "messageElement", ")", "{", "JsonPathMessageValidationContext", "context", "=", "new", "JsonPathMessageValidationContext", "(", ")", ";", "//check for validate elements, these elemen...
Construct the JSONPath message validation context. @param messageElement @return
[ "Construct", "the", "JSONPath", "message", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L307-L324
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.getScriptValidationContext
private ScriptValidationContext getScriptValidationContext(Element messageElement, String messageType) { ScriptValidationContext context = null; boolean done = false; List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate"); if (validateElements.size() > 0) { for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) { Element validateElement = (Element) iter.next(); Element scriptElement = DomUtils.getChildElementByTagName(validateElement, "script"); // check for nested validate script child node if (scriptElement != null) { if (!done) { done = true; } else { throw new BeanCreationException("Found multiple validation script definitions - " + "only supporting a single validation script for message validation"); } context = new ScriptValidationContext(messageType); String type = scriptElement.getAttribute("type"); context.setScriptType(type); String filePath = scriptElement.getAttribute("file"); if (StringUtils.hasText(filePath)) { context.setValidationScriptResourcePath(filePath); if (scriptElement.hasAttribute("charset")) { context.setValidationScriptResourceCharset(scriptElement.getAttribute("charset")); } } else { context.setValidationScript(DomUtils.getTextValue(scriptElement)); } } } } return context; }
java
private ScriptValidationContext getScriptValidationContext(Element messageElement, String messageType) { ScriptValidationContext context = null; boolean done = false; List<?> validateElements = DomUtils.getChildElementsByTagName(messageElement, "validate"); if (validateElements.size() > 0) { for (Iterator<?> iter = validateElements.iterator(); iter.hasNext();) { Element validateElement = (Element) iter.next(); Element scriptElement = DomUtils.getChildElementByTagName(validateElement, "script"); // check for nested validate script child node if (scriptElement != null) { if (!done) { done = true; } else { throw new BeanCreationException("Found multiple validation script definitions - " + "only supporting a single validation script for message validation"); } context = new ScriptValidationContext(messageType); String type = scriptElement.getAttribute("type"); context.setScriptType(type); String filePath = scriptElement.getAttribute("file"); if (StringUtils.hasText(filePath)) { context.setValidationScriptResourcePath(filePath); if (scriptElement.hasAttribute("charset")) { context.setValidationScriptResourceCharset(scriptElement.getAttribute("charset")); } } else { context.setValidationScript(DomUtils.getTextValue(scriptElement)); } } } } return context; }
[ "private", "ScriptValidationContext", "getScriptValidationContext", "(", "Element", "messageElement", ",", "String", "messageType", ")", "{", "ScriptValidationContext", "context", "=", "null", ";", "boolean", "done", "=", "false", ";", "List", "<", "?", ">", "valida...
Construct the message validation context. @param messageElement @return
[ "Construct", "the", "message", "validation", "context", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L331-L369
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.extractXPathValidateExpressions
private void extractXPathValidateExpressions( Element validateElement, Map<String, Object> validateXpathExpressions) { //check for xpath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (StringUtils.hasText(pathExpression) && !JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { //construct pathExpression with explicit result-type, like boolean:/TestMessage/Value if (validateElement.hasAttribute("result-type")) { pathExpression = validateElement.getAttribute("result-type") + ":" + pathExpression; } validateXpathExpressions.put(pathExpression, validateElement.getAttribute("value")); } //check for xpath validation elements - new style preferred List<?> xpathElements = DomUtils.getChildElementsByTagName(validateElement, "xpath"); if (xpathElements.size() > 0) { for (Iterator<?> xpathIterator = xpathElements.iterator(); xpathIterator.hasNext();) { Element xpathElement = (Element) xpathIterator.next(); String expression = xpathElement.getAttribute("expression"); if (StringUtils.hasText(expression)) { //construct expression with explicit result-type, like boolean:/TestMessage/Value if (xpathElement.hasAttribute("result-type")) { expression = xpathElement.getAttribute("result-type") + ":" + expression; } validateXpathExpressions.put(expression, xpathElement.getAttribute("value")); } } } }
java
private void extractXPathValidateExpressions( Element validateElement, Map<String, Object> validateXpathExpressions) { //check for xpath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (StringUtils.hasText(pathExpression) && !JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { //construct pathExpression with explicit result-type, like boolean:/TestMessage/Value if (validateElement.hasAttribute("result-type")) { pathExpression = validateElement.getAttribute("result-type") + ":" + pathExpression; } validateXpathExpressions.put(pathExpression, validateElement.getAttribute("value")); } //check for xpath validation elements - new style preferred List<?> xpathElements = DomUtils.getChildElementsByTagName(validateElement, "xpath"); if (xpathElements.size() > 0) { for (Iterator<?> xpathIterator = xpathElements.iterator(); xpathIterator.hasNext();) { Element xpathElement = (Element) xpathIterator.next(); String expression = xpathElement.getAttribute("expression"); if (StringUtils.hasText(expression)) { //construct expression with explicit result-type, like boolean:/TestMessage/Value if (xpathElement.hasAttribute("result-type")) { expression = xpathElement.getAttribute("result-type") + ":" + expression; } validateXpathExpressions.put(expression, xpathElement.getAttribute("value")); } } } }
[ "private", "void", "extractXPathValidateExpressions", "(", "Element", "validateElement", ",", "Map", "<", "String", ",", "Object", ">", "validateXpathExpressions", ")", "{", "//check for xpath validation - old style with direct attribute", "String", "pathExpression", "=", "va...
Extracts xpath validation expressions and fills map with them @param validateElement @param validateXpathExpressions
[ "Extracts", "xpath", "validation", "expressions", "and", "fills", "map", "with", "them" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L427-L456
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java
ReceiveMessageActionParser.extractJsonPathValidateExpressions
private void extractJsonPathValidateExpressions( Element validateElement, Map<String, Object> validateJsonPathExpressions) { //check for jsonPath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { validateJsonPathExpressions.put(pathExpression, validateElement.getAttribute("value")); } //check for jsonPath validation elements - new style preferred ValidateMessageParserUtil.parseJsonPathElements(validateElement, validateJsonPathExpressions); }
java
private void extractJsonPathValidateExpressions( Element validateElement, Map<String, Object> validateJsonPathExpressions) { //check for jsonPath validation - old style with direct attribute String pathExpression = validateElement.getAttribute("path"); if (JsonPathMessageValidationContext.isJsonPathExpression(pathExpression)) { validateJsonPathExpressions.put(pathExpression, validateElement.getAttribute("value")); } //check for jsonPath validation elements - new style preferred ValidateMessageParserUtil.parseJsonPathElements(validateElement, validateJsonPathExpressions); }
[ "private", "void", "extractJsonPathValidateExpressions", "(", "Element", "validateElement", ",", "Map", "<", "String", ",", "Object", ">", "validateJsonPathExpressions", ")", "{", "//check for jsonPath validation - old style with direct attribute", "String", "pathExpression", "...
Extracts jsonPath validation expressions and fills map with them @param validateElement @param validateJsonPathExpressions
[ "Extracts", "jsonPath", "validation", "expressions", "and", "fills", "map", "with", "them" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/ReceiveMessageActionParser.java#L463-L473
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/AbstractSchemaCollection.java
AbstractSchemaCollection.addImportedSchemas
protected void addImportedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { for (Object imports : schema.getImports().values()) { for (SchemaImport schemaImport : (Vector<SchemaImport>)imports) { // Prevent duplicate imports if (!importedSchemas.contains(schemaImport.getNamespaceURI())) { importedSchemas.add(schemaImport.getNamespaceURI()); Schema referencedSchema = schemaImport.getReferencedSchema(); if (referencedSchema != null) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); Source source = new DOMSource(referencedSchema.getElement()); Result result = new StreamResult(bos); TransformerFactory.newInstance().newTransformer().transform(source, result); Resource schemaResource = new ByteArrayResource(bos.toByteArray()); addImportedSchemas(referencedSchema); schemaResources.add(schemaResource); } } } } }
java
protected void addImportedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { for (Object imports : schema.getImports().values()) { for (SchemaImport schemaImport : (Vector<SchemaImport>)imports) { // Prevent duplicate imports if (!importedSchemas.contains(schemaImport.getNamespaceURI())) { importedSchemas.add(schemaImport.getNamespaceURI()); Schema referencedSchema = schemaImport.getReferencedSchema(); if (referencedSchema != null) { ByteArrayOutputStream bos = new ByteArrayOutputStream(); Source source = new DOMSource(referencedSchema.getElement()); Result result = new StreamResult(bos); TransformerFactory.newInstance().newTransformer().transform(source, result); Resource schemaResource = new ByteArrayResource(bos.toByteArray()); addImportedSchemas(referencedSchema); schemaResources.add(schemaResource); } } } } }
[ "protected", "void", "addImportedSchemas", "(", "Schema", "schema", ")", "throws", "WSDLException", ",", "IOException", ",", "TransformerException", ",", "TransformerFactoryConfigurationError", "{", "for", "(", "Object", "imports", ":", "schema", ".", "getImports", "(...
Recursively add all imported schemas as schema resource. This is necessary when schema import are located in jar files. If they are not added immediately the reference to them is lost. @param schema
[ "Recursively", "add", "all", "imported", "schemas", "as", "schema", "resource", ".", "This", "is", "necessary", "when", "schema", "import", "are", "located", "in", "jar", "files", ".", "If", "they", "are", "not", "added", "immediately", "the", "reference", "...
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/AbstractSchemaCollection.java#L70-L92
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/AbstractSchemaCollection.java
AbstractSchemaCollection.addIncludedSchemas
protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { List<SchemaReference> includes = schema.getIncludes(); for (SchemaReference schemaReference : includes) { String schemaLocation; URI locationURI = URI.create(schemaReference.getSchemaLocationURI()); if (locationURI.isAbsolute()) { schemaLocation = schemaReference.getSchemaLocationURI(); } else { schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI(); } schemaResources.add(new FileSystemResource(schemaLocation)); } }
java
protected void addIncludedSchemas(Schema schema) throws WSDLException, IOException, TransformerException, TransformerFactoryConfigurationError { List<SchemaReference> includes = schema.getIncludes(); for (SchemaReference schemaReference : includes) { String schemaLocation; URI locationURI = URI.create(schemaReference.getSchemaLocationURI()); if (locationURI.isAbsolute()) { schemaLocation = schemaReference.getSchemaLocationURI(); } else { schemaLocation = schema.getDocumentBaseURI().substring(0, schema.getDocumentBaseURI().lastIndexOf('/') + 1) + schemaReference.getSchemaLocationURI(); } schemaResources.add(new FileSystemResource(schemaLocation)); } }
[ "protected", "void", "addIncludedSchemas", "(", "Schema", "schema", ")", "throws", "WSDLException", ",", "IOException", ",", "TransformerException", ",", "TransformerFactoryConfigurationError", "{", "List", "<", "SchemaReference", ">", "includes", "=", "schema", ".", ...
Recursively add all included schemas as schema resource.
[ "Recursively", "add", "all", "included", "schemas", "as", "schema", "resource", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/schema/AbstractSchemaCollection.java#L97-L110
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java
NamespaceContextBuilder.buildContext
public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) { SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext(); //first add default namespace definitions if (namespaceMappings.size() > 0) { simpleNamespaceContext.setBindings(namespaceMappings); } Map<String, String> dynamicBindings = XMLUtils.lookupNamespaces(receivedMessage.getPayload(String.class)); if (!CollectionUtils.isEmpty(namespaces)) { //dynamic binding of namespaces declarations in root element of received message for (Entry<String, String> binding : dynamicBindings.entrySet()) { //only bind namespace that is not present in explicit namespace bindings if (!namespaces.containsValue(binding.getValue())) { simpleNamespaceContext.bindNamespaceUri(binding.getKey(), binding.getValue()); } } //add explicit namespace bindings simpleNamespaceContext.setBindings(namespaces); } else { simpleNamespaceContext.setBindings(dynamicBindings); } return simpleNamespaceContext; }
java
public NamespaceContext buildContext(Message receivedMessage, Map<String, String> namespaces) { SimpleNamespaceContext simpleNamespaceContext = new SimpleNamespaceContext(); //first add default namespace definitions if (namespaceMappings.size() > 0) { simpleNamespaceContext.setBindings(namespaceMappings); } Map<String, String> dynamicBindings = XMLUtils.lookupNamespaces(receivedMessage.getPayload(String.class)); if (!CollectionUtils.isEmpty(namespaces)) { //dynamic binding of namespaces declarations in root element of received message for (Entry<String, String> binding : dynamicBindings.entrySet()) { //only bind namespace that is not present in explicit namespace bindings if (!namespaces.containsValue(binding.getValue())) { simpleNamespaceContext.bindNamespaceUri(binding.getKey(), binding.getValue()); } } //add explicit namespace bindings simpleNamespaceContext.setBindings(namespaces); } else { simpleNamespaceContext.setBindings(dynamicBindings); } return simpleNamespaceContext; }
[ "public", "NamespaceContext", "buildContext", "(", "Message", "receivedMessage", ",", "Map", "<", "String", ",", "String", ">", "namespaces", ")", "{", "SimpleNamespaceContext", "simpleNamespaceContext", "=", "new", "SimpleNamespaceContext", "(", ")", ";", "//first ad...
Construct a basic namespace context from the received message and explicit namespace mappings. @param receivedMessage the actual message received. @param namespaces explicit namespace mappings for this construction. @return the constructed namespace context.
[ "Construct", "a", "basic", "namespace", "context", "from", "the", "received", "message", "and", "explicit", "namespace", "mappings", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/namespace/NamespaceContextBuilder.java#L52-L76
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/DispatchingMessageSelector.java
DispatchingMessageSelector.addMessageSelectorFactory
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) { if (factory instanceof BeanFactoryAware) { ((BeanFactoryAware) factory).setBeanFactory(beanFactory); } this.factories.add(factory); }
java
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) { if (factory instanceof BeanFactoryAware) { ((BeanFactoryAware) factory).setBeanFactory(beanFactory); } this.factories.add(factory); }
[ "public", "void", "addMessageSelectorFactory", "(", "MessageSelectorFactory", "<", "?", ">", "factory", ")", "{", "if", "(", "factory", "instanceof", "BeanFactoryAware", ")", "{", "(", "(", "BeanFactoryAware", ")", "factory", ")", ".", "setBeanFactory", "(", "be...
Add message selector factory to list of delegates. @param factory
[ "Add", "message", "selector", "factory", "to", "list", "of", "delegates", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/channel/selector/DispatchingMessageSelector.java#L96-L102
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java
ValidationMatcherUtils.resolveValidationMatcher
public static void resolveValidationMatcher(String fieldName, String fieldValue, String validationMatcherExpression, TestContext context) { String expression = VariableUtils.cutOffVariablesPrefix(cutOffValidationMatchersPrefix(validationMatcherExpression)); if (expression.equals("ignore")) { expression += "()"; } int bodyStart = expression.indexOf('('); if (bodyStart < 0) { throw new CitrusRuntimeException("Illegal syntax for validation matcher expression - missing validation value in '()' function body"); } String prefix = ""; if (expression.indexOf(':') > 0 && expression.indexOf(':') < bodyStart) { prefix = expression.substring(0, expression.indexOf(':') + 1); } String matcherValue = expression.substring(bodyStart + 1, expression.length() - 1); String matcherName = expression.substring(prefix.length(), bodyStart); ValidationMatcherLibrary library = context.getValidationMatcherRegistry().getLibraryForPrefix(prefix); ValidationMatcher validationMatcher = library.getValidationMatcher(matcherName); ControlExpressionParser controlExpressionParser = lookupControlExpressionParser(validationMatcher); List<String> params = controlExpressionParser.extractControlValues(matcherValue, null); List<String> replacedParams = replaceVariablesAndFunctionsInParameters(params, context); validationMatcher.validate(fieldName, fieldValue, replacedParams, context); }
java
public static void resolveValidationMatcher(String fieldName, String fieldValue, String validationMatcherExpression, TestContext context) { String expression = VariableUtils.cutOffVariablesPrefix(cutOffValidationMatchersPrefix(validationMatcherExpression)); if (expression.equals("ignore")) { expression += "()"; } int bodyStart = expression.indexOf('('); if (bodyStart < 0) { throw new CitrusRuntimeException("Illegal syntax for validation matcher expression - missing validation value in '()' function body"); } String prefix = ""; if (expression.indexOf(':') > 0 && expression.indexOf(':') < bodyStart) { prefix = expression.substring(0, expression.indexOf(':') + 1); } String matcherValue = expression.substring(bodyStart + 1, expression.length() - 1); String matcherName = expression.substring(prefix.length(), bodyStart); ValidationMatcherLibrary library = context.getValidationMatcherRegistry().getLibraryForPrefix(prefix); ValidationMatcher validationMatcher = library.getValidationMatcher(matcherName); ControlExpressionParser controlExpressionParser = lookupControlExpressionParser(validationMatcher); List<String> params = controlExpressionParser.extractControlValues(matcherValue, null); List<String> replacedParams = replaceVariablesAndFunctionsInParameters(params, context); validationMatcher.validate(fieldName, fieldValue, replacedParams, context); }
[ "public", "static", "void", "resolveValidationMatcher", "(", "String", "fieldName", ",", "String", "fieldValue", ",", "String", "validationMatcherExpression", ",", "TestContext", "context", ")", "{", "String", "expression", "=", "VariableUtils", ".", "cutOffVariablesPre...
This method resolves a custom validationMatcher to its respective result. @param fieldName the name of the field @param fieldValue the value of the field @param validationMatcherExpression to evaluate. @param context the test context
[ "This", "method", "resolves", "a", "custom", "validationMatcher", "to", "its", "respective", "result", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java#L48-L76
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java
ValidationMatcherUtils.isValidationMatcherExpression
public static boolean isValidationMatcherExpression(String expression) { return expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) && expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX); }
java
public static boolean isValidationMatcherExpression(String expression) { return expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) && expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX); }
[ "public", "static", "boolean", "isValidationMatcherExpression", "(", "String", "expression", ")", "{", "return", "expression", ".", "startsWith", "(", "Citrus", ".", "VALIDATION_MATCHER_PREFIX", ")", "&&", "expression", ".", "endsWith", "(", "Citrus", ".", "VALIDATI...
Checks if expression is a validation matcher expression. @param expression the expression to check @return
[ "Checks", "if", "expression", "is", "a", "validation", "matcher", "expression", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java#L93-L96
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java
ValidationMatcherUtils.cutOffValidationMatchersPrefix
private static String cutOffValidationMatchersPrefix(String expression) { if (expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) && expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX)) { return expression.substring(Citrus.VALIDATION_MATCHER_PREFIX.length(), expression.length() - Citrus.VALIDATION_MATCHER_SUFFIX.length()); } return expression; }
java
private static String cutOffValidationMatchersPrefix(String expression) { if (expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) && expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX)) { return expression.substring(Citrus.VALIDATION_MATCHER_PREFIX.length(), expression.length() - Citrus.VALIDATION_MATCHER_SUFFIX.length()); } return expression; }
[ "private", "static", "String", "cutOffValidationMatchersPrefix", "(", "String", "expression", ")", "{", "if", "(", "expression", ".", "startsWith", "(", "Citrus", ".", "VALIDATION_MATCHER_PREFIX", ")", "&&", "expression", ".", "endsWith", "(", "Citrus", ".", "VALI...
Cut off validation matchers prefix and suffix. @param expression @return
[ "Cut", "off", "validation", "matchers", "prefix", "and", "suffix", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherUtils.java#L103-L109
train
citrusframework/citrus
modules/citrus-integration/src/it/java/com/consol/citrus/rmi/HelloServiceClient.java
HelloServiceClient.sayHello
public BeanInvocation sayHello(String message) { BeanInvocation invocation = new BeanInvocation(); try { invocation.setMethod(HelloService.class.getMethod("sayHello", String.class)); invocation.setArgs(new Object[] { message }); } catch (NoSuchMethodException e) { throw new CitrusRuntimeException("Failed to access remote service method", e); } return invocation; }
java
public BeanInvocation sayHello(String message) { BeanInvocation invocation = new BeanInvocation(); try { invocation.setMethod(HelloService.class.getMethod("sayHello", String.class)); invocation.setArgs(new Object[] { message }); } catch (NoSuchMethodException e) { throw new CitrusRuntimeException("Failed to access remote service method", e); } return invocation; }
[ "public", "BeanInvocation", "sayHello", "(", "String", "message", ")", "{", "BeanInvocation", "invocation", "=", "new", "BeanInvocation", "(", ")", ";", "try", "{", "invocation", ".", "setMethod", "(", "HelloService", ".", "class", ".", "getMethod", "(", "\"sa...
Creates bean invocation for hello service call. @param message @return
[ "Creates", "bean", "invocation", "for", "hello", "service", "call", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-integration/src/it/java/com/consol/citrus/rmi/HelloServiceClient.java#L32-L41
train
citrusframework/citrus
tools/remote/citrus-remote-server/src/main/java/com/consol/citrus/remote/CitrusRemoteConfiguration.java
CitrusRemoteConfiguration.apply
public void apply(CitrusAppConfiguration configuration) { setPackages(configuration.getPackages()); setTestClasses(configuration.getTestClasses()); setIncludes(configuration.getIncludes()); addDefaultProperties(configuration.getDefaultProperties()); }
java
public void apply(CitrusAppConfiguration configuration) { setPackages(configuration.getPackages()); setTestClasses(configuration.getTestClasses()); setIncludes(configuration.getIncludes()); addDefaultProperties(configuration.getDefaultProperties()); }
[ "public", "void", "apply", "(", "CitrusAppConfiguration", "configuration", ")", "{", "setPackages", "(", "configuration", ".", "getPackages", "(", ")", ")", ";", "setTestClasses", "(", "configuration", ".", "getTestClasses", "(", ")", ")", ";", "setIncludes", "(...
Applies configuration with settable properties at runtime. @param configuration
[ "Applies", "configuration", "with", "settable", "properties", "at", "runtime", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/tools/remote/citrus-remote-server/src/main/java/com/consol/citrus/remote/CitrusRemoteConfiguration.java#L52-L57
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/functions/core/RandomStringFunction.java
RandomStringFunction.getRandomString
public static String getRandomString(int numberOfLetters, char[] alphabet, boolean includeNumbers) { StringBuilder builder = new StringBuilder(); int upperRange = alphabet.length - 1; // make sure first character is not a number builder.append(alphabet[generator.nextInt(upperRange)]); if (includeNumbers) { upperRange += NUMBERS.length; } for (int i = 1; i < numberOfLetters; i++) { int letterIndex = generator.nextInt(upperRange); if (letterIndex > alphabet.length - 1) { builder.append(NUMBERS[letterIndex - alphabet.length]); } else { builder.append(alphabet[letterIndex]); } } return builder.toString(); }
java
public static String getRandomString(int numberOfLetters, char[] alphabet, boolean includeNumbers) { StringBuilder builder = new StringBuilder(); int upperRange = alphabet.length - 1; // make sure first character is not a number builder.append(alphabet[generator.nextInt(upperRange)]); if (includeNumbers) { upperRange += NUMBERS.length; } for (int i = 1; i < numberOfLetters; i++) { int letterIndex = generator.nextInt(upperRange); if (letterIndex > alphabet.length - 1) { builder.append(NUMBERS[letterIndex - alphabet.length]); } else { builder.append(alphabet[letterIndex]); } } return builder.toString(); }
[ "public", "static", "String", "getRandomString", "(", "int", "numberOfLetters", ",", "char", "[", "]", "alphabet", ",", "boolean", "includeNumbers", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "int", "upperRange", "=", "al...
Static random number generator aware string generating method. @param numberOfLetters @param alphabet @param includeNumbers @return
[ "Static", "random", "number", "generator", "aware", "string", "generating", "method", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/functions/core/RandomStringFunction.java#L107-L130
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherLibrary.java
ValidationMatcherLibrary.getValidationMatcher
public ValidationMatcher getValidationMatcher(String validationMatcherName) throws NoSuchValidationMatcherException { if (!members.containsKey(validationMatcherName)) { throw new NoSuchValidationMatcherException("Can not find validation matcher " + validationMatcherName + " in library " + name + " (" + prefix + ")"); } return members.get(validationMatcherName); }
java
public ValidationMatcher getValidationMatcher(String validationMatcherName) throws NoSuchValidationMatcherException { if (!members.containsKey(validationMatcherName)) { throw new NoSuchValidationMatcherException("Can not find validation matcher " + validationMatcherName + " in library " + name + " (" + prefix + ")"); } return members.get(validationMatcherName); }
[ "public", "ValidationMatcher", "getValidationMatcher", "(", "String", "validationMatcherName", ")", "throws", "NoSuchValidationMatcherException", "{", "if", "(", "!", "members", ".", "containsKey", "(", "validationMatcherName", ")", ")", "{", "throw", "new", "NoSuchVali...
Try to find validationMatcher in library by name. @param validationMatcherName validationMatcher name. @return the validationMatcher instance. @throws com.consol.citrus.exceptions.NoSuchValidationMatcherException
[ "Try", "to", "find", "validationMatcher", "in", "library", "by", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherLibrary.java#L47-L53
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherLibrary.java
ValidationMatcherLibrary.knowsValidationMatcher
public boolean knowsValidationMatcher(String validationMatcherName) { // custom libraries: if (validationMatcherName.contains(":")) { String validationMatcherPrefix = validationMatcherName.substring(0, validationMatcherName.indexOf(':') + 1); if (!validationMatcherPrefix.equals(prefix)) { return false; } return members.containsKey(validationMatcherName.substring(validationMatcherName.indexOf(':') + 1, validationMatcherName.indexOf('('))); } else { // standard citrus-library without prefix: return members.containsKey(validationMatcherName.substring(0, validationMatcherName.indexOf('('))); } }
java
public boolean knowsValidationMatcher(String validationMatcherName) { // custom libraries: if (validationMatcherName.contains(":")) { String validationMatcherPrefix = validationMatcherName.substring(0, validationMatcherName.indexOf(':') + 1); if (!validationMatcherPrefix.equals(prefix)) { return false; } return members.containsKey(validationMatcherName.substring(validationMatcherName.indexOf(':') + 1, validationMatcherName.indexOf('('))); } else { // standard citrus-library without prefix: return members.containsKey(validationMatcherName.substring(0, validationMatcherName.indexOf('('))); } }
[ "public", "boolean", "knowsValidationMatcher", "(", "String", "validationMatcherName", ")", "{", "// custom libraries:", "if", "(", "validationMatcherName", ".", "contains", "(", "\":\"", ")", ")", "{", "String", "validationMatcherPrefix", "=", "validationMatcherName", ...
Does this library know a validationMatcher with the given name. @param validationMatcherName name to search for. @return boolean flag to mark existence.
[ "Does", "this", "library", "know", "a", "validationMatcher", "with", "the", "given", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/ValidationMatcherLibrary.java#L61-L74
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/hamcrest/HamcrestValidationMatcher.java
HamcrestValidationMatcher.containsNumericMatcher
private boolean containsNumericMatcher(String matcherExpression) { for (String numericMatcher : numericMatchers) { if (matcherExpression.contains(numericMatcher)) { return true; } } return false; }
java
private boolean containsNumericMatcher(String matcherExpression) { for (String numericMatcher : numericMatchers) { if (matcherExpression.contains(numericMatcher)) { return true; } } return false; }
[ "private", "boolean", "containsNumericMatcher", "(", "String", "matcherExpression", ")", "{", "for", "(", "String", "numericMatcher", ":", "numericMatchers", ")", "{", "if", "(", "matcherExpression", ".", "contains", "(", "numericMatcher", ")", ")", "{", "return",...
Checks for numeric matcher presence in expression. @param matcherExpression @return
[ "Checks", "for", "numeric", "matcher", "presence", "in", "expression", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/validation/matcher/hamcrest/HamcrestValidationMatcher.java#L307-L315
train
citrusframework/citrus
modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/endpoint/WebSocketConsumer.java
WebSocketConsumer.receive
private WebSocketMessage<?> receive(WebSocketEndpointConfiguration config, long timeout) { long timeLeft = timeout; WebSocketMessage<?> message = config.getHandler().getMessage(); String path = endpointConfiguration.getEndpointUri(); while (message == null && timeLeft > 0) { timeLeft -= endpointConfiguration.getPollingInterval(); long sleep = timeLeft > 0 ? endpointConfiguration.getPollingInterval() : endpointConfiguration.getPollingInterval() + timeLeft; if (LOG.isDebugEnabled()) { String msg = "Waiting for message on '%s' - retrying in %s ms"; LOG.debug(String.format(msg, path, (sleep))); } try { Thread.sleep(sleep); } catch (InterruptedException e) { LOG.warn(String.format("Thread interrupted while waiting for message on '%s'", path), e); } message = config.getHandler().getMessage(); } if (message == null) { throw new ActionTimeoutException(String.format("Action timed out while receiving message on '%s'", path)); } return message; }
java
private WebSocketMessage<?> receive(WebSocketEndpointConfiguration config, long timeout) { long timeLeft = timeout; WebSocketMessage<?> message = config.getHandler().getMessage(); String path = endpointConfiguration.getEndpointUri(); while (message == null && timeLeft > 0) { timeLeft -= endpointConfiguration.getPollingInterval(); long sleep = timeLeft > 0 ? endpointConfiguration.getPollingInterval() : endpointConfiguration.getPollingInterval() + timeLeft; if (LOG.isDebugEnabled()) { String msg = "Waiting for message on '%s' - retrying in %s ms"; LOG.debug(String.format(msg, path, (sleep))); } try { Thread.sleep(sleep); } catch (InterruptedException e) { LOG.warn(String.format("Thread interrupted while waiting for message on '%s'", path), e); } message = config.getHandler().getMessage(); } if (message == null) { throw new ActionTimeoutException(String.format("Action timed out while receiving message on '%s'", path)); } return message; }
[ "private", "WebSocketMessage", "<", "?", ">", "receive", "(", "WebSocketEndpointConfiguration", "config", ",", "long", "timeout", ")", "{", "long", "timeLeft", "=", "timeout", ";", "WebSocketMessage", "<", "?", ">", "message", "=", "config", ".", "getHandler", ...
Receive web socket message by polling on web socket handler for incoming message. @param config @param timeout @return
[ "Receive", "web", "socket", "message", "by", "polling", "on", "web", "socket", "handler", "for", "incoming", "message", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-websocket/src/main/java/com/consol/citrus/websocket/endpoint/WebSocketConsumer.java#L72-L98
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/actions/AntRunAction.java
AntRunAction.parseTargets
private Stack<String> parseTargets() { Stack<String> stack = new Stack<String>(); String[] targetTokens = targets.split(","); for (String targetToken : targetTokens) { stack.add(targetToken.trim()); } return stack; }
java
private Stack<String> parseTargets() { Stack<String> stack = new Stack<String>(); String[] targetTokens = targets.split(","); for (String targetToken : targetTokens) { stack.add(targetToken.trim()); } return stack; }
[ "private", "Stack", "<", "String", ">", "parseTargets", "(", ")", "{", "Stack", "<", "String", ">", "stack", "=", "new", "Stack", "<", "String", ">", "(", ")", ";", "String", "[", "]", "targetTokens", "=", "targets", ".", "split", "(", "\",\"", ")", ...
Converts comma delimited string to stack. @return
[ "Converts", "comma", "delimited", "string", "to", "stack", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/AntRunAction.java#L133-L142
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/actions/AntRunAction.java
AntRunAction.loadBuildPropertyFile
private void loadBuildPropertyFile(Project project, TestContext context) { if (StringUtils.hasText(propertyFilePath)) { String propertyFileResource = context.replaceDynamicContentInString(propertyFilePath); log.info("Reading build property file: " + propertyFileResource); Properties fileProperties; try { fileProperties = PropertiesLoaderUtils.loadProperties(new PathMatchingResourcePatternResolver().getResource(propertyFileResource)); for (Entry<Object, Object> entry : fileProperties.entrySet()) { String propertyValue = entry.getValue() != null ? context.replaceDynamicContentInString(entry.getValue().toString()) : ""; if (log.isDebugEnabled()) { log.debug("Set build property from file resource: " + entry.getKey() + "=" + propertyValue); } project.setProperty(entry.getKey().toString(), propertyValue); } } catch (IOException e) { throw new CitrusRuntimeException("Failed to read build property file", e); } } }
java
private void loadBuildPropertyFile(Project project, TestContext context) { if (StringUtils.hasText(propertyFilePath)) { String propertyFileResource = context.replaceDynamicContentInString(propertyFilePath); log.info("Reading build property file: " + propertyFileResource); Properties fileProperties; try { fileProperties = PropertiesLoaderUtils.loadProperties(new PathMatchingResourcePatternResolver().getResource(propertyFileResource)); for (Entry<Object, Object> entry : fileProperties.entrySet()) { String propertyValue = entry.getValue() != null ? context.replaceDynamicContentInString(entry.getValue().toString()) : ""; if (log.isDebugEnabled()) { log.debug("Set build property from file resource: " + entry.getKey() + "=" + propertyValue); } project.setProperty(entry.getKey().toString(), propertyValue); } } catch (IOException e) { throw new CitrusRuntimeException("Failed to read build property file", e); } } }
[ "private", "void", "loadBuildPropertyFile", "(", "Project", "project", ",", "TestContext", "context", ")", "{", "if", "(", "StringUtils", ".", "hasText", "(", "propertyFilePath", ")", ")", "{", "String", "propertyFileResource", "=", "context", ".", "replaceDynamic...
Loads build properties from file resource and adds them to ANT project. @param project @param context
[ "Loads", "build", "properties", "from", "file", "resource", "and", "adds", "them", "to", "ANT", "project", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/actions/AntRunAction.java#L149-L169
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java
MessageSelectorBuilder.build
public static String build(String messageSelector, Map<String, Object> messageSelectorMap, TestContext context) { if (StringUtils.hasText(messageSelector)) { return context.replaceDynamicContentInString(messageSelector); } else if (!CollectionUtils.isEmpty(messageSelectorMap)) { return MessageSelectorBuilder.fromKeyValueMap( context.resolveDynamicValuesInMap(messageSelectorMap)).build(); } return ""; }
java
public static String build(String messageSelector, Map<String, Object> messageSelectorMap, TestContext context) { if (StringUtils.hasText(messageSelector)) { return context.replaceDynamicContentInString(messageSelector); } else if (!CollectionUtils.isEmpty(messageSelectorMap)) { return MessageSelectorBuilder.fromKeyValueMap( context.resolveDynamicValuesInMap(messageSelectorMap)).build(); } return ""; }
[ "public", "static", "String", "build", "(", "String", "messageSelector", ",", "Map", "<", "String", ",", "Object", ">", "messageSelectorMap", ",", "TestContext", "context", ")", "{", "if", "(", "StringUtils", ".", "hasText", "(", "messageSelector", ")", ")", ...
Build message selector from string expression or from key value map. Automatically replaces test variables. @param messageSelector @param messageSelectorMap @param context @return
[ "Build", "message", "selector", "from", "string", "expression", "or", "from", "key", "value", "map", ".", "Automatically", "replaces", "test", "variables", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java#L52-L61
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java
MessageSelectorBuilder.fromKeyValueMap
public static MessageSelectorBuilder fromKeyValueMap(Map<String, Object> valueMap) { StringBuffer buf = new StringBuffer(); Iterator<Entry<String, Object>> iter = valueMap.entrySet().iterator(); if (iter.hasNext()) { Entry<String, Object> entry = iter.next(); String key = entry.getKey(); String value = entry.getValue().toString(); buf.append(key + " = '" + value + "'"); } while (iter.hasNext()) { Entry<String, Object> entry = iter.next(); String key = entry.getKey(); String value = entry.getValue().toString(); buf.append(" AND " + key + " = '" + value + "'"); } return new MessageSelectorBuilder(buf.toString()); }
java
public static MessageSelectorBuilder fromKeyValueMap(Map<String, Object> valueMap) { StringBuffer buf = new StringBuffer(); Iterator<Entry<String, Object>> iter = valueMap.entrySet().iterator(); if (iter.hasNext()) { Entry<String, Object> entry = iter.next(); String key = entry.getKey(); String value = entry.getValue().toString(); buf.append(key + " = '" + value + "'"); } while (iter.hasNext()) { Entry<String, Object> entry = iter.next(); String key = entry.getKey(); String value = entry.getValue().toString(); buf.append(" AND " + key + " = '" + value + "'"); } return new MessageSelectorBuilder(buf.toString()); }
[ "public", "static", "MessageSelectorBuilder", "fromKeyValueMap", "(", "Map", "<", "String", ",", "Object", ">", "valueMap", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "Iterator", "<", "Entry", "<", "String", ",", "Object", ">...
Static builder method using a key value map. @param valueMap @return
[ "Static", "builder", "method", "using", "a", "key", "value", "map", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java#L77-L99
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java
MessageSelectorBuilder.toKeyValueMap
public Map<String, String> toKeyValueMap() { Map<String, String> valueMap = new HashMap<String, String>(); String[] tokens; if (selectorString.contains(" AND")) { String[] chunks = selectorString.split(" AND"); for (String chunk : chunks) { tokens = escapeEqualsFromXpathNodeTest(chunk).split("="); valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1)); } } else { tokens = escapeEqualsFromXpathNodeTest(selectorString).split("="); valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1)); } return valueMap; }
java
public Map<String, String> toKeyValueMap() { Map<String, String> valueMap = new HashMap<String, String>(); String[] tokens; if (selectorString.contains(" AND")) { String[] chunks = selectorString.split(" AND"); for (String chunk : chunks) { tokens = escapeEqualsFromXpathNodeTest(chunk).split("="); valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1)); } } else { tokens = escapeEqualsFromXpathNodeTest(selectorString).split("="); valueMap.put(unescapeEqualsFromXpathNodeTest(tokens[0].trim()), tokens[1].trim().substring(1, tokens[1].trim().length() -1)); } return valueMap; }
[ "public", "Map", "<", "String", ",", "String", ">", "toKeyValueMap", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "valueMap", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "String", "[", "]", "tokens", ";", "i...
Constructs a key value map from selector string representation. @return
[ "Constructs", "a", "key", "value", "map", "from", "selector", "string", "representation", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java#L105-L121
train
citrusframework/citrus
modules/citrus-core/src/main/java/com/consol/citrus/container/RepeatOnErrorUntilTrue.java
RepeatOnErrorUntilTrue.doAutoSleep
private void doAutoSleep() { if (autoSleep > 0) { log.info("Sleeping " + autoSleep + " milliseconds"); try { Thread.sleep(autoSleep); } catch (InterruptedException e) { log.error("Error during doc generation", e); } log.info("Returning after " + autoSleep + " milliseconds"); } }
java
private void doAutoSleep() { if (autoSleep > 0) { log.info("Sleeping " + autoSleep + " milliseconds"); try { Thread.sleep(autoSleep); } catch (InterruptedException e) { log.error("Error during doc generation", e); } log.info("Returning after " + autoSleep + " milliseconds"); } }
[ "private", "void", "doAutoSleep", "(", ")", "{", "if", "(", "autoSleep", ">", "0", ")", "{", "log", ".", "info", "(", "\"Sleeping \"", "+", "autoSleep", "+", "\" milliseconds\"", ")", ";", "try", "{", "Thread", ".", "sleep", "(", "autoSleep", ")", ";",...
Sleep amount of time in between iterations.
[ "Sleep", "amount", "of", "time", "in", "between", "iterations", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/container/RepeatOnErrorUntilTrue.java#L83-L95
train
citrusframework/citrus
modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsProducer.java
JmsProducer.send
private void send(Message message, String destinationName, TestContext context) { if (log.isDebugEnabled()) { log.debug("Sending JMS message to destination: '" + destinationName + "'"); } endpointConfiguration.getJmsTemplate().send(destinationName, session -> { javax.jms.Message jmsMessage = endpointConfiguration.getMessageConverter().createJmsMessage(message, session, endpointConfiguration, context); endpointConfiguration.getMessageConverter().convertOutbound(jmsMessage, message, endpointConfiguration, context); return jmsMessage; }); log.info("Message was sent to JMS destination: '" + destinationName + "'"); }
java
private void send(Message message, String destinationName, TestContext context) { if (log.isDebugEnabled()) { log.debug("Sending JMS message to destination: '" + destinationName + "'"); } endpointConfiguration.getJmsTemplate().send(destinationName, session -> { javax.jms.Message jmsMessage = endpointConfiguration.getMessageConverter().createJmsMessage(message, session, endpointConfiguration, context); endpointConfiguration.getMessageConverter().convertOutbound(jmsMessage, message, endpointConfiguration, context); return jmsMessage; }); log.info("Message was sent to JMS destination: '" + destinationName + "'"); }
[ "private", "void", "send", "(", "Message", "message", ",", "String", "destinationName", ",", "TestContext", "context", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Sending JMS message to destination: '\"", ...
Send message using destination name. @param message @param destinationName @param context
[ "Send", "message", "using", "destination", "name", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsProducer.java#L84-L96
train
citrusframework/citrus
modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsProducer.java
JmsProducer.send
private void send(Message message, Destination destination, TestContext context) { if (log.isDebugEnabled()) { log.debug("Sending JMS message to destination: '" + endpointConfiguration.getDestinationName(destination) + "'"); } endpointConfiguration.getJmsTemplate().send(destination, session -> { javax.jms.Message jmsMessage = endpointConfiguration.getMessageConverter().createJmsMessage(message, session, endpointConfiguration, context); endpointConfiguration.getMessageConverter().convertOutbound(jmsMessage, message, endpointConfiguration, context); return jmsMessage; }); log.info("Message was sent to JMS destination: '" + endpointConfiguration.getDestinationName(destination) + "'"); }
java
private void send(Message message, Destination destination, TestContext context) { if (log.isDebugEnabled()) { log.debug("Sending JMS message to destination: '" + endpointConfiguration.getDestinationName(destination) + "'"); } endpointConfiguration.getJmsTemplate().send(destination, session -> { javax.jms.Message jmsMessage = endpointConfiguration.getMessageConverter().createJmsMessage(message, session, endpointConfiguration, context); endpointConfiguration.getMessageConverter().convertOutbound(jmsMessage, message, endpointConfiguration, context); return jmsMessage; }); log.info("Message was sent to JMS destination: '" + endpointConfiguration.getDestinationName(destination) + "'"); }
[ "private", "void", "send", "(", "Message", "message", ",", "Destination", "destination", ",", "TestContext", "context", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "\"Sending JMS message to destination: '\"", ...
Send message using destination. @param message @param destination @param context
[ "Send", "message", "using", "destination", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-jms/src/main/java/com/consol/citrus/jms/endpoint/JmsProducer.java#L104-L116
train
citrusframework/citrus
modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java
CitrusDispatcherServlet.configureMessageController
protected void configureMessageController(ApplicationContext context) { if (context.containsBean(MESSAGE_CONTROLLER_BEAN_NAME)) { HttpMessageController messageController = context.getBean(MESSAGE_CONTROLLER_BEAN_NAME, HttpMessageController.class); EndpointAdapter endpointAdapter = httpServer.getEndpointAdapter(); HttpEndpointConfiguration endpointConfiguration = new HttpEndpointConfiguration(); endpointConfiguration.setMessageConverter(httpServer.getMessageConverter()); endpointConfiguration.setHeaderMapper(DefaultHttpHeaderMapper.inboundMapper()); endpointConfiguration.setHandleAttributeHeaders(httpServer.isHandleAttributeHeaders()); endpointConfiguration.setHandleCookies(httpServer.isHandleCookies()); endpointConfiguration.setDefaultStatusCode(httpServer.getDefaultStatusCode()); messageController.setEndpointConfiguration(endpointConfiguration); if (endpointAdapter != null) { messageController.setEndpointAdapter(endpointAdapter); } } }
java
protected void configureMessageController(ApplicationContext context) { if (context.containsBean(MESSAGE_CONTROLLER_BEAN_NAME)) { HttpMessageController messageController = context.getBean(MESSAGE_CONTROLLER_BEAN_NAME, HttpMessageController.class); EndpointAdapter endpointAdapter = httpServer.getEndpointAdapter(); HttpEndpointConfiguration endpointConfiguration = new HttpEndpointConfiguration(); endpointConfiguration.setMessageConverter(httpServer.getMessageConverter()); endpointConfiguration.setHeaderMapper(DefaultHttpHeaderMapper.inboundMapper()); endpointConfiguration.setHandleAttributeHeaders(httpServer.isHandleAttributeHeaders()); endpointConfiguration.setHandleCookies(httpServer.isHandleCookies()); endpointConfiguration.setDefaultStatusCode(httpServer.getDefaultStatusCode()); messageController.setEndpointConfiguration(endpointConfiguration); if (endpointAdapter != null) { messageController.setEndpointAdapter(endpointAdapter); } } }
[ "protected", "void", "configureMessageController", "(", "ApplicationContext", "context", ")", "{", "if", "(", "context", ".", "containsBean", "(", "MESSAGE_CONTROLLER_BEAN_NAME", ")", ")", "{", "HttpMessageController", "messageController", "=", "context", ".", "getBean"...
Post process message controller. @param context
[ "Post", "process", "message", "controller", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java#L97-L114
train
citrusframework/citrus
modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java
CitrusDispatcherServlet.configureMessageConverter
protected void configureMessageConverter(ApplicationContext context) { if (context.containsBean(MESSAGE_CONVERTER_BEAN_NAME)) { HttpMessageConverter messageConverter = context.getBean(MESSAGE_CONVERTER_BEAN_NAME, HttpMessageConverter.class); if (messageConverter instanceof DelegatingHttpEntityMessageConverter) { ((DelegatingHttpEntityMessageConverter) messageConverter).setBinaryMediaTypes(httpServer.getBinaryMediaTypes()); } } }
java
protected void configureMessageConverter(ApplicationContext context) { if (context.containsBean(MESSAGE_CONVERTER_BEAN_NAME)) { HttpMessageConverter messageConverter = context.getBean(MESSAGE_CONVERTER_BEAN_NAME, HttpMessageConverter.class); if (messageConverter instanceof DelegatingHttpEntityMessageConverter) { ((DelegatingHttpEntityMessageConverter) messageConverter).setBinaryMediaTypes(httpServer.getBinaryMediaTypes()); } } }
[ "protected", "void", "configureMessageConverter", "(", "ApplicationContext", "context", ")", "{", "if", "(", "context", ".", "containsBean", "(", "MESSAGE_CONVERTER_BEAN_NAME", ")", ")", "{", "HttpMessageConverter", "messageConverter", "=", "context", ".", "getBean", ...
Post process message converter. @param context
[ "Post", "process", "message", "converter", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java#L120-L128
train
citrusframework/citrus
modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java
CitrusDispatcherServlet.adaptInterceptors
private List<HandlerInterceptor> adaptInterceptors(List<Object> interceptors, ApplicationContext context) { List<HandlerInterceptor> handlerInterceptors = new ArrayList<HandlerInterceptor>(); if (context.containsBean(LOGGING_INTERCEPTOR_BEAN_NAME)) { LoggingHandlerInterceptor loggingInterceptor = context.getBean(LOGGING_INTERCEPTOR_BEAN_NAME, LoggingHandlerInterceptor.class); handlerInterceptors.add(loggingInterceptor); } if (interceptors != null) { for (Object interceptor : interceptors) { if (interceptor instanceof MappedInterceptor) { handlerInterceptors.add(new MappedInterceptorAdapter((MappedInterceptor)interceptor, new UrlPathHelper(), new AntPathMatcher())); } else if (interceptor instanceof HandlerInterceptor) { handlerInterceptors.add((HandlerInterceptor) interceptor); } else if (interceptor instanceof WebRequestInterceptor) { handlerInterceptors.add(new WebRequestHandlerInterceptorAdapter((WebRequestInterceptor) interceptor)); } else { log.warn("Unsupported interceptor type: {}", interceptor.getClass().getName()); } } } return handlerInterceptors; }
java
private List<HandlerInterceptor> adaptInterceptors(List<Object> interceptors, ApplicationContext context) { List<HandlerInterceptor> handlerInterceptors = new ArrayList<HandlerInterceptor>(); if (context.containsBean(LOGGING_INTERCEPTOR_BEAN_NAME)) { LoggingHandlerInterceptor loggingInterceptor = context.getBean(LOGGING_INTERCEPTOR_BEAN_NAME, LoggingHandlerInterceptor.class); handlerInterceptors.add(loggingInterceptor); } if (interceptors != null) { for (Object interceptor : interceptors) { if (interceptor instanceof MappedInterceptor) { handlerInterceptors.add(new MappedInterceptorAdapter((MappedInterceptor)interceptor, new UrlPathHelper(), new AntPathMatcher())); } else if (interceptor instanceof HandlerInterceptor) { handlerInterceptors.add((HandlerInterceptor) interceptor); } else if (interceptor instanceof WebRequestInterceptor) { handlerInterceptors.add(new WebRequestHandlerInterceptorAdapter((WebRequestInterceptor) interceptor)); } else { log.warn("Unsupported interceptor type: {}", interceptor.getClass().getName()); } } } return handlerInterceptors; }
[ "private", "List", "<", "HandlerInterceptor", ">", "adaptInterceptors", "(", "List", "<", "Object", ">", "interceptors", ",", "ApplicationContext", "context", ")", "{", "List", "<", "HandlerInterceptor", ">", "handlerInterceptors", "=", "new", "ArrayList", "<", "H...
Adapts object list to handler interceptors. @param interceptors @param context @return
[ "Adapts", "object", "list", "to", "handler", "interceptors", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/servlet/CitrusDispatcherServlet.java#L136-L160
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TransformActionBuilder.java
TransformActionBuilder.source
public TransformActionBuilder source(Resource xmlResource, Charset charset) { try { action.setXmlData(FileUtils.readToString(xmlResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read xml resource", e); } return this; }
java
public TransformActionBuilder source(Resource xmlResource, Charset charset) { try { action.setXmlData(FileUtils.readToString(xmlResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read xml resource", e); } return this; }
[ "public", "TransformActionBuilder", "source", "(", "Resource", "xmlResource", ",", "Charset", "charset", ")", "{", "try", "{", "action", ".", "setXmlData", "(", "FileUtils", ".", "readToString", "(", "xmlResource", ",", "charset", ")", ")", ";", "}", "catch", ...
Set the XML document as resource @param xmlResource the xmlResource to set @param charset
[ "Set", "the", "XML", "document", "as", "resource" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TransformActionBuilder.java#L83-L90
train
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TransformActionBuilder.java
TransformActionBuilder.xslt
public TransformActionBuilder xslt(Resource xsltResource, Charset charset) { try { action.setXsltData(FileUtils.readToString(xsltResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read xstl resource", e); } return this; }
java
public TransformActionBuilder xslt(Resource xsltResource, Charset charset) { try { action.setXsltData(FileUtils.readToString(xsltResource, charset)); } catch (IOException e) { throw new CitrusRuntimeException("Failed to read xstl resource", e); } return this; }
[ "public", "TransformActionBuilder", "xslt", "(", "Resource", "xsltResource", ",", "Charset", "charset", ")", "{", "try", "{", "action", ".", "setXsltData", "(", "FileUtils", ".", "readToString", "(", "xsltResource", ",", "charset", ")", ")", ";", "}", "catch",...
Set the XSLT document as resource @param xsltResource the xsltResource to set @param charset
[ "Set", "the", "XSLT", "document", "as", "resource" ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/TransformActionBuilder.java#L114-L122
train