Skip to content

Commit 8b835f5

Browse files
Change javadocs to use consistent convention and add some missing documentation
1 parent 7e2d471 commit 8b835f5

File tree

8 files changed

+70
-12
lines changed

8 files changed

+70
-12
lines changed

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/BaseTestElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.apache.jorphan.collections.HashTree;
66

77
/**
8-
* This class provides the basic logic for all {@link DslTestElement}.
8+
* Provides the basic logic for all {@link DslTestElement}.
99
*
1010
* In particular it currently allows to set the name of the TestElement and abstracts building of
1111
* the tree only requiring, from sub classes, to implement the logic to build the JMeter

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/DslSampler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import us.abstracta.jmeter.javadsl.http.DslHttpSampler;
77

88
/**
9-
* This abstract class hosts the logic common to all samplers.
9+
* Hosts common logic to all samplers.
1010
*
11-
* In particular this class specifies that samplers are {@link ThreadGroupChild} and {@link
11+
* In particular it specifies that samplers are {@link ThreadGroupChild} and {@link
1212
* TestElementContainer} containing {@link SamplerChild}.
1313
*
1414
* For an example of an implementation of a sampler check {@link DslHttpSampler}.

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/DslTestElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.apache.jorphan.collections.HashTree;
44

55
/**
6-
* This is the interface to implement by all elements composing a JMeter test plan.
6+
* Interface to be implemented by all elements composing a JMeter test plan.
77
*/
88
public interface DslTestElement {
99

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/DslThreadGroup.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import us.abstracta.jmeter.javadsl.core.DslThreadGroup.ThreadGroupChild;
1010

1111
/**
12-
* This class represents the standard thread group test element included by JMeter.
12+
* Represents the standard thread group test element included by JMeter.
1313
*
1414
* Additional methods should be added in the future to support setting rump-up, start and end
1515
* scheduling.
@@ -38,8 +38,8 @@ public TestElement buildTestElement() {
3838
}
3939

4040
/**
41-
* Test elements that can be added as direct children of a thread group in jmeter, should
42-
* implement this interface.
41+
* Test elements that can be added as direct children of a thread group in jmeter should implement
42+
* this interface.
4343
*/
4444
public interface ThreadGroupChild extends DslTestElement {
4545

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/JtlWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import us.abstracta.jmeter.javadsl.core.DslThreadGroup.ThreadGroupChild;
99

1010
/**
11-
* This class allows to generate a result log file (JTL) with data for each sample for a test plan,
12-
* thread group or sampler, depending at what level of test plan is added.
11+
* Allows to generate a result log file (JTL) with data for each sample for a test plan, thread
12+
* group or sampler, depending at what level of test plan is added.
1313
*
1414
* If jtlWriter is added at testPlan level it will log information about all samples in the test
1515
* plan, if added at thread group level it will only log samples for samplers contained within it,

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/TestElementContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import org.apache.jorphan.collections.HashTree;
77

88
/**
9-
* This class abstracts logic for {@link DslTestElement} that can nest other test elements.
9+
* Abstracts logic for {@link DslTestElement} that can nest other test elements.
1010
*
11-
* @param <T> The type of test elements that can be nested by this class.
11+
* @param <T> is type of test elements that can be nested by this class.
1212
*
1313
* Check {@link DslTestPlan} for an example.
1414
*/

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/http/DslHttpSampler.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import us.abstracta.jmeter.javadsl.core.DslSampler;
1212

1313
/**
14-
* This allow to configure a JMeter HTTP sampler to make HTTP requests in a test plan.
14+
* Allows to configure a JMeter HTTP sampler to make HTTP requests in a test plan.
1515
*/
1616
public class DslHttpSampler extends DslSampler {
1717

@@ -25,32 +25,74 @@ public DslHttpSampler(String name, String url) {
2525
this.url = url;
2626
}
2727

28+
/**
29+
* Specifies that the sampler should send an HTTP POST to defined URL.
30+
*
31+
* @param body to include in HTTP POST request body.
32+
* @param contentType to be sent as Content-Type header in HTTP POST request.
33+
* @return the altered sampler to allow for fluent API usage.
34+
*/
2835
public DslHttpSampler post(String body, MimeTypes.Type contentType) {
2936
return method(HttpMethod.POST)
3037
.contentType(contentType)
3138
.body(body);
3239
}
3340

41+
/**
42+
* Specifies the HTTP method to be used in the HTTP request generated by the sampler
43+
*
44+
* @param method is the HTTP method to be used by the sampler.
45+
* @return the altered sampler to allow for fluent API usage.
46+
*/
3447
public DslHttpSampler method(HttpMethod method) {
3548
this.method = method;
3649
return this;
3750
}
3851

52+
/**
53+
* Specifies an HTTP header to be sent by the sampler.
54+
*
55+
* To specify multiple headers just invoke this method several times with the different header
56+
* names and values.
57+
*
58+
* @param name of the HTTP header.
59+
* @param value of the HTTP header.
60+
* @return the altered sampler to allow for fluent API usage.
61+
*/
3962
public DslHttpSampler header(String name, String value) {
4063
headers.header(name, value);
4164
return this;
4265
}
4366

67+
/**
68+
* Allows to easily specify the Content-Type HTTP header to be used by the sampler.
69+
*
70+
* @param contentType value to send as Content-Type header.
71+
* @return the altered sampler to allow for fluent API usage.
72+
*/
4473
public DslHttpSampler contentType(MimeTypes.Type contentType) {
4574
headers.contentType(contentType);
4675
return this;
4776
}
4877

78+
/**
79+
* Specifies the body to be sent in the HTTP request generated by the sampler.
80+
*
81+
* @param body to be used as in the body of the HTTP request.
82+
* @return the altered sampler to allow for fluent API usage.
83+
*/
4984
public DslHttpSampler body(String body) {
5085
this.body = body;
5186
return this;
5287
}
5388

89+
/**
90+
* Allows specifying children test elements for the sampler, which allow for example extracting
91+
* information from HTTP response, alter HTTP request, assert HTTP response contents, etc.
92+
*
93+
* @param children list of test elements to add as children of this sampler.
94+
* @return the altered sampler to allow for fluent API usage.
95+
*/
5496
public DslHttpSampler children(SamplerChild... children) {
5597
setChildren(children);
5698
return this;

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/http/HttpHeaders.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,27 @@ public HttpHeaders() {
3434
super("HTTP Header Manager", HeaderPanel.class);
3535
}
3636

37+
/**
38+
* Allows to set an HTTP header to be used by HTTP samplers.
39+
*
40+
* To specify multiple headers just invoke this method several times with the different header
41+
* names and values.
42+
*
43+
* @param name of the HTTP header.
44+
* @param value of the HTTP header.
45+
* @return the altered HttpHeaders instant to allow for fluent API usage.
46+
*/
3747
public HttpHeaders header(String name, String value) {
3848
headers.put(name, value);
3949
return this;
4050
}
4151

52+
/**
53+
* Allows to easily specify the Content-Type HTTP header.
54+
*
55+
* @param contentType value to use as Content-Type header.
56+
* @return the altered HttpHeaders to allow for fluent API usage.
57+
*/
4258
public HttpHeaders contentType(MimeTypes.Type contentType) {
4359
headers.put(HttpHeader.CONTENT_TYPE.toString(), contentType.toString());
4460
return this;

0 commit comments

Comments
 (0)