Author: sebb
Date: Thu Jan 28 23:59:52 2010
New Revision: 904313
URL: http://svn.apache.org/viewvc?rev=904313&view=rev
Log:
Make scope panel generic
Added:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
(with props)
Removed:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AssertionScopePanel.java
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AbstractAssertionGui.java
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pl.properties
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AbstractAssertionGui.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AbstractAssertionGui.java?rev=904313&r1=904312&r2=904313&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AbstractAssertionGui.java
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/assertions/gui/AbstractAssertionGui.java
Thu Jan 28 23:59:52 2010
@@ -27,6 +27,7 @@
import org.apache.jmeter.gui.AbstractJMeterGuiComponent;
import org.apache.jmeter.gui.util.MenuFactory;
import org.apache.jmeter.testelement.AbstractScopedAssertion;
+import org.apache.jmeter.util.ScopePanel;
/**
* This is the base class for JMeter GUI components which manage assertions.
@@ -39,7 +40,7 @@
*/
public abstract class AbstractAssertionGui extends AbstractJMeterGuiComponent {
- private AssertionScopePanel assertionScopePanel;
+ private ScopePanel assertionScopePanel;
/**
* When a user right-clicks on the component in the test tree, or selects
@@ -75,7 +76,7 @@
* @return the scope settings panel
*/
protected JPanel createScopePanel(){
- assertionScopePanel = new AssertionScopePanel();
+ assertionScopePanel = new ScopePanel();
return assertionScopePanel;
}
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=904313&r1=904312&r2=904313&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
Thu Jan 28 23:59:52 2010
@@ -75,10 +75,6 @@
assertion_pattern_match_rules=Pattern Matching Rules
assertion_patterns_to_test=Patterns to Test
assertion_resp_field=Response Field to Test
-assertion_scope=Which samples to test
-assertion_scope_all=Main sample and sub-samples
-assertion_scope_children=Sub-samples only
-assertion_scope_parent=Main sample only
assertion_substring=Substring
assertion_text_resp=Text Response
assertion_textarea_label=Assertions\:
@@ -688,6 +684,10 @@
runtime_controller_title=Runtime Controller
runtime_seconds=Runtime (seconds)
sample_result_save_configuration=Sample Result Save Configuration
+sample_scope=Which samples to process
+sample_scope_all=Main sample and sub-samples
+sample_scope_children=Sub-samples only
+sample_scope_parent=Main sample only
sampler_label=Label
sampler_on_error_action=Action to be taken after a Sampler error
sampler_on_error_continue=Continue
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=904313&r1=904312&r2=904313&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
Thu Jan 28 23:59:52 2010
@@ -68,10 +68,6 @@
assertion_pattern_match_rules=Type de correspondance du motif
assertion_patterns_to_test=Motifs \u00E0 tester
assertion_resp_field=Section de r\u00E9ponse \u00E0 tester
-assertion_scope=Port\u00E9e de l'assertion
-assertion_scope_all=L'\u00E9chantillon parent et ses sous-\u00E9chantillons
-assertion_scope_children=Seulement les sous-\u00E9chantillons
-assertion_scope_parent=Seulement l'\u00E9chantillon parent
assertion_substring=Contient (texte brut)
assertion_text_resp=Texte de r\u00E9ponse
assertion_textarea_label=Assertions \:
@@ -563,6 +559,10 @@
running_test=Lancer test
runtime_controller_title=Contr\u00F4leur Dur\u00E9e d'ex\u00E9cution
runtime_seconds=Temps d'ex\u00E9cution (secondes) \:
+sample_scope=Port\u00E9e de l'assertion
+sample_scope_all=L'\u00E9chantillon parent et ses sous-\u00E9chantillons
+sample_scope_children=Seulement les sous-\u00E9chantillons
+sample_scope_parent=Seulement l'\u00E9chantillon parent
sampler_label=Libell\u00E9
sampler_on_error_action=Action \u00E0 suivre apr\u00E8s une erreur
d'\u00E9chantillon
sampler_on_error_continue=Continuer
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pl.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pl.properties?rev=904313&r1=904312&r2=904313&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pl.properties
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pl.properties
Thu Jan 28 23:59:52 2010
@@ -72,7 +72,6 @@
assertion_pattern_match_rules=Pattern Matching Rules
assertion_patterns_to_test=Patterns to Test
assertion_resp_field=Response Field to Test
-assertion_scope=Kt\u00F3re pr\u00F3bki testowa\u0107
assertion_substring=Substring
assertion_text_resp=Tekst odpowiedzi
assertion_textarea_label=Asercje:
@@ -650,6 +649,7 @@
runtime_controller_title=Runtime Controller
runtime_seconds=Runtime (seconds)
sample_result_save_configuration=Sample Result Save Configuration
+sample_scope=Kt\u00F3re pr\u00F3bki testowa\u0107
sampler_label=Etykieta
sampler_on_error_action=Co robi\u0107 je\u015Bli Pr\u00F3bnik zg\u0142osi
b\u0142\u0105d?
sampler_on_error_continue=Kontunuuj
Modified:
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties?rev=904313&r1=904312&r2=904313&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties
(original)
+++
jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_pt_BR.properties
Thu Jan 28 23:59:52 2010
@@ -75,10 +75,6 @@
assertion_pattern_match_rules=Regras para Combina\u00E7\u00E3o de Padr\u00F5es
assertion_patterns_to_test=Padr\u00F5es a serem Testados
assertion_resp_field=Testar que Campo da Resposta
-assertion_scope=Quais amostras testar
-assertion_scope_all=Amostras principais e sub-amostras
-assertion_scope_children=Somente Sub-amostras
-assertion_scope_parent=Somente Amostras principais
assertion_substring=Substring
assertion_text_resp=Resposta de Texto
assertion_textarea_label=Asser\u00E7\u00F5es\:
@@ -671,6 +667,10 @@
runtime_controller_title=Controlador de Tempo de Execu\u00E7\u00E3o
runtime_seconds=Tempo de execu\u00E7\u00E3o (segundos)
sample_result_save_configuration=Configura\u00E7\u00E3o de Salvar Resultados
da Amostra
+sample_scope=Quais amostras testar
+sample_scope_all=Amostras principais e sub-amostras
+sample_scope_children=Somente Sub-amostras
+sample_scope_parent=Somente Amostras principais
sampler_label=R\u00F3tulo
sampler_on_error_action=A\u00E7\u00E3o a ser tomada depois de erro do testador
sampler_on_error_continue=Continuar
Added: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java?rev=904313&view=auto
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java (added)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java Thu
Jan 28 23:59:52 2010
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.jmeter.util;
+
+import java.awt.BorderLayout;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.apache.jmeter.gui.util.HorizontalPanel;
+import org.apache.jmeter.util.JMeterUtils;
+
+/**
+ * Scope panel so users can choose whether
+ * to apply the test element to the parent sample, the child samples or both.
+ *
+ */
+public class ScopePanel extends JPanel {
+
+ private final JRadioButton parentButton;
+ private final JRadioButton childButton;
+ private final JRadioButton allButton;
+
+ public ScopePanel() {
+ allButton = new
JRadioButton(JMeterUtils.getResString("sample_scope_all"));
+ parentButton = new
JRadioButton(JMeterUtils.getResString("sample_scope_parent"));
+ childButton = new
JRadioButton(JMeterUtils.getResString("sample_scope_children"));
+ init();
+ }
+
+ /**
+ * Initialize the GUI components and layout.
+ */
+ private void init() {
+ setLayout(new BorderLayout(5, 0));
+
setBorder(BorderFactory.createTitledBorder(JMeterUtils.getResString("sample_scope_title")));
//$NON-NLS-1$
+
+ parentButton.setSelected(true);
+
+ ButtonGroup group = new ButtonGroup();
+ group.add(allButton);
+ group.add(parentButton);
+ group.add(childButton);
+ JPanel buttonPanel = new HorizontalPanel();
+ buttonPanel.add(parentButton);
+ buttonPanel.add(childButton);
+ buttonPanel.add(allButton);
+
+ add(buttonPanel);
+ }
+
+ public void clearGui() {
+ parentButton.setSelected(true);
+ }
+
+ public int getSelection(){
+ if (parentButton.isSelected()){
+ return 0;
+ }
+ return 1;
+ }
+
+ public void setScopeAll() {
+ allButton.setSelected(true);
+ }
+
+ public void setScopeChildren() {
+ childButton.setSelected(true);
+ }
+
+ public void setScopeParent() {
+ parentButton.setSelected(true);
+ }
+
+ public boolean isScopeParent() {
+ return parentButton.isSelected();
+ }
+
+ public boolean isScopeChildren() {
+ return childButton.isSelected();
+ }
+}
Propchange: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: jakarta/jmeter/trunk/src/core/org/apache/jmeter/util/ScopePanel.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]