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
Deprecated.
|
static int |
DEFAULT_LOG_BATCH_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.
|
void |
emit(io.reactivex.Maybe<java.lang.String> logItemUuid,
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 batchLogsSize,
boolean convertImages)
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,
ListenerParameters parameters)
Initializes new logging context and attaches it to current thread
|
public static final int DEFAULT_LOG_BATCH_SIZE
@Deprecated 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, ListenerParameters parameters)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextparameters - Report Portal client configuration parameterspublic 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 batchLogsSize, boolean convertImages)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextbatchLogsSize - Size of a log batchconvertImages - 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 void emit(io.reactivex.Maybe<java.lang.String> logItemUuid,
java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> logSupplier)
logItemUuid - Test Item ID promiselogSupplier - Log Message Factory. Key if the function is actual test item IDpublic io.reactivex.Completable completed()
Completable