public class ServiceBusInterface extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ServiceBusInterface.SBEnv |
| Modifier and Type | Field and Description |
|---|---|
static String |
MESSAGE_ID_PREFIX |
static Map<com.microsoft.azure.servicebus.IMessage,Boolean> |
outboundMessages |
static Map<String,core.apiCore.interfaces.ServiceBusInterface.serviceBus> |
sbInstance |
| Constructor and Description |
|---|
ServiceBusInterface() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addMessages(String hostSelector,
Collection<com.microsoft.azure.servicebus.IMessage> msgFromOutboundQueue)
add message from outbound to message list, including the time of adding the
message boolean value added indicating the message is available to be
verified
|
static boolean |
compareExpected(String outboundQueueMsg,
String expStr)
compares outbound queue message to expected message
|
static boolean |
compareNotExpected(String outboundQueueMsg,
String notExpStr) |
static String |
comparePartialExpected(String outboundQueueMsg,
com.microsoft.azure.servicebus.IMessage msgFromOutboundQueue,
com.microsoft.azure.servicebus.IMessageReceiver receiver,
String partialExpStr)
compares outbound queue message to partially expected message
|
static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> |
FilterBasedOnIdentifierInExpectedMessages(String hostSelector,
String key,
String partialExpStr)
find the identifier value in the expected messages eg.
|
static Collection<com.microsoft.azure.servicebus.IMessage> |
filterOUtboundMessage(String hostSelector,
String requestBody,
String partialExpStr,
Collection<com.microsoft.azure.servicebus.IMessage> msgFromOutboundQueue,
String msgId)
filter outbound messages based on messageId, order number or useId/bu if
message comes from service bus And has request body, Then match message id if
not from service bus, try to match either order number or user id/bu
|
static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> |
findMessages(String hostSelector,
String requestIdentifier) |
static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> |
findMessagesNotContaining(String hostSelector,
String requestIdentifier)
finds message in outbound that do not contain the specified identifier
matching is done with lower case
|
static String |
generateMessageId(String requestBody)
generate message id if the request body is set
|
static int |
getExpectedMessageCount(String partialExpStr) |
static core.apiCore.interfaces.ServiceBusInterface.serviceBus |
getInstance(String host)
getting an instance of service bus retrying And catching interrupt exceptions
from other threads
|
static Collection<com.microsoft.azure.servicebus.IMessage> |
getOutboundMessages(com.microsoft.azure.servicebus.IMessageReceiver receiver)
gets message from outbound queue
|
static com.microsoft.azure.servicebus.IMessageReceiver |
getReceiver(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
String hostSelector)
format:
host: Host1
gets the receiver based on the host from hashmap
|
static String |
getRequestBodyFromTemplate(String requestBody,
String templateFile,
String contentType)
gets the request body from the template file
|
static boolean |
isEmptyResultsExpectedAndVerified(Collection<com.microsoft.azure.servicebus.IMessage> filteredMessages,
String partialExpStr)
returns true if
|
static boolean |
isFromCurrentTest(String outboundQueueMsg) |
static boolean |
isNoResponseExpected(String outputParams,
String partialExpStr) |
static boolean |
isNoResponseExpected(String outboundQueueMsg,
String outputParams,
String partialExpStr) |
static boolean |
isNumeric(String str)
returns true if string is an int
|
static boolean |
isPartialExpect(String partialExpStr,
boolean isPartialExpStr) |
static long |
logPerInterval(int interval,
StopWatchHelper watch,
long lastLogged) |
static boolean |
noCheckNeeded(String expStrContent)
Returns true if content is empty or contains the noCheckNeeded token
|
static void |
purgeOutboundQueues()
Purge by type.
|
static void |
purgeQueues()
Disabled, due to parallelization optimization.
|
static boolean |
receiveAndVerifyOutboundMessage(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
String msgId,
String options,
String requestBody,
String outputParams,
String partialExpStr) |
static void |
sendMessage(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
com.microsoft.azure.servicebus.IMessage msgToInboundQueue)
sends message to inbound queue
|
static void |
sendMessage(String requestBody,
core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
String msgID)
sends message through service bus
|
static void |
testServiceBus(ServiceObject apiObject)
Inject message to inbound queue And dequeues from outbound queue And do
comparisons
|
public static final String MESSAGE_ID_PREFIX
public static Map<String,core.apiCore.interfaces.ServiceBusInterface.serviceBus> sbInstance
public static core.apiCore.interfaces.ServiceBusInterface.serviceBus getInstance(String host)
type - public static void testServiceBus(ServiceObject apiObject)
type - contentType - attachmentReady - hostSelector - templateFile - requestBody - expStr - outputParams - partialExpStr - notExpStr - public static String generateMessageId(String requestBody)
requestBody - public static void sendMessage(String requestBody, core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus, String msgID)
requestBody - serviceBus - public static String getRequestBodyFromTemplate(String requestBody, String templateFile, String contentType)
requestBody - templateFile - contentType - public static com.microsoft.azure.servicebus.IMessageReceiver getReceiver(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
String hostSelector)
serviceBus - options - public static boolean receiveAndVerifyOutboundMessage(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
String msgId,
String options,
String requestBody,
String outputParams,
String partialExpStr)
public static int getExpectedMessageCount(String partialExpStr)
public static long logPerInterval(int interval,
StopWatchHelper watch,
long lastLogged)
public static boolean isEmptyResultsExpectedAndVerified(Collection<com.microsoft.azure.servicebus.IMessage> filteredMessages, String partialExpStr)
filteredMessages - expStr - partialExpStr - notExpStr - public static boolean isNoResponseExpected(String outboundQueueMsg, String outputParams, String partialExpStr)
public static boolean isNoResponseExpected(String outputParams, String partialExpStr)
public static boolean noCheckNeeded(String expStrContent)
expStrContent - public static Collection<com.microsoft.azure.servicebus.IMessage> filterOUtboundMessage(String hostSelector, String requestBody, String partialExpStr, Collection<com.microsoft.azure.servicebus.IMessage> msgFromOutboundQueue, String msgId)
requestBody - expStr - partialExpStr - notExpStr - msgFromOutboundQueue - msgId - public static void addMessages(String hostSelector, Collection<com.microsoft.azure.servicebus.IMessage> msgFromOutboundQueue)
msgFromOutboundQueue - public static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> FilterBasedOnIdentifierInExpectedMessages(String hostSelector, String key, String partialExpStr)
key - expStr - partialExpStr - notExpStr - public static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> findMessages(String hostSelector, String requestIdentifier)
public static CopyOnWriteArrayList<com.microsoft.azure.servicebus.IMessage> findMessagesNotContaining(String hostSelector, String requestIdentifier)
requestIdentifier - public static boolean isNumeric(String str)
str - public static boolean isFromCurrentTest(String outboundQueueMsg)
public static void sendMessage(core.apiCore.interfaces.ServiceBusInterface.serviceBus serviceBus,
com.microsoft.azure.servicebus.IMessage msgToInboundQueue)
serviceBus - msgToInboundQueue - public static Collection<com.microsoft.azure.servicebus.IMessage> getOutboundMessages(com.microsoft.azure.servicebus.IMessageReceiver receiver)
receiver - public static boolean compareExpected(String outboundQueueMsg, String expStr)
outboundQueueMsg - expStr - public static boolean isPartialExpect(String partialExpStr, boolean isPartialExpStr)
public static String comparePartialExpected(String outboundQueueMsg, com.microsoft.azure.servicebus.IMessage msgFromOutboundQueue, com.microsoft.azure.servicebus.IMessageReceiver receiver, String partialExpStr)
outboundQueueMsg - msgFromOutboundQueue - receiver - outputParams - partialExpStr - public static boolean compareNotExpected(String outboundQueueMsg, String notExpStr)
public static void purgeQueues()
public static void purgeOutboundQueues()
Copyright © 2019. All rights reserved.