1 | private JCheckBox resetInterpreter;// reset the bsh.Interpreter before each execution↵ | | 1 | private JCheckBox resetInterpreter;// reset the bsh.Interpreter before each execution↵
|
|
2 | private JTextField filename;// script file name (if present)↵ | | 2 | private JTextField filename;// script file name (if present)↵
|
|
3 | private JTextField parameters;// parameters to pass to script file (or script)↵ | | 3 | private JTextField parameters;// parameters to pass to script file (or script)↵
|
|
4 | private JTextArea scriptField;// script area↵ | | 4 | private JTextArea scriptField;// script area↵
|
|
5 | public BeanShellAssertionGui() {↵ | | 5 | public BeanShellSamplerGui() {↵
|
6 | init();↵ | | 6 | init();↵
|
7 | }↵ | | 7 | }↵
|
|
8 | public void configure(TestElement element) {↵ | | 8 | public void configure(TestElement element) {↵
|
9 | scriptField.setText(element.getPropertyAsString(BeanShellAssertion.SCRIPT));↵ | | 9 | scriptField.setText(element.getPropertyAsString(BeanShellSampler.SCRIPT));↵
|
10 | filename.setText(element.getPropertyAsString(BeanShellAssertion.FILENAME));↵ | | 10 | filename.setText(element.getPropertyAsString(BeanShellSampler.FILENAME));↵
|
11 | parameters.setText(element.getPropertyAsString(BeanShellAssertion.PARAMETERS));↵ | | 11 | parameters.setText(element.getPropertyAsString(BeanShellSampler.PARAMETERS));↵
|
12 | resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellAssertion.RESET_INTERPRETER));↵ | | 12 | resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellSampler.RESET_INTERPRETER));↵
|
13 | super.configure(element);↵ | | 13 | super.configure(element);↵
|
14 | }↵ | | 14 | }↵
|
|
15 | public TestElement createTestElement() {↵ | | 15 | public TestElement createTestElement() {↵
|
16 | BeanShellAssertion sampler = new BeanShellAssertion();↵ | | 16 | BeanShellSampler sampler = new BeanShellSampler();↵
|
17 | modifyTestElement(sampler);↵ | | 17 | modifyTestElement(sampler);↵
|
18 | return sampler;↵ | | 18 | return sampler;↵
|
19 | }↵ | | 19 | }↵
|
|
20 | /**↵ | | 20 | /**↵
|
21 | * Modifies a given TestElement to mirror the data in the gui components.↵ | | 21 | * Modifies a given TestElement to mirror the data in the gui components.↵
|
22 | * ↵ | | 22 | * ↵
|
23 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)↵ | | 23 | * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement)↵
|
24 | */↵ | | 24 | */↵
|
25 | public void modifyTestElement(TestElement te) {↵ | | 25 | public void modifyTestElement(TestElement te) {↵
|
26 | te.clear();↵ | | 26 | te.clear();↵
|
27 | this.configureTestElement(te);↵ | | 27 | this.configureTestElement(te);↵
|
28 | te.setProperty(BeanShellAssertion.SCRIPT, scriptField.getText());↵ | | 28 | te.setProperty(BeanShellSampler.SCRIPT, scriptField.getText());↵
|
29 | te.setProperty(BeanShellAssertion.FILENAME, filename.getText());↵ | | 29 | te.setProperty(BeanShellSampler.FILENAME, filename.getText());↵
|
30 | te.setProperty(BeanShellAssertion.PARAMETERS, parameters.getText());↵ | | 30 | te.setProperty(BeanShellSampler.PARAMETERS, parameters.getText());↵
|
31 | te.setProperty(new BooleanProperty(BeanShellAssertion.RESET_INTERPRETER, resetInterpreter.isSelected())) | | 31 | te.setProperty(new BooleanProperty(BeanShellSampler.RESET_INTERPRETER, resetInterpreter.isSelected()))
|