public class LoggingContext
extends java.lang.Object
SaveLogRQ to multipart HTTP request to ReportPortal
Basic flow:
After start some test item (suite/test/step) context should be initialized with observable of
item ID and ReportPortal client.
Before actual finish of test item, context should be closed/completed.
Context consists of Flowable with buffering back-pressure strategy to be able
to batch incoming log messages into one request| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
| Modifier and Type | Method and Description |
|---|---|
static io.reactivex.Completable |
complete()
Completes context attached to the current thread
|
io.reactivex.Completable |
completed()
Marks flow as completed
|
void |
emit(java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
Emits log.
|
static LoggingContext |
init(io.reactivex.Maybe<java.lang.String> launchUuid,
io.reactivex.Maybe<java.lang.String> itemUuid,
ReportPortalClient client,
io.reactivex.Scheduler scheduler)
Initializes new logging context and attaches it to current thread
|
static LoggingContext |
init(io.reactivex.Maybe<java.lang.String> launchUuid,
io.reactivex.Maybe<java.lang.String> itemUuid,
ReportPortalClient client,
io.reactivex.Scheduler scheduler,
int bufferSize,
boolean convertImages)
Initializes new logging context and attaches it to current thread
|
public static final int DEFAULT_BUFFER_SIZE
public static LoggingContext init(io.reactivex.Maybe<java.lang.String> launchUuid, io.reactivex.Maybe<java.lang.String> itemUuid, ReportPortalClient client, io.reactivex.Scheduler scheduler)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextpublic static LoggingContext init(io.reactivex.Maybe<java.lang.String> launchUuid, io.reactivex.Maybe<java.lang.String> itemUuid, ReportPortalClient client, io.reactivex.Scheduler scheduler, int bufferSize, boolean convertImages)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextbufferSize - Size of back-pressure bufferconvertImages - Whether Image should be converted to BlackAndWhitepublic static io.reactivex.Completable complete()
public void emit(java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
logSupplier - Log Message Factory. Key if the function is actual test item IDpublic io.reactivex.Completable completed()
Completable