private JCheckBox resetInterpreter;// reset the bsh.Interpreter before each execution private JTextField filename;// script file name (if present) private JTextField parameters;// parameters to pass to script file (or script) private JTextArea scriptField;// script area public BeanShellAssertionGui() { init(); } public void configure(TestElement element) { scriptField.setText(element.getPropertyAsString(BeanShellAssertion.SCRIPT)); filename.setText(element.getPropertyAsString(BeanShellAssertion.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellAssertion.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellAssertion.RESET_INTERPRETER)); super.configure(element); } public TestElement createTestElement() { BeanShellAssertion sampler = new BeanShellAssertion(); modifyTestElement(sampler); return sampler; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement te) { te.clear(); this.configureTestElement(te); te.setProperty(BeanShellAssertion.SCRIPT, scriptField.getText()); te.setProperty(BeanShellAssertion.FILENAME, filename.getText()); te.setProperty(BeanShellAssertion.PARAMETERS, parameters.getText()); te.setProperty(new BooleanProperty(BeanShellAssertion.RESET_INTERPRETER, resetInterpreter.isSelected()))
private JCheckBox resetInterpreter;// reset the bsh.Interpreter before each execution private JTextField filename;// script file name (if present) private JTextField parameters;// parameters to pass to script file (or script) private JTextArea scriptField;// script area public BeanShellSamplerGui() { init(); } public void configure(TestElement element) { scriptField.setText(element.getPropertyAsString(BeanShellSampler.SCRIPT)); filename.setText(element.getPropertyAsString(BeanShellSampler.FILENAME)); parameters.setText(element.getPropertyAsString(BeanShellSampler.PARAMETERS)); resetInterpreter.setSelected(element.getPropertyAsBoolean(BeanShellSampler.RESET_INTERPRETER)); super.configure(element); } public TestElement createTestElement() { BeanShellSampler sampler = new BeanShellSampler(); modifyTestElement(sampler); return sampler; } /** * Modifies a given TestElement to mirror the data in the gui components. * * @see org.apache.jmeter.gui.JMeterGUIComponent#modifyTestElement(TestElement) */ public void modifyTestElement(TestElement te) { te.clear(); this.configureTestElement(te); te.setProperty(BeanShellSampler.SCRIPT, scriptField.getText()); te.setProperty(BeanShellSampler.FILENAME, filename.getText()); te.setProperty(BeanShellSampler.PARAMETERS, parameters.getText()); te.setProperty(new BooleanProperty(BeanShellSampler.RESET_INTERPRETER, resetInterpreter.isSelected()))
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/BeanShellAssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/java/control/gui/BeanShellSamplerGui.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
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()))
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0