-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Issue
and
ExternalIssue` annotations
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/com/epam/reportportal/annotations/ExternalIssue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* 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.*; | ||
|
||
/** | ||
* 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 ""; | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/com/epam/reportportal/annotations/Issue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* 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 }) | ||
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 {}; | ||
} |