public class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utils.ArtifactType |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
assertIfSystemLogContains(CarbonLogReader carbonLogReader,
String expected)
Check if the log contains the expected string.
|
static boolean |
checkForLog(CarbonLogReader logReader,
String expected,
int timeout)
Check for the existence of the given log message.
|
static void |
deploySynapseConfiguration(org.apache.axiom.om.OMElement config,
String artifactName,
String artifactType,
boolean isRestartRequired) |
static void |
deploySynapseConfiguration(org.apache.axiom.om.OMElement config,
String artifactName,
Utils.ArtifactType type,
boolean isRestartRequired) |
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 boolean |
logExists(CarbonLogReader logReader,
String expected,
int timeout)
Checks if the expected string is available in the tailed logs of carbon log reader.
|
static void |
shutdownFailsafe(int port)
method to kill existing servers which are bind to the given port
|
static void |
undeploySynapseConfiguration(String artifactName,
String artifactType) |
static void |
undeploySynapseConfiguration(String artifactName,
String artifactType,
boolean restartServer) |
static void |
undeploySynapseConfiguration(String artifactName,
Utils.ArtifactType type,
boolean restartServer) |
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(CarbonLogReader carbonLogReader, String expected)
carbonLogReader - carbon log readerexpected - expected stringpublic static boolean logExists(CarbonLogReader logReader, String expected, int timeout) throws InterruptedException
logReader - Carbon log readerexpected - expected log stringtimeout - max time to do pollingInterruptedException - if interrupted while sleepingpublic static boolean checkForLog(CarbonLogReader logReader, String expected, int timeout) throws InterruptedException
logReader - Carbon log readerexpected - expected log stringtimeout - max time to do pollingInterruptedException - if interrupted while sleepingpublic 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 deploymentExceptionpublic static void deploySynapseConfiguration(org.apache.axiom.om.OMElement config,
String artifactName,
Utils.ArtifactType type,
boolean isRestartRequired)
throws IOException
IOExceptionpublic static void deploySynapseConfiguration(org.apache.axiom.om.OMElement config,
String artifactName,
String artifactType,
boolean isRestartRequired)
throws IOException
IOExceptionpublic static void undeploySynapseConfiguration(String artifactName, Utils.ArtifactType type, boolean restartServer)
public static void undeploySynapseConfiguration(String artifactName, String artifactType)
Copyright © 2019 WSO2. All rights reserved.