Skip to content

Commit

Permalink
Issue filter annotations javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Feb 23, 2024
1 parent 56ad095 commit dee6202
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/main/java/com/epam/reportportal/annotations/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
ExternalIssue[] external() default {};

/**
* For Parameterized and Dynamic tests apply current issue to specific test filtered by certain criteria.
* 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
*/
Expand Down
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 "";

}
12 changes: 12 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/TestFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,19 @@
@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
Expand Up @@ -20,7 +20,24 @@
* 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 "";
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,58 @@
* Filter Test Set by Parameter.
*/
public @interface TestParamFilter {
/**
* Parameter index to which this filter should be applied. If it's not specified then the filter try to match every parameter.
*
* @return parameter index
*/
int paramIndex() default -1;

/**
* Select a test parameter which name starts with specified String. Designed to use with {@link ParameterKey} annotation, since there is
* no parameters names in Java runtime.
*
* @return required prefix
*/
String nameStartsWith() default "";

/**
* Select a test parameter which name ends with specified String. Designed to use with {@link ParameterKey} annotation, since there is
* no parameters names in Java runtime.
*
* @return required prefix
*/
String nameEndsWith() default "";

/**
* Select a test parameter which name should contain specified String. Designed to use with {@link ParameterKey} annotation, since there
* is no parameters names in Java runtime.
*
* @return required prefix
*/
String nameContains() default "";

/**
* Select a test parameter which value starts with specified String. Non-string parameter values convert with {@link Object#toString()},
* method.
*
* @return required prefix
*/
String valueStartsWith() default "";

/**
* Select a test parameter which value ends with specified String. Non-string parameter values convert with {@link Object#toString()},
* method.
*
* @return required prefix
*/
String valueEndsWith() default "";

/**
* Select a test parameter which value should contain specified String. Non-string parameter values convert with
* {@link Object#toString()}, method.
*
* @return required prefix
*/
String valueContains() default "";
}

0 comments on commit dee6202

Please sign in to comment.