Package com.epam.reportportal.service
Class ReportPortal
- java.lang.Object
-
- com.epam.reportportal.service.ReportPortal
-
public class ReportPortal extends java.lang.ObjectDefault ReportPortal Reporter implementation. UsesRetrofitas REST WS Client
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classReportPortal.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReportPortal.Builderbuilder()Creates new builder forReportPortalstatic ReportPortalcreate(ReportPortalClient client, ListenerParameters params)Creates new ReportPortal based on already built dependenciesstatic ReportPortalcreate(ReportPortalClient client, ListenerParameters params, java.util.concurrent.ExecutorService executor)Creates new ReportPortal based on already built dependenciesstatic booleanemitLaunchLog(ReportPortalMessage message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emit log message to the current Launch.static booleanemitLaunchLog(ReportPortalMessage message, java.lang.String level, java.util.Date time)Emit log message to the current Launch.static booleanemitLaunchLog(java.lang.String message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emits log message on Launch level if there is any active context attached to the current threadstatic booleanemitLaunchLog(java.lang.String message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time, java.io.File file)Emits log message on Launch level if there is any active context attached to the current threadstatic booleanemitLaunchLog(java.lang.String message, java.lang.String level, java.util.Date time)Emits log message on Launch level if there is any active context attached to the current threadstatic booleanemitLaunchLog(java.lang.String message, java.lang.String level, java.util.Date time, java.io.File file)Emits log message on Launch level if there is any active context attached to the current threadstatic booleanemitLaunchLog(java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)Emits log message on Launch level if there is any active context attached to the current threadstatic booleanemitLog(ReportPortalMessage message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emit log message to the current test item.static booleanemitLog(ReportPortalMessage message, java.lang.String level, java.util.Date time)Emit log message to the current test item.static booleanemitLog(io.reactivex.Maybe<java.lang.String> itemUuid, java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)Emits log message if there is any active context attached to the current threadstatic booleanemitLog(java.lang.String message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emits log message if there is any active context attached to the current threadstatic booleanemitLog(java.lang.String message, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time, java.io.File file)Emits log message if there is any active context attached to the current threadstatic booleanemitLog(java.lang.String message, java.lang.String level, java.util.Date time)Emits log message if there is any active context attached to the current threadstatic booleanemitLog(java.lang.String message, java.lang.String level, java.util.Date time, java.io.File file)Emits log message if there is any active context attached to the current threadstatic booleanemitLog(java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)Emits log message if there is any active context attached to the current threadReportPortalClientgetClient()ListenerParametersgetParameters()LaunchnewLaunch(StartLaunchRQ rq)Starts launch in ReportPortalstatic voidsendStackTraceToRP(java.lang.Throwable cause)Formats and reports aThrowableto ReportPortalstatic SaveLogRQtoSaveLogRQ(java.lang.String launchUuid, java.lang.String itemUuid, java.lang.String level, java.lang.Comparable<? extends java.lang.Comparable<?>> time, ReportPortalMessage message)ConvertsReportPortalMessagetoSaveLogRQ.LaunchwithLaunch(io.reactivex.Maybe<java.lang.String> launchUuid)Factory method forReportPortalthat uses already started launch
-
-
-
Method Detail
-
newLaunch
@Nonnull public Launch newLaunch(@Nonnull StartLaunchRQ rq)
Starts launch in ReportPortal- Parameters:
rq- Request Data- Returns:
- Launch
-
withLaunch
@Nonnull public Launch withLaunch(@Nonnull io.reactivex.Maybe<java.lang.String> launchUuid)
Factory method forReportPortalthat uses already started launch- Parameters:
launchUuid- Launch to be used- Returns:
- This instance for chaining
-
getParameters
@Nonnull public ListenerParameters getParameters()
- Returns:
- Configuration parameters
-
getClient
@Nullable public ReportPortalClient getClient()
- Returns:
- ReportPortal client
-
builder
@Nonnull public static ReportPortal.Builder builder()
Creates new builder forReportPortal- Returns:
- builder for
ReportPortal
-
create
@Nonnull public static ReportPortal create(ReportPortalClient client, ListenerParameters params)
Creates new ReportPortal based on already built dependencies- Parameters:
client- ReportPortal Clientparams-ListenerParameters- Returns:
- builder for
ReportPortal
-
create
@Nonnull public static ReportPortal create(@Nonnull ReportPortalClient client, @Nonnull ListenerParameters params, @Nonnull java.util.concurrent.ExecutorService executor)
Creates new ReportPortal based on already built dependencies- Parameters:
client- ReportPortal Clientparams-ListenerParametersexecutor- An executor service which will be used for internal request / response queue- Returns:
- builder for
ReportPortal
-
emitLog
public static boolean emitLog(java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)
Emits log message if there is any active context attached to the current thread- Parameters:
logSupplier- Log supplier. Converts current Item ID to theSaveLogRQobject- Returns:
- true if log has been emitted
-
emitLaunchLog
public static boolean emitLaunchLog(java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)
Emits log message on Launch level if there is any active context attached to the current thread- Parameters:
logSupplier- Log supplier. Converts current Item ID to theSaveLogRQobject- Returns:
- true if log has been emitted
-
emitLog
public static boolean emitLog(io.reactivex.Maybe<java.lang.String> itemUuid, java.util.function.Function<java.lang.String,SaveLogRQ> logSupplier)Emits log message if there is any active context attached to the current thread- Parameters:
itemUuid- Test Item ID promiselogSupplier- Log supplier. Converts current Item ID to theSaveLogRQobject- Returns:
- true if log has been emitted
-
emitLog
public static boolean emitLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emits log message if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log time- Returns:
- true if log has been emitted
-
emitLog
public static boolean emitLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.util.Date time)Emits log message if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log time- Returns:
- true if log has been emitted
-
emitLaunchLog
public static boolean emitLaunchLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time)Emits log message on Launch level if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log time- Returns:
- true if log has been emitted
-
emitLaunchLog
public static boolean emitLaunchLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.util.Date time)Emits log message on Launch level if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log time- Returns:
- true if log has been emitted
-
toSaveLogRQ
@Nonnull public static SaveLogRQ toSaveLogRQ(@Nullable java.lang.String launchUuid, @Nullable java.lang.String itemUuid, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time, @Nonnull ReportPortalMessage message)
ConvertsReportPortalMessagetoSaveLogRQ.- Parameters:
launchUuid- a UUID of the launchitemUuid- a UUID of the test itemlevel- message leveltime- timestamp of the messagemessage- an object to convert- Returns:
- converted object
-
emitLog
public static boolean emitLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time, java.io.File file)Emits log message if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log timefile- a file to attach to the log message- Returns:
- true if log has been emitted
-
emitLog
public static boolean emitLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.util.Date time, java.io.File file)Emits log message if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log timefile- a file to attach to the log message- Returns:
- true if log has been emitted
-
emitLaunchLog
public static boolean emitLaunchLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time, java.io.File file)Emits log message on Launch level if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log timefile- a file to attach to the log message- Returns:
- true if log has been emitted
-
emitLaunchLog
public static boolean emitLaunchLog(@Nullable java.lang.String message, @Nullable java.lang.String level, @Nonnull java.util.Date time, java.io.File file)Emits log message on Launch level if there is any active context attached to the current thread- Parameters:
message- Log messagelevel- Log leveltime- Log timefile- a file to attach to the log message- Returns:
- true if log has been emitted
-
emitLog
public static boolean emitLog(ReportPortalMessage message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time)
Emit log message to the current test item.- Parameters:
message- an instance of the messagelevel- message leveltime- timestamp of the message- Returns:
- true if log has been emitted otherwise false
-
emitLog
public static boolean emitLog(ReportPortalMessage message, @Nullable java.lang.String level, @Nonnull java.util.Date time)
Emit log message to the current test item.- Parameters:
message- an instance of the messagelevel- message leveltime- timestamp of the message- Returns:
- true if log has been emitted otherwise false
-
emitLaunchLog
public static boolean emitLaunchLog(ReportPortalMessage message, @Nullable java.lang.String level, @Nonnull java.lang.Comparable<? extends java.lang.Comparable<?>> time)
Emit log message to the current Launch.- Parameters:
message- an instance of the messagelevel- message leveltime- timestamp of the message- Returns:
- true if log has been emitted otherwise false
-
emitLaunchLog
public static boolean emitLaunchLog(ReportPortalMessage message, @Nullable java.lang.String level, @Nonnull java.util.Date time)
Emit log message to the current Launch.- Parameters:
message- an instance of the messagelevel- message leveltime- timestamp of the message- Returns:
- true if log has been emitted otherwise false
-
sendStackTraceToRP
public static void sendStackTraceToRP(java.lang.Throwable cause)
Formats and reports aThrowableto ReportPortal- Parameters:
cause- aThrowable
-
-