Skip to content

Commit be9e7a6

Browse files
authored
add javadoc for public api methods (via #1281)
1 parent 826aebd commit be9e7a6

399 files changed

Lines changed: 3024 additions & 1124 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

allure-assertj/src/main/java/io/qameta/allure/assertj/AllureAspectJ.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
* Captures user-side AssertJ factories and fluent calls, then delegates assertion-chain state
3434
* to {@link AssertJRecorder}.
3535
*
36-
* @author charlie (Dmitry Baev).
37-
* @author sskorol (Sergey Korol).
3836
*/
3937
@SuppressWarnings("all")
4038
@Aspect
@@ -59,6 +57,10 @@ protected AllureLifecycle initialValue() {
5957
+ " || call(public * org.assertj.core.api.*SoftAssertionsProvider+.then*(..))"
6058
+ ")"
6159
)
60+
61+
/**
62+
* Handles the assert factory call callback.
63+
*/
6264
public void assertFactoryCall() {
6365
//pointcut body, should be empty
6466
}
@@ -71,10 +73,19 @@ public void assertFactoryCall() {
7173
+ ")"
7274
+ " && target(assertion)"
7375
)
76+
77+
/**
78+
* Handles the assert operation call callback.
79+
*
80+
* @param assertion the assertion
81+
*/
7482
public void assertOperationCall(final AbstractAssert<?, ?> assertion) {
7583
//pointcut body, should be empty
7684
}
7785

86+
/**
87+
* Handles the user code call callback.
88+
*/
7889
@Pointcut("!within(org.assertj..*) && !within(io.qameta.allure.assertj.AllureAspectJ)")
7990
public void userCodeCall() {
8091
//pointcut body, should be empty
@@ -84,6 +95,13 @@ public void userCodeCall() {
8495
pointcut = "assertFactoryCall() && userCodeCall()",
8596
returning = "result"
8697
)
98+
99+
/**
100+
* Handles the log assert creation callback.
101+
*
102+
* @param joinPoint the join point
103+
* @param result the model object or framework result to process
104+
*/
87105
public void logAssertCreation(final JoinPoint joinPoint, final Object result) {
88106
if (isRecordingMuted() || !(result instanceof AbstractAssert)) {
89107
return;
@@ -93,6 +111,14 @@ public void logAssertCreation(final JoinPoint joinPoint, final Object result) {
93111
getRecorder().assertionCreated(getLifecycle(), assertion, firstArgumentOf(joinPoint));
94112
}
95113

114+
/**
115+
* Returns the log assert operation.
116+
*
117+
* @param joinPoint the join point
118+
* @param assertion the assertion
119+
* @return the log assert operation
120+
* @throws Throwable if the underlying framework operation fails
121+
*/
96122
@Around("assertOperationCall(assertion) && userCodeCall()")
97123
public Object logAssertOperation(final ProceedingJoinPoint joinPoint,
98124
final AbstractAssert<?, ?> assertion)
@@ -122,6 +148,12 @@ public Object logAssertOperation(final ProceedingJoinPoint joinPoint,
122148
"execution(public void org.assertj.core.api.DefaultAssertionErrorCollector.collectAssertionError("
123149
+ "java.lang.AssertionError)) && args(error)"
124150
)
151+
152+
/**
153+
* Handles the soft assertion failed callback.
154+
*
155+
* @param error the error reported by the framework
156+
*/
125157
public void softAssertionFailed(final AssertionError error) {
126158
getRecorder().softAssertionFailed(error);
127159
}
@@ -136,10 +168,18 @@ public static void setLifecycle(final AllureLifecycle allure) {
136168
clearContext();
137169
}
138170

171+
/**
172+
* Returns the lifecycle.
173+
*
174+
* @return the Allure lifecycle used by this integration
175+
*/
139176
public static AllureLifecycle getLifecycle() {
140177
return lifecycle.get();
141178
}
142179

180+
/**
181+
* Handles the clear context callback.
182+
*/
143183
public static void clearContext() {
144184
RECORDER.remove();
145185
}

allure-assertj/src/main/java/io/qameta/allure/assertj/AssertJLifecycleListener.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@
3232
*/
3333
public class AssertJLifecycleListener implements TestLifecycleListener, FixtureLifecycleListener {
3434

35+
/**
36+
* {@inheritDoc}
37+
*/
3538
@Override
3639
public void afterTestWrite(final TestResult result) {
3740
AllureAspectJ.clearContext();
3841
}
3942

43+
/**
44+
* {@inheritDoc}
45+
*/
4046
@Override
4147
public void afterFixtureStop(final FixtureResult result) {
4248
AllureAspectJ.clearContext();

allure-assertj/src/test/java/io/qameta/allure/assertj/AllureAspectJTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
import static io.qameta.allure.test.RunUtils.runWithinTestContext;
3737
import static org.assertj.core.api.Assertions.assertThat;
3838
import static org.assertj.core.api.Assertions.tuple;
39-
40-
/**
41-
* @author charlie (Dmitry Baev).
42-
*/
4339
class AllureAspectJTest {
4440

4541
@AllureFeatures.Steps

allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentContent.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,31 @@
1616
package io.qameta.allure.attachment;
1717

1818
/**
19-
* @author charlie (Dmitry Baev).
19+
* Defines the attachment content contract used by Allure attachment support.
20+
*
21+
* <p>Implement this interface when custom code needs to participate in the same integration flow as the built-in Allure adapter components.</p>
2022
*/
2123
public interface AttachmentContent {
2224

25+
/**
26+
* Returns the content.
27+
*
28+
* @return the content
29+
*/
2330
String getContent();
2431

32+
/**
33+
* Returns the content type.
34+
*
35+
* @return the content type
36+
*/
2537
String getContentType();
2638

39+
/**
40+
* Returns the file extension.
41+
*
42+
* @return the file extension
43+
*/
2744
String getFileExtension();
2845

2946
}

allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentData.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@
1818
/**
1919
* Marker interface for complex Allure attachments.
2020
*
21-
* @author charlie (Dmitry Baev).
2221
*/
2322
@FunctionalInterface
2423
public interface AttachmentData {
2524

25+
/**
26+
* Returns the name.
27+
*
28+
* @return the attachment or display name
29+
*/
2630
String getName();
2731

2832
}

allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentProcessor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717

1818
/**
1919
* @param <T> the type of attachment data.
20-
* @author charlie (Dmitry Baev).
2120
*/
2221
@FunctionalInterface
2322
public interface AttachmentProcessor<T extends AttachmentData> {
2423

24+
/**
25+
* Adds the attachment.
26+
*
27+
* @param attachmentData the attachment data
28+
* @param renderer the renderer used to turn attachment data into content
29+
*/
2530
void addAttachment(T attachmentData, AttachmentRenderer<T> renderer);
2631

2732
}

allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentRenderException.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,18 @@
1616
package io.qameta.allure.attachment;
1717

1818
/**
19-
* @author charlie (Dmitry Baev).
19+
* Supports Allure attachment integration with Allure reporting.
20+
*
21+
* <p>Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.</p>
2022
*/
2123
public class AttachmentRenderException extends RuntimeException {
2224

25+
/**
26+
* Creates an attachment render exception with the supplied values.
27+
*
28+
* @param message the message
29+
* @param cause the failure cause reported by the framework
30+
*/
2331
public AttachmentRenderException(final String message, final Throwable cause) {
2432
super(message, cause);
2533
}

allure-attachments/src/main/java/io/qameta/allure/attachment/AttachmentRenderer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
/**
1919
* @param <T> the type of attachment data
20-
* @author charlie (Dmitry Baev).
2120
*/
2221
@FunctionalInterface
2322
public interface AttachmentRenderer<T extends AttachmentData> {

allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentContent.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
package io.qameta.allure.attachment;
1717

1818
/**
19-
* @author charlie (Dmitry Baev).
19+
* Supports Allure attachment integration with Allure reporting.
20+
*
21+
* <p>Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.</p>
2022
*/
2123
public class DefaultAttachmentContent implements AttachmentContent {
2224

@@ -26,6 +28,13 @@ public class DefaultAttachmentContent implements AttachmentContent {
2628

2729
private final String fileExtension;
2830

31+
/**
32+
* Creates a default attachment content with the supplied values.
33+
*
34+
* @param content the attachment content
35+
* @param contentType the attachment content type
36+
* @param fileExtension the attachment file extension
37+
*/
2938
public DefaultAttachmentContent(final String content,
3039
final String contentType,
3140
final String fileExtension) {
@@ -34,16 +43,25 @@ public DefaultAttachmentContent(final String content,
3443
this.fileExtension = fileExtension;
3544
}
3645

46+
/**
47+
* {@inheritDoc}
48+
*/
3749
@Override
3850
public String getContent() {
3951
return content;
4052
}
4153

54+
/**
55+
* {@inheritDoc}
56+
*/
4257
@Override
4358
public String getContentType() {
4459
return contentType;
4560
}
4661

62+
/**
63+
* {@inheritDoc}
64+
*/
4765
@Override
4866
public String getFileExtension() {
4967
return fileExtension;

allure-attachments/src/main/java/io/qameta/allure/attachment/DefaultAttachmentProcessor.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,33 @@
2121
import java.nio.charset.StandardCharsets;
2222

2323
/**
24-
* @author charlie (Dmitry Baev).
24+
* Supports Allure attachment integration with Allure reporting.
25+
*
26+
* <p>Use this type through the module that owns it when translating framework execution, result metadata, or attachments into Allure report data.</p>
2527
*/
2628
public class DefaultAttachmentProcessor implements AttachmentProcessor<AttachmentData> {
2729

2830
private final AllureLifecycle lifecycle;
2931

32+
/**
33+
* Creates a default attachment processor with default configuration.
34+
*/
3035
public DefaultAttachmentProcessor() {
3136
this(Allure.getLifecycle());
3237
}
3338

39+
/**
40+
* Creates a default attachment processor with the supplied values.
41+
*
42+
* @param lifecycle the Allure lifecycle to use
43+
*/
3444
public DefaultAttachmentProcessor(final AllureLifecycle lifecycle) {
3545
this.lifecycle = lifecycle;
3646
}
3747

48+
/**
49+
* {@inheritDoc}
50+
*/
3851
@Override
3952
public void addAttachment(final AttachmentData attachmentData,
4053
final AttachmentRenderer<AttachmentData> renderer) {

0 commit comments

Comments
 (0)