You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2013/09/28 00:59:49 UTC

svn commit: r1527116 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/config/gui/ src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/ xdocs/

Author: pmouawad
Date: Fri Sep 27 22:59:48 2013
New Revision: 1527116

URL: http://svn.apache.org/r1527116
Log:
Bug 55606 - Use JSyntaxtTextArea for Http Request, JMS Test Elements
Bugzilla Id: 55606

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java?rev=1527116&r1=1527115&r2=1527116&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/gui/UrlConfigGui.java Fri Sep 27 22:59:48 2013
@@ -40,6 +40,8 @@ import org.apache.commons.lang3.StringUt
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.ConfigTestElement;
 import org.apache.jmeter.gui.util.HorizontalPanel;
+import org.apache.jmeter.gui.util.JSyntaxTextArea;
+import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.protocol.http.gui.HTTPArgumentsPanel;
 import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
@@ -51,7 +53,6 @@ import org.apache.jmeter.testelement.pro
 import org.apache.jmeter.testelement.property.TestElementProperty;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.gui.JLabeledChoice;
-import org.apache.jorphan.gui.JLabeledTextArea;
 
 /**
  * Basic URL / HTTP Request configuration:
@@ -114,7 +115,7 @@ public class UrlConfigGui extends JPanel
     private final boolean showImplementation; // Set false for AJP
 
     // Body data
-    private JLabeledTextArea postBodyContent;
+    private JSyntaxTextArea postBodyContent;
 
     // Tabbed pane that contains parameters and raw body
     private ValidationTabbedPane postContentTabbedPane;
@@ -169,7 +170,7 @@ public class UrlConfigGui extends JPanel
         contentEncoding.setText(""); // $NON-NLS-1$
         argsPanel.clear();
         if(showRawBodyPane) {
-            postBodyContent.setText("");// $NON-NLS-1$
+            postBodyContent.setInitialText("");// $NON-NLS-1$
         }
         postContentTabbedPane.setSelectedIndex(TAB_PARAMETERS, false);
     }
@@ -279,7 +280,7 @@ public class UrlConfigGui extends JPanel
         boolean useRaw = el.getPropertyAsBoolean(HTTPSamplerBase.POST_BODY_RAW, HTTPSamplerBase.POST_BODY_RAW_DEFAULT);
         if(useRaw) {
             String postBody = computePostBody(arguments, true); // Convert CRLF to CR, see modifyTestElement
-            postBodyContent.setText(postBody);   
+            postBodyContent.setInitialText(postBody);   
             postContentTabbedPane.setSelectedIndex(TAB_RAW_BODY, false);
         } else {
             argsPanel.configure(arguments);
@@ -610,8 +611,8 @@ public class UrlConfigGui extends JPanel
         argsPanel = new HTTPArgumentsPanel();
         postContentTabbedPane.add(JMeterUtils.getResString("post_as_parameters"), argsPanel);// $NON-NLS-1$
         if(showRawBodyPane) {
-            postBodyContent = new JLabeledTextArea(JMeterUtils.getResString("post_body_raw"));// $NON-NLS-1$
-            postContentTabbedPane.add(JMeterUtils.getResString("post_body"), postBodyContent);// $NON-NLS-1$
+            postBodyContent = new JSyntaxTextArea(30, 50);// $NON-NLS-1$
+            postContentTabbedPane.add(JMeterUtils.getResString("post_body"), new JTextScrollPane(postBodyContent));// $NON-NLS-1$
         }
         return postContentTabbedPane;
     }
@@ -647,7 +648,7 @@ public class UrlConfigGui extends JPanel
                     // If there is no data, then switching between Parameters and Raw should be
                     // allowed with no further user interaction.
                     argsPanel.clear();
-                    postBodyContent.setText("");
+                    postBodyContent.setInitialText("");
                     super.setSelectedIndex(index);
                 }
                 else { 
@@ -725,7 +726,7 @@ public class UrlConfigGui extends JPanel
      * Convert Parameters to Raw Body
      */
     void convertParametersToRaw() {
-        postBodyContent.setText(computePostBody((Arguments)argsPanel.createTestElement()));
+        postBodyContent.setInitialText(computePostBody((Arguments)argsPanel.createTestElement()));
     }
 
     /**

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java?rev=1527116&r1=1527115&r2=1527116&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java (original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java Fri Sep 27 22:59:48 2013
@@ -24,6 +24,7 @@ import java.awt.Dimension;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
 import javax.swing.JCheckBox;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -32,13 +33,14 @@ import org.apache.jmeter.config.Argument
 import org.apache.jmeter.config.gui.ArgumentsPanel;
 import org.apache.jmeter.gui.util.FilePanel;
 import org.apache.jmeter.gui.util.JLabeledRadioI18N;
+import org.apache.jmeter.gui.util.JSyntaxTextArea;
+import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.gui.util.VerticalPanel;
 import org.apache.jmeter.protocol.jms.sampler.PublisherSampler;
 import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.gui.JLabeledPasswordField;
-import org.apache.jorphan.gui.JLabeledTextArea;
 import org.apache.jorphan.gui.JLabeledTextField;
 
 /**
@@ -101,7 +103,7 @@ public class JMSPublisherGui extends Abs
 
     private final FilePanel randomFile = new FilePanel(JMeterUtils.getResString("jms_random_file"), ALL_FILES); //$NON-NLS-1$
 
-    private final JLabeledTextArea textMessage = new JLabeledTextArea(JMeterUtils.getResString("jms_text_area")); // $NON-NLS-1$
+    private final JSyntaxTextArea textMessage = new JSyntaxTextArea(15, 50); // $NON-NLS-1$
 
     private final JLabeledRadioI18N msgChoice = new JLabeledRadioI18N("jms_message_type", MSGTYPES_ITEMS, TEXT_MSG_RSC); //$NON-NLS-1$
     
@@ -209,7 +211,12 @@ public class JMSPublisherGui extends Abs
         mainPanel.add(msgChoice);
         mainPanel.add(messageFile);
         mainPanel.add(randomFile);
-        mainPanel.add(textMessage);
+
+        JPanel messageContentPanel = new JPanel(new BorderLayout());
+        messageContentPanel.add(new JLabel(JMeterUtils.getResString("jms_text_area")), BorderLayout.NORTH);
+        messageContentPanel.add(new JTextScrollPane(textMessage), BorderLayout.CENTER);
+
+        mainPanel.add(messageContentPanel);
         Dimension pref = new Dimension(400, 150);
         textMessage.setPreferredSize(pref);
 
@@ -229,7 +236,7 @@ public class JMSPublisherGui extends Abs
         jmsDestination.setText(""); // $NON-NLS-1$
         jmsUser.setText(""); // $NON-NLS-1$
         jmsPwd.setText(""); // $NON-NLS-1$
-        textMessage.setText(""); // $NON-NLS-1$
+        textMessage.setInitialText(""); // $NON-NLS-1$
         messageFile.setFilename(""); // $NON-NLS-1$
         randomFile.setFilename(""); // $NON-NLS-1$
         msgChoice.setText(""); // $NON-NLS-1$
@@ -259,7 +266,7 @@ public class JMSPublisherGui extends Abs
         jmsDestination.setText(sampler.getDestination());
         jmsUser.setText(sampler.getUsername());
         jmsPwd.setText(sampler.getPassword());
-        textMessage.setText(sampler.getTextMessage());
+        textMessage.setInitialText(sampler.getTextMessage());
         messageFile.setFilename(sampler.getInputFile());
         randomFile.setFilename(sampler.getRandomPath());
         configChoice.setText(sampler.getConfigChoice());

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java?rev=1527116&r1=1527115&r2=1527116&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java (original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSamplerGui.java Fri Sep 27 22:59:48 2013
@@ -25,17 +25,19 @@ import javax.swing.BorderFactory;
 import javax.swing.Box;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
 
 import org.apache.jmeter.config.Arguments;
 import org.apache.jmeter.config.gui.ArgumentsPanel;
 import org.apache.jmeter.gui.util.HorizontalPanel;
+import org.apache.jmeter.gui.util.JSyntaxTextArea;
+import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.protocol.jms.sampler.JMSSampler;
+import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jmeter.testelement.TestElement;
 import org.apache.jmeter.util.JMeterUtils;
-import org.apache.jmeter.samplers.gui.AbstractSamplerGui;
 import org.apache.jorphan.gui.JLabeledChoice;
-import org.apache.jorphan.gui.JLabeledTextArea;
 import org.apache.jorphan.gui.JLabeledTextField;
 
 /**
@@ -58,7 +60,7 @@ public class JMSSamplerGui extends Abstr
 
     private JLabeledTextField jmsSelector = new JLabeledTextField(JMeterUtils.getResString("jms_selector")); //$NON-NLS-1$
 
-    private JLabeledTextArea messageContent = new JLabeledTextArea(JMeterUtils.getResString("jms_msg_content")); //$NON-NLS-1$
+    private JSyntaxTextArea messageContent = new JSyntaxTextArea(15, 50); //$NON-NLS-1$
 
     private JLabeledTextField initialContextFactory = new JLabeledTextField(
             JMeterUtils.getResString("jms_initial_context_factory")); //$NON-NLS-1$
@@ -96,7 +98,7 @@ public class JMSSamplerGui extends Abstr
         ((JComboBox) oneWay.getComponentList().get(1)).setSelectedItem(JMeterUtils.getResString("jms_request")); //$NON-NLS-1$
         timeout.setText("");  // $NON-NLS-1$
         jmsSelector.setText(""); // $NON-NLS-1$
-        messageContent.setText(""); // $NON-NLS-1$
+        messageContent.setInitialText(""); // $NON-NLS-1$
         initialContextFactory.setText(""); // $NON-NLS-1$
         providerUrl.setText(""); // $NON-NLS-1$
         jmsPropertiesPanel.clear();
@@ -172,7 +174,7 @@ public class JMSSamplerGui extends Abstr
 
         timeout.setText(sampler.getTimeout());
         jmsSelector.setText(sampler.getJMSSelector());
-        messageContent.setText(sampler.getContent());
+        messageContent.setInitialText(sampler.getContent());
         initialContextFactory.setText(sampler.getInitialContextFactory());
         providerUrl.setText(sampler.getContextProvider());
 
@@ -242,7 +244,8 @@ public class JMSSamplerGui extends Abstr
         messagePanel.add(messageNorthPanel, BorderLayout.NORTH);
 
         JPanel messageContentPanel = new JPanel(new BorderLayout());
-        messageContentPanel.add(messageContent);
+        messageContentPanel.add(new JLabel(JMeterUtils.getResString("jms_msg_content")), BorderLayout.NORTH);
+        messageContentPanel.add(new JTextScrollPane(messageContent), BorderLayout.CENTER);
         Dimension pref = new Dimension(400, 150);
         messageContent.setPreferredSize(pref);
         messagePanel.add(messageContentPanel, BorderLayout.CENTER);

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1527116&r1=1527115&r2=1527116&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Fri Sep 27 22:59:48 2013
@@ -439,6 +439,7 @@ To revert to previous behaviour, set the
 <li><bugzilla>55513</bugzilla> - StreamCopier cannot be used with System.err or System.out as it closes the output stream</li>
 <li><bugzilla>55514</bugzilla> - SystemCommand should support arbitrary input and output streams</li>
 <li><bugzilla>55515</bugzilla> - SystemCommand should support chaining of commands</li>
+<li><bugzilla>55606</bugzilla> - Use JSyntaxtTextArea for Http Request, JMS Test Elements</li>
 </ul>
 
 <h2>Non-functional changes</h2>