public class CarbonLogReader extends Object
| Constructor and Description |
|---|
CarbonLogReader() |
CarbonLogReader(boolean startReadingFromEndOfFile)
Class initializer.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
assertIfLogExists(String expected)
Check for the existence of the given log message.
|
boolean |
assertIfLogExists(String expected,
int numberofOccurrences)
Check for the existence of occurrences of a given log message.
|
boolean |
checkForLog(String expected,
int timeout)
Check for the existence of the given log message.
|
boolean |
checkForLog(String expected,
int timeout,
int numberofOccurrences)
Check for the existence of the given log message occurrences.
|
void |
clearLogs()
Clears the tail log container.
|
String |
getLogs()
Get the tailed logs from the start until now.
|
int |
getNumberOfOccurencesForLog(String expected)
Check for the existence of the given log message occurrences.
|
String |
getSubstringBetweenStrings(String startWith,
String endWith,
int timeout)
Returns the substring between the given start and end substrings.
|
void |
start()
Start tailer thread.
|
void |
stop()
Stops the thread which started tailing the logs.
|
public CarbonLogReader()
public CarbonLogReader(boolean startReadingFromEndOfFile)
startReadingFromEndOfFile - - specify whether you want to tail from the end of file or not.public void start()
public String getLogs()
public void clearLogs()
public void stop()
public boolean assertIfLogExists(String expected)
expected - expected log stringpublic boolean assertIfLogExists(String expected, int numberofOccurrences)
expected - expected log stringnumberofOccurrences - numberofOccurrences expected number of log occurrencespublic String getSubstringBetweenStrings(String startWith, String endWith, int timeout) throws InterruptedException
startWith - starting substringendWith - ending substringtimeout - max time to poll in secondsInterruptedException - if interrupted while sleepingpublic boolean checkForLog(String expected, int timeout) throws InterruptedException
expected - expected log stringtimeout - max time to do polling in secondsInterruptedException - if interrupted while sleepingpublic boolean checkForLog(String expected, int timeout, int numberofOccurrences) throws InterruptedException
expected - expected log messagetimeout - max time to poll in secondsnumberofOccurrences - expected number of log occurrencesInterruptedException - if interrupted while sleepingpublic int getNumberOfOccurencesForLog(String expected) throws InterruptedException
expected - expected log messageInterruptedException - if interrupted while sleepingCopyright © 2019 WSO2. All rights reserved.