jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1293637 - in /jmeter/trunk: src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java xdocs/changes.xml
Date Sat, 25 Feb 2012 16:28:06 GMT
Author: pmouawad
Date: Sat Feb 25 16:28:06 2012
New Revision: 1293637

URL: http://svn.apache.org/viewvc?rev=1293637&view=rev
Log:
Bug 52741 - TestBeanGUI default values do not work at second time or later

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java?rev=1293637&r1=1293636&r2=1293637&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/testbeans/gui/TestBeanGUI.java Sat Feb 25 16:28:06
2012
@@ -213,6 +213,13 @@ public class TestBeanGUI extends Abstrac
    public TestElement createTestElement() {
         try {
             TestElement element = (TestElement) testBeanClass.newInstance();
+            // In other GUI component, clearGUI resets the value to defaults one as there
is one GUI per Element
+            // With TestBeanGUI as it's shared, its default values are only known here, we
must call setValues with 
+            // element (as it holds default values)
+            // otherwise we will get values as computed by customizer reset and not default
ones
+            if(initialized) {
+                setValues(element);
+            }
             // configure(element);
             // super.clear(); // set name, enabled.
             modifyTestElement(element); // put the default values back into the
@@ -318,12 +325,22 @@ public class TestBeanGUI extends Abstrac
 
         super.configure(element);
 
+        setValues(element);
+
+        initialized = true;
+    }
+    
+    /**
+     * Get values from element to fill propertyMap and setup customizer 
+     * @param element TestElement
+     */
+    private void setValues(TestElement element) {
         // Copy all property values into the map:
         for (PropertyIterator jprops = element.propertyIterator(); jprops.hasNext();) {
             JMeterProperty jprop = jprops.next();
             propertyMap.put(jprop.getName(), jprop.getObjectValue());
         }
-
+        
         if (customizer != null) {
             customizer.setObject(propertyMap);
         } else {
@@ -338,8 +355,6 @@ public class TestBeanGUI extends Abstrac
             }
             add((Component) c, BorderLayout.CENTER);
         }
-
-        initialized = true;
     }
 
     /** {@inheritDoc} */
@@ -460,6 +475,7 @@ public class TestBeanGUI extends Abstrac
             GenericTestBeanCustomizer gtbc = (GenericTestBeanCustomizer) customizer;
             gtbc.clearGuiFields();
         }
+        propertyMap.clear();
     }
 
     public boolean isHidden() {

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1293637&r1=1293636&r2=1293637&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sat Feb 25 16:28:06 2012
@@ -108,6 +108,7 @@ When doing replacement of User Defined V
 <li>Bug 52678 - Proxy : When doing replacement of UserDefinedVariables, partial values
should not be substituted</li>
 <li>Bug 52728 - CSV Data Set Config element cannot coexist with BSF Sampler in same
Thread Plan</li>
 <li>Bug 52762 - Problem with multiples certificates: first index not used until indexes
are restarted</li>
+<li>Bug 52741 - TestBeanGUI default values do not work at second time or later</li>
 </ul>
 
 <!-- =================== Improvements =================== -->



Mime
View raw message