Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release #122

Merged
merged 7 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased]
### Changed
- Client version updated on [5.2.0](https://github.com/reportportal/client-java/releases/tag/5.2.0), by @HardNorth
- JUnit 5 dependency marked as `implementation` to force users specify their own versions, by @HardNorth
### Removed
- Deprecated code, by @HardNorth

## [5.1.11]
### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The repository contains [JUnit5 Extension](https://junit.org/junit5/docs/current

To start using ReportPortal with JUnit 5 create a service location file:
1. Create folders **_/META-INF/services_** in **_resources_**
2. Put there a file named **_org.junit.jupiter.api.extension.Extension_**ы
2. Put there a file named **_org.junit.jupiter.api.extension.Extension_**
3. Put a default implementation reference as a single row into the file: **_com.epam.reportportal.junit5.ReportPortalExtension_**

Example:
Expand Down Expand Up @@ -247,7 +247,7 @@ By this moment, your project tree should look somewhat like the this:

Go to *http:$IP_ADDRESS_OF_REPORT_PORTAL:8080* (by default it is *http://localhost:8080*)

Login as **Admin** user and create the project (more details [here](http://reportportal.io/docs/Deploy-ReportPortal) and [here](http://reportportal.io/docs/Creation-of-project))
Login as **Admin** user and create the project (more details [here](https://reportportal.io/docs/category/installation-steps) and [here](https://reportportal.io/docs/reportportal-configuration/CreationOfProjectAndAddingUsers/#create-a-project))

![RP. Add Project](integration_manual_files/step_add_project.png)

Expand Down
2 changes: 1 addition & 1 deletion README_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ By this moment, your project tree should look somewhat like the this:

Go to *http:$IP_ADDRESS_OF_REPORT_PORTAL:8080* (by default it is *http://localhost:8080*)

Login as **Admin** user and create the project (more details [here](http://reportportal.io/docs/Deploy-ReportPortal) and [here](http://reportportal.io/docs/Creation-of-project))
Login as **Admin** user and create the project (more details [here](https://reportportal.io/docs/category/installation-steps) and [here](https://reportportal.io/docs/reportportal-configuration/CreationOfProjectAndAddingUsers/#create-a-project))

![RP. Add Project](integration_manual_files/step_add_project.png)

Expand Down
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ repositories {
}

dependencies {
api 'com.epam.reportportal:client-java:5.1.24'
api 'com.epam.reportportal:client-java:5.2.1'
api 'com.google.code.findbugs:jsr305:3.0.2'
api "org.junit.jupiter:junit-jupiter-api:${junit_version}"

implementation "org.junit.jupiter:junit-jupiter-api:${junit_version}"
implementation 'org.slf4j:slf4j-api:2.0.7'

testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.2'
Expand All @@ -51,11 +51,12 @@ dependencies {
testImplementation 'org.aspectj:aspectjweaver:1.9.19'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:3.3.3'
testImplementation 'ch.qos.logback:logback-classic:1.3.8'
testImplementation ('com.epam.reportportal:logger-java-logback:5.1.5') {
testImplementation 'ch.qos.logback:logback-classic:1.3.12'
testImplementation ('com.epam.reportportal:logger-java-logback:5.2.0') {
exclude module: 'client-java'
}
testImplementation 'org.assertj:assertj-core:3.23.1'
testImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
}

test {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=5.1.12-SNAPSHOT
version=5.2.0-SNAPSHOT
description=JUnit5 integration for ReportPortal
junit_version=5.9.1
junit_runner_version=1.9.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ protected Optional<Maybe<String>> getItemId(@Nonnull ExtensionContext context) {
/**
* Finishes all launches for the JVM
*/
@SuppressWarnings("unused")
public void finish() {
new ArrayList<>(launchMap.keySet()).forEach(this::finish);
}
Expand Down Expand Up @@ -429,6 +430,7 @@ private void finishBeforeAfter(Invocation<Void> invocation, ExtensionContext con

private void finishBeforeAfter(ExtensionContext context, Maybe<String> id, ItemStatus status) {
Launch launch = getLaunch(context);
//noinspection ReactiveStreamsUnusedPublisher
launch.finishTestItem(id, buildFinishTestItemRq(context, status));
}

Expand Down Expand Up @@ -520,17 +522,6 @@ protected Maybe<String> startBeforeAfter(Method method, ExtensionContext parentC
.orElseGet(() -> launch.startTestItem(rq));
}

/**
* Finish a test template execution (basically a test class) with a specific status, builds a finish request based on the status
*
* @param context JUnit's test context
* @param status an {@link ItemStatus}
* @deprecated the method not in use anymore, use {@link #finishTemplate(ExtensionContext)}
*/
protected void finishTemplate(@Nonnull final ExtensionContext context, @Nullable final ItemStatus status) {
finishTemplate(context);
}

/**
* Finish a test template execution (basically a test class) with a specific status, builds a finish request based on the status
*
Expand All @@ -539,6 +530,7 @@ protected void finishTemplate(@Nonnull final ExtensionContext context, @Nullable
protected void finishTemplate(@Nonnull final ExtensionContext context) {
Launch launch = getLaunch(context);
Maybe<String> templateId = testTemplates.remove(context);
//noinspection ReactiveStreamsUnusedPublisher
launch.finishTestItem(templateId, buildFinishTestItemRq(context, null));
idMapping.remove(context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ private static ItemAttributesRQ skippedAnIssue(Boolean fromParams) {
}

static Set<ItemAttributesRQ> collectSystemAttributes(Boolean skippedAnIssue) {

Set<ItemAttributesRQ> systemAttributes = SystemAttributesExtractor.extract(AGENT_PROPERTIES, SystemAttributesFetcher.class.getClassLoader());
systemAttributes.add(skippedAnIssue(skippedAnIssue));
return systemAttributes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.epam.reportportal.junit5.features;

import com.epam.reportportal.service.ReportPortal;
import com.google.common.io.Files;
import com.google.common.io.Resources;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.*;
Expand Down Expand Up @@ -34,10 +32,7 @@ void initializeBaseClass() {
@Tag("tag2")
void baseClassTest() throws IOException {
// Report launch log
File file = File.createTempFile("rp-test", ".css");
Resources.asByteSource(Resources.getResource("files/css.css")).copyTo(Files.asByteSink(file));
ReportPortal.emitLaunchLog("LAUNCH LOG MESAGE WITH ATTACHMENT", "error", new Date(), file);

ReportPortal.emitLaunchLog("LAUNCH LOG MESAGE WITH ATTACHMENT", "error", new Date(), new File("files/css.css"));
System.out.println("base-class-test");
}

Expand All @@ -58,13 +53,13 @@ void parameterizedTestWithMethodSource(String value) {
}

@ParameterizedTest
@CsvSource({"first", "second", "third"})
@CsvSource({ "first", "second", "third" })
void parameterizedTestWithCsvSource(String value) {
System.out.println("parameterized-test-with-csv-source, parameter: " + value);
}

@ParameterizedTest
@EnumSource(value = DayOfWeek.class, names = {"MONDAY", "WEDNESDAY", "FRIDAY"})
@EnumSource(value = DayOfWeek.class, names = { "MONDAY", "WEDNESDAY", "FRIDAY" })
void parameterizedTestWithEnumSource(DayOfWeek day) {
System.out.println("parameterized-test-with-enum-source, parameter: " + day);
}
Expand All @@ -77,7 +72,7 @@ void parameterizedTestWithNullSource(String value) {

@ParameterizedTest
@NullSource
@ValueSource(strings = {"a", "b", "c"})
@ValueSource(strings = { "a", "b", "c" })
void parameterizedTestWithNullSourceAndValueSource(String value) {
System.out.println("parameterized-test-with-null-source-and-value-source, parameter: " + value);
}
Expand All @@ -90,15 +85,15 @@ void parameterizedTestWithEmptySource(String value) {

@ParameterizedTest
@EmptySource
@ValueSource(strings = {"a", "b", "c"})
@ValueSource(strings = { "a", "b", "c" })
void parameterizedTestWithEmptySourceAndValueSource(String value) {
System.out.println("parameterized-test-with-empty-source-and-value-source, parameter: " + value);
}

@ParameterizedTest
@NullSource
@EmptySource
@ValueSource(strings = {"a", "b", "c"})
@ValueSource(strings = { "a", "b", "c" })
void parameterizedTestWithNullSourceAndEmptySourceAndValueSource(String value) {
System.out.println("parameterized-test-with-null-source-empty-source-and-value-source, parameter: " + value);
}
Expand All @@ -111,55 +106,55 @@ void parameterizedTestWithNullAndEmptySource(String value) {

@ParameterizedTest
@NullAndEmptySource
@ValueSource(strings = {"a", "b", "c"})
@ValueSource(strings = { "a", "b", "c" })
void parameterizedTestWithNullAndEmptySourceAndValueSource(String value) {
System.out.println("parameterized-test-with-null-and-empty-source-and-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(floats = {1.1f, 2.2f, 3.3f})
@ValueSource(floats = { 1.1f, 2.2f, 3.3f })
void parameterizedTestWithFloatsValueSource(float value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(ints = {1, 2, 3})
@ValueSource(ints = { 1, 2, 3 })
void parameterizedTestWithIntValueSource(int value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(shorts = {1, 2, 3})
@ValueSource(shorts = { 1, 2, 3 })
void parameterizedTestWithShortsValueSource(short value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(bytes = {1, 2, 3})
@ValueSource(bytes = { 1, 2, 3 })
void parameterizedTestWithBytesValueSource(byte value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(chars = {'a', 'b', 'c'})
@ValueSource(chars = { 'a', 'b', 'c' })
void parameterizedTestWithCharsValueSource(char value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(doubles = {1.1, 2.2, 3.3})
@ValueSource(doubles = { 1.1, 2.2, 3.3 })
void parameterizedTestWithDoublesValueSource(double value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(longs = {1147483648L, 2147483648L, 3147483648L})
@ValueSource(longs = { 1147483648L, 2147483648L, 3147483648L })
void parameterizedTestWithLongsValueSource(long value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}

@ParameterizedTest
@ValueSource(strings = {"a", "b", "c"})
@ValueSource(strings = { "a", "b", "c" })
void parameterizedTestWithStringsValueSource(String value) {
System.out.println("parameterized-test-with-value-source, parameter: " + value);
}
Expand Down