Skip to content

Commit

Permalink
Merge pull request #238 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Mar 14, 2024
2 parents 131f010 + df39c1a commit 1e9f4ab
Show file tree
Hide file tree
Showing 20 changed files with 534 additions and 14 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Changelog

## [Unreleased]
### Added
- `Description` annotation, by @HardNorth
- `DisplayName` annotation, by @HardNorth
- `TmsLink` and `TmsLinks` annotations, by @HardNorth
- `Issue` and `ExternalIssue` annotations, by @HardNorth
- `rp.bts.project`, `rp.bts.url`, `rp.bts.issue.url`, `rp.bts.issue.fail` properties, which controls these annotations, by @HardNorth
- `TestFilter`, `TestNameFilter`, `TestParamFilter` annotations to control Issue apply on Parameterized and Dynamic Tests, by @HardNorth
- `ReportPortalClient.getProjectSettings` method, by @HardNorth

## [5.2.5]
### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/client-java.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/client-java)
[![CI Build](https://github.com/reportportal/client-java/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/client-java/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/reportportal/client-java/branch/develop/graph/badge.svg?token=IVTys0o4JT)](https://codecov.io/gh/reportportal/client-java)
[![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/)
[![Join Slack chat!](https://img.shields.io/badge/slack-join-brightgreen.svg)](https://slack.epmrpp.reportportal.io/)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down
2 changes: 1 addition & 1 deletion README_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Maven Central](https://img.shields.io/maven-central/v/com.epam.reportportal/client-java.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.epam.reportportal/client-java)
[![CI Build](https://github.com/reportportal/client-java/actions/workflows/ci.yml/badge.svg)](https://github.com/reportportal/client-java/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/reportportal/client-java/branch/develop/graph/badge.svg?token=IVTys0o4JT)](https://codecov.io/gh/reportportal/client-java)
[![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/)
[![Join Slack chat!](https://img.shields.io/badge/slack-join-brightgreen.svg)](https://slack.epmrpp.reportportal.io/)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ dependencies {
exclude group: 'org.hamcrest'
}
testImplementation 'org.apache.commons:commons-io:1.3.2'
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.2'
testImplementation 'com.epam.reportportal:agent-java-test-utils:0.0.3'
}

test {
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/Description.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* If put on a method or constructor, or class, overrides or set corresponding Test Item description on ReportPortal.
* This annotation should be handled in priority to other mechanisms of existing test frameworks.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface Description {

/**
* Test Item description as a simple String.
*
* @return new description for a Test Item
*/
String value();
}
38 changes: 38 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/DisplayName.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* If put on a method or constructor, or class, overrides corresponding Test Item name on ReportPortal.
* This annotation should be handled in priority to other mechanisms of existing test frameworks.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface DisplayName {

/**
* Test Item name as a simple String.
*
* @return new name for a Test Item
*/
String value();
}
60 changes: 60 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/ExternalIssue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Link current Issue with an Issue posted in External Bug Tracking System. This annotation designed to use within {@link Issue} annotation
* only and does not allow to add it to any other target.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
public @interface ExternalIssue {
/**
* External System Issue ID
*
* @return Issue ID
*/
String value();

/**
* Optional, use custom Bug Tracking System URL instead of one which is set in `reportportal.properties` file.
*
* @return Bug Tracking System URL
*/
String btsUrl() default "";

/**
* Optional, use custom Bug Tracking System Project name instead of one which is set in `reportportal.properties` file.
*
* @return Bug Tracking System Project name
*/
String btsProject() default "";

/**
* Optional, use custom Bug Tracking System Issue URL pattern instead of one which is set in `reportportal.properties` file. Use
* <code>{issue_id}</code> mark to put it into the result URL.
*
* @return Bug Tracking System Issue URL pattern
*/
String urlPattern() default "";
}
60 changes: 60 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/Issue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.*;

/**
* This annotation supposed to automatically link failed test items a specific Issue on ReportPortal.
*/
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Repeatable(Issues.class)
public @interface Issue {
/**
* Type (Locator), Short Name (Abbreviation) or Long Name (Defect name) (specified by priority) of an Issue on ReportPortal for
* the current project. If there is no such issue found in Project Setting the value will be used "as is" and sent as
* Issue Type (Locator).
*
* @return Type (Locator), Short Name (Abbreviation) or Long Name (Defect name) of an Issue
*/
String value();

/**
* Arbitrary text describing the issue.
*
* @return issue description
*/
String comment() default "";

/**
* Links to External System where this issue is located.
*
* @return External Issue describing object
*/
ExternalIssue[] external() default {};

/**
* For Parameterized and Dynamic tests select certain test for Issue applying using filters by certain criteria. Each additional filter
* applies to the set of tests using logical "AND".
*
* @return filter list
*/
TestFilter[] filter() default {};
}
30 changes: 30 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/Issues.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.*;

/**
* Gathering annotation for {@link Issue}
*/
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Issues {
Issue[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@
import java.lang.annotation.Target;

/**
* Used in parametrized tests. ReportPortal waiting test parameters
* in <b>key - value</b> style. Using the annotation for method parameter
* Used in parametrized tests. ReportPortal waiting test parameters in <b>key - value</b> style. Using the annotation for method parameter
* the specific <b>key</b> can be provided.
*
* @author Pavel Bortnik
* @since ReportPortal Api v3.1.0
*/

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER })
public @interface ParameterKey {

/**
* Returns parameter key value
*
* @return key value
*/
String value() default "";

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Template configuration. Required for customizing representation of the parsed collections and arrays.
* {@link TemplateConfig#methodNameTemplate()} required to set the current method name template to be included in the result value to
* prevent situations when the method argument has the same name as a default {@link TemplateConfiguration#METHOD_NAME_TEMPLATE}
*
* <p>
* {@link TemplateConfig#selfNameTemplate()} required to set the current object name template to be included in the result value to
* prevent situations when the method argument has the same name as a default {@link TemplateConfiguration#SELF_NAME_TEMPLATE}
*/
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/TestFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Link current Issue with a specific Parameterized or Dynamic test by applying filters.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
public @interface TestFilter {

/**
* Specify Test Name filters to select certain test for {@link Issue} applying, suitable for dynamic tests.
*
* @return Test Name filters
*/
TestNameFilter[] name() default {};

/**
* Specify Test Parameter filters to select certain test for {@link Issue} applying, suitable for parameterized tests.
*
* @return Test Name filters
*/
TestParamFilter[] param() default {};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

/**
* Filter Test Set by Test Name.
*/
public @interface TestNameFilter {
/**
* Select a test which name starts with specified String.
*
* @return required prefix
*/
String startsWith() default "";

/**
* Select a test which name ends with specified String.
*
* @return required postfix
*/
String endsWith() default "";

/**
* Select a test which name should contain specified String.
*
* @return required contents
*/
String contains() default "";
}
Loading

0 comments on commit 1e9f4ab

Please sign in to comment.