Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## [Unreleased]
### Added
- `AttributeParser.retrieveAttributes(Executable)` method, by @HardNorth
### Changed
- Attribute annotations and their extraction improved, by @HardNorth

## [5.4.7]
### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@

package com.epam.reportportal.annotations.attribute;

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

/**
* Annotation used in {@link Attributes} as field, to provide {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with both 'key' and 'value' fields specified
*
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
* Annotation used per se or in {@link Attributes} as field, to provide {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with both 'key' and 'value' fields specified.
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
@Repeatable(AttributeGroup.class)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface Attribute {

String key();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2025 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.attribute;

import java.lang.annotation.*;

/**
* Gathering annotation for {@link Attribute}
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface AttributeGroup {
Attribute[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@

package com.epam.reportportal.annotations.attribute;

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

/**
* Annotation used in {@link Attributes} as field, to provide {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with only 'value' field specified ('key' in the resulted entity will be NULL)
*
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
* Annotation used per se or in {@link Attributes} as field, to provide {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with only 'value' field specified ('key' in the resulted entity will be NULL). In this case it will appear as a tag on ReportPortal.
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
@Repeatable(AttributeValueGroup.class)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface AttributeValue {

String value();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2025 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.attribute;

import java.lang.annotation.*;

/**
* Gathering annotation for {@link AttributeValue}
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface AttributeValueGroup {
AttributeValue[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @see MultiValueAttribute
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
@Inherited
public @interface Attributes {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@

package com.epam.reportportal.annotations.attribute;

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

/**
* Annotation used in {@link Attributes} as field, to provide multiple {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with both 'key' and 'value' fields specified.
* Used to prevent duplication of {@link Attribute} annotation with the same value and different keys
*
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
* Annotation used per se or in {@link Attributes} as field, to provide multiple
* {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ} with both 'key' and 'value' fields specified.
* Used to prevent duplication of {@link Attribute} annotation with the same value and different keys.
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
@Repeatable(MultiKeyAttributeGroup.class)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface MultiKeyAttribute {

String[] keys();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2025 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.attribute;

import java.lang.annotation.*;

/**
* Gathering annotation for {@link MultiKeyAttribute}
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface MultiKeyAttributeGroup {
MultiKeyAttribute[] value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,26 @@

package com.epam.reportportal.annotations.attribute;

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

/**
* Annotation used in {@link Attributes} as field, to provide multiple {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ}
* with both 'key' (optional) and 'value' fields specified.
* Used to prevent duplication of {@link Attribute} annotation with the same key and different values
*
* @author <a href="mailto:ivan_budayeu@epam.com">Ivan Budayeu</a>
* Annotation used per se or in {@link Attributes} as field, to provide multiple
* {@link com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ} with both 'key' (optional) and 'value' fields specified.
* Used to prevent duplication of {@link Attribute} annotation with the same key and different values.
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
@Repeatable(MultiValueAttributeGroup.class)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface MultiValueAttribute {

String key() default "";

String[] values();

/**
* @return 'true' if key of the resulted entity should be NULL, otherwise {@link MultiValueAttribute#key()} will be used
* @return if key of the resulted entity should be {@code null}, otherwise {@link MultiValueAttribute#key()} will be used.
*/
boolean isNullKey() default false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2025 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.attribute;

import java.lang.annotation.*;

/**
* Gathering annotation for {@link MultiValueAttribute}
*/
@Inherited
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE, ElementType.CONSTRUCTOR })
public @interface MultiValueAttributeGroup {
MultiValueAttribute[] value();
}
Loading