public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
assertIfSystemLogContains(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String expected)
Check if the system log contains the expected string.
|
static boolean |
checkForLog(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String expected,
int timeout)
Check for the existence of the given log message.
|
static boolean |
checkForLogsWithPriority(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String priority,
String expected,
int timeout)
Check for the existence of a given log message of given priority within the given timeout
|
static org.apache.axiom.om.OMElement |
getCustomPayload(String symbol) |
static org.apache.axiom.om.OMElement |
getCustomQuoteRequest(String symbol) |
static org.apache.axiom.om.OMElement |
getIncorrectRequest(String stringValue) |
static org.apache.axiom.om.OMElement |
getSimpleQuoteRequest(String symbol) |
static org.apache.axiom.om.OMElement |
getStockQuoteRequest(String symbol) |
static boolean |
isCarFileDeployed(String carFileName,
org.wso2.carbon.integration.common.admin.client.ApplicationAdminClient applicationAdminClient,
int timeout)
Util function to check whether specified car file is deployed
|
static boolean |
isQueueEmpty(String queueName)
Check if the given queue does not contain any messages
|
static void |
shutdownFailsafe(int port)
method to kill existing servers which are bind to the given port
|
static boolean |
waitForMessageCount(MessageStoreAdminClient messageStoreAdminClient,
String messageStoreName,
int expectedCount,
long timeout)
Wait for expected message count found in the message store until a defined timeout
|
public static org.apache.axiom.om.OMElement getSimpleQuoteRequest(String symbol)
public static org.apache.axiom.om.OMElement getCustomQuoteRequest(String symbol)
public static org.apache.axiom.om.OMElement getStockQuoteRequest(String symbol)
public static org.apache.axiom.om.OMElement getIncorrectRequest(String stringValue)
public static org.apache.axiom.om.OMElement getCustomPayload(String symbol)
public static void shutdownFailsafe(int port)
throws IOException
port - IOExceptionpublic static boolean isQueueEmpty(String queueName) throws Exception
queueName - queue to be checkedException - if error while checkingpublic static boolean assertIfSystemLogContains(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String expected)
throws RemoteException,
org.wso2.carbon.logging.view.stub.LogViewerLogViewerException
logViewerClient - log viewer used for testexpected - expected stringRemoteException - due to a logviewer errororg.wso2.carbon.logging.view.stub.LogViewerLogViewerException - due to a logviewer errorpublic static boolean checkForLog(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String expected,
int timeout)
throws InterruptedException,
RemoteException,
org.wso2.carbon.logging.view.stub.LogViewerLogViewerException
logViewerClient - log viewer used for testexpected - expected log stringtimeout - max time to do polling in secondsInterruptedException - if interrupted while sleepingRemoteException - due to a logviewer errororg.wso2.carbon.logging.view.stub.LogViewerLogViewerException - due to a logviewer errorpublic static boolean checkForLogsWithPriority(org.wso2.carbon.integration.common.admin.client.LogViewerClient logViewerClient,
String priority,
String expected,
int timeout)
throws InterruptedException,
org.wso2.carbon.logging.view.stub.LogViewerLogViewerException,
RemoteException
logViewerClient - LogViewerClient objectpriority - priority levelexpected - expected string to search in logstimeout - timeout value in secondsInterruptedExceptionorg.wso2.carbon.logging.view.stub.LogViewerLogViewerExceptionRemoteExceptionpublic static boolean waitForMessageCount(MessageStoreAdminClient messageStoreAdminClient, String messageStoreName, int expectedCount, long timeout) throws InterruptedException, RemoteException
messageStoreName - Message store nameexpectedCount - Expected message counttimeout - Timeout to wait in MillisecondsInterruptedExceptionRemoteExceptionpublic static boolean isCarFileDeployed(String carFileName, org.wso2.carbon.integration.common.admin.client.ApplicationAdminClient applicationAdminClient, int timeout) throws Exception
carFileName - - Name of the car file to deployapplicationAdminClient - - Application admin clienttimeout - - timeout for car deploymentExceptionCopyright © 2018 WSO2. All rights reserved.