jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1418687 - /jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
Date Sat, 08 Dec 2012 15:33:31 GMT
Author: sebb
Date: Sat Dec  8 15:33:30 2012
New Revision: 1418687

URL: http://svn.apache.org/viewvc?rev=1418687&view=rev
Log:
Tristate default values need to be saved

Modified:
    jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java

Modified: jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java?rev=1418687&r1=1418686&r2=1418687&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
(original)
+++ jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/config/gui/TCPConfigGui.java
Sat Dec  8 15:33:30 2012
@@ -128,7 +128,7 @@ public class TCPConfigGui extends Abstra
         element.setProperty(TCPSampler.TIMEOUT, serverPanel.getResponseTimeout());
         element.setProperty(TCPSampler.TIMEOUT_CONNECT, serverPanel.getConnectTimeout(),"");
         element.setProperty(TCPSampler.REQUEST, requestData.getText());
-        setPropertyFromTristate(element, closeConnection, TCPSampler.CLOSE_CONNECTION, TCPSampler.CLOSE_CONNECTION_DEFAULT);
+        setPropertyFromTristate(element, closeConnection, TCPSampler.CLOSE_CONNECTION); //
Don't use default for saving tristates
 //        element.setProperty(TCPSampler.CLOSE_CONNECTION, closeConnection.isSelected(),
TCPSampler.CLOSE_CONNECTION_DEFAULT);
         element.setProperty(TCPSampler.SO_LINGER, soLinger.getText(), "");
         element.setProperty(TCPSampler.EOL_BYTE, eolByte.getText(), "");
@@ -279,7 +279,7 @@ public class TCPConfigGui extends Abstra
         add(mainPanel, BorderLayout.CENTER);
     }
 
-    // TODO should be moved somewhere shared
+    // TODO should be moved somewhere shared, perhaps TristateCheckBox?
     private void setTristateFromProperty(TestElement element, TristateCheckBox checkBox,
String propName) {
         JMeterProperty jmp = element.getProperty(propName);
         if (jmp instanceof NullProperty) {
@@ -289,7 +289,7 @@ public class TCPConfigGui extends Abstra
         }
     }
 
-    // TODO should be moved somewhere shared
+    // TODO should be moved somewhere shared, perhaps TristateCheckBox?
     /**
      * Sets a boolean property from a tristate checkbox.
      * 
@@ -305,21 +305,4 @@ public class TCPConfigGui extends Abstra
         }
     }
 
-    // TODO should be moved somewhere shared
-    /**
-     * Sets a boolean property from a tristate checkbox, with default.
-     * 
-     * @param element the test element
-     * @param checkBox the tristate checkbox
-     * @param propName the property name
-     * @param dflt the default (if default, the property is removed)
-     */
-    private void setPropertyFromTristate(TestElement element, TristateCheckBox checkBox,
String propName, boolean dflt) {
-        if (checkBox.isIndeterminate()) {
-            element.removeProperty(propName);
-        } else {
-            element.setProperty(propName, checkBox.isSelected(), dflt);
-        }
-    }
-
 }



Mime
View raw message