1 | class Example2 extends AbstractSampler implements TestBean {↵ | | 1 | class Example1 extends AbstractSampler implements TestBean {↵
|
|
2 | ↵ | | 2 | ↵
|
3 | public SampleResult sample(Entry e) {↵ | | 3 | public SampleResult sample(Entry e) {↵
|
4 | SampleResult res = new SampleResult();↵ | | 4 | SampleResult res = new SampleResult();↵
|
5 | res.setSampleLabel(getName());↵ | | 5 | res.setSampleLabel(getName());↵
|
6 | res.setSamplerData(myStringProperty);↵ | | 6 | res.setSamplerData(myStringProperty);↵
|
7 | res.sampleStart();↵ | | 7 | res.sampleStart();↵
|
8 | // Do something ...↵ | | 8 | // Do something ...↵
|
9 | res.setResponseData(myStringProperty.toLowerCase().getBytes());↵ | | 9 | res.setResponseData(myStringProperty.toUpperCase().getBytes());↵
|
10 | res.setDataType(SampleResult.TEXT);↵ | | 10 | res.setDataType(SampleResult.TEXT);↵
|
11 | res.sampleEnd();↵ | | 11 | res.sampleEnd();↵
|
12 | res.setSuccessful(true);↵ | | 12 | res.setSuccessful(true);↵
|
13 | return res;↵ | | 13 | return res;↵
|
14 | }↵ | | 14 | }↵
|
|
15 | private String myStringProperty;↵ | | 15 | private String myStringProperty;↵
|
16 | ↵ | | 16 | ↵
|
17 | // A TestBean is a Java Bean. Just define some properties and they will↵ | | 17 | ↵
|
18 | // automagically show up in the GUI.↵ | | |
|
19 | // A String property:↵ | | 18 | // A String property:↵
|
20 | public void setMyStringProperty(String s) {↵ | | 19 | public void setMyStringProperty(String s) {↵
|
21 | myStringProperty=s;↵ | | 20 | myStringProperty=s;↵
|
22 | }↵ | | 21 | }↵
|
|
23 | public String getMyStringProperty() {↵ | | 22 | public String getMyStringProperty() {↵
|
24 | return myStringProperty;↵ | | 23 | return myStringProperty;↵
|
25 | } | | 24 | }
|