Skip to content

Commit

Permalink
Client version update and TestNGService.buildFinishLaunchRq method
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 19, 2024
1 parent 44be957 commit 2f4a223
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased]
### Added
- `TestNGService.buildFinishLaunchRq` method to allow customization of launch finish request, by @HardNorth

### Changed
- Client version upgraded on [5.2.23](https://github.com/reportportal/client-java/releases/tag/5.2.23), by @HardNorth

## [5.4.4]
### Added
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repositories {
}

dependencies {
api 'com.epam.reportportal:client-java:5.2.20'
api 'com.epam.reportportal:client-java:5.2.23'

compileOnly "org.testng:testng:${testng_version}"
implementation 'org.slf4j:slf4j-api:2.0.4'
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/com/epam/reportportal/testng/TestNGService.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ public void startLaunch() {

@Override
public void finishLaunch() {
FinishExecutionRQ rq = new FinishExecutionRQ();
rq.setEndTime(Calendar.getInstance().getTime());
FinishExecutionRQ rq = buildFinishLaunchRq(launch.get().getParameters());
launch.get().finish(rq);
launch.reset();
Runtime.getRuntime().removeShutdownHook(shutDownHook);
Expand Down Expand Up @@ -608,6 +607,19 @@ protected StartLaunchRQ buildStartLaunchRq(ListenerParameters parameters) {
return rq;
}

/**
* Extension point to customize launch finishing event/request
*
* @param parameters Launch Configuration parameters
* @return Request to ReportPortal
*/
@SuppressWarnings("unused")
protected FinishExecutionRQ buildFinishLaunchRq(ListenerParameters parameters) {
FinishExecutionRQ rq = new FinishExecutionRQ();
rq.setEndTime(Calendar.getInstance().getTime());
return rq;
}

/**
* Extension point to customize test suite on it's finish
*
Expand Down

0 comments on commit 2f4a223

Please sign in to comment.