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
|
static LoggingContext |
context()
Return current logging context attached to the current thread.
|
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
|
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,
io.reactivex.FlowableSubscriber<com.epam.ta.reportportal.ws.model.BatchSaveOperatingRS> loggingSubscriber)
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
@Nullable public static LoggingContext context()
@Nonnull public static LoggingContext init(@Nonnull io.reactivex.Maybe<java.lang.String> launchUuid, @Nullable io.reactivex.Maybe<java.lang.String> itemUuid, @Nonnull ReportPortalClient client, @Nonnull io.reactivex.Scheduler scheduler, @Nonnull ListenerParameters parameters, @Nonnull io.reactivex.FlowableSubscriber<com.epam.ta.reportportal.ws.model.BatchSaveOperatingRS> loggingSubscriber)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextparameters - ReportPortal client configuration parametersloggingSubscriber - RxJava subscriber on logging results@Nonnull public static LoggingContext init(@Nonnull io.reactivex.Maybe<java.lang.String> launchUuid, @Nullable io.reactivex.Maybe<java.lang.String> itemUuid, @Nonnull ReportPortalClient client, @Nonnull io.reactivex.Scheduler scheduler, @Nonnull ListenerParameters parameters)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContextparameters - ReportPortal client configuration parameters@Nonnull public static LoggingContext init(@Nonnull io.reactivex.Maybe<java.lang.String> launchUuid, @Nullable io.reactivex.Maybe<java.lang.String> itemUuid, @Nonnull ReportPortalClient client, @Nonnull 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 BlackAndWhite@Nonnull public static LoggingContext init(@Nonnull io.reactivex.Maybe<java.lang.String> launchUuid, @Nullable io.reactivex.Maybe<java.lang.String> itemUuid, @Nonnull ReportPortalClient client, @Nonnull io.reactivex.Scheduler scheduler)
launchUuid - a UUID of a LaunchitemUuid - a Test Item UUIDclient - Client of ReportPortalscheduler - a Scheduler to use with this LoggingContext@Nonnull public static io.reactivex.Completable complete()
public void emit(@Nonnull
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(@Nonnull
io.reactivex.Maybe<java.lang.String> logItemUuid,
@Nonnull
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 ID@Nonnull public io.reactivex.Completable completed()
Completable