You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2007/10/04 01:46:43 UTC

svn commit: r581749 - in /jakarta/jmeter/trunk: bin/ docs/ docs/usermanual/ src/components/org/apache/jmeter/visualizers/ src/core/org/apache/jmeter/resources/ xdocs/ xdocs/images/screenshots/ xdocs/usermanual/

Author: sebb
Date: Wed Oct  3 16:46:42 2007
New Revision: 581749

URL: http://svn.apache.org/viewvc?rev=581749&view=rev
Log:
Initial version of Property Display
TODO - implement add and delete

Added:
    jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java   (with props)
    jakarta/jmeter/trunk/xdocs/images/screenshots/property_display.png   (with props)
Modified:
    jakarta/jmeter/trunk/bin/saveservice.properties
    jakarta/jmeter/trunk/docs/changes.html
    jakarta/jmeter/trunk/docs/usermanual/component_reference.html
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

Modified: jakarta/jmeter/trunk/bin/saveservice.properties
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/bin/saveservice.properties?rev=581749&r1=581748&r2=581749&view=diff
==============================================================================
--- jakarta/jmeter/trunk/bin/saveservice.properties (original)
+++ jakarta/jmeter/trunk/bin/saveservice.properties Wed Oct  3 16:46:42 2007
@@ -165,6 +165,7 @@
 ParamMask=org.apache.jmeter.protocol.http.modifier.ParamMask
 ParamModifier=org.apache.jmeter.protocol.http.modifier.ParamModifier
 ParamModifierGui=org.apache.jmeter.protocol.http.modifier.gui.ParamModifierGui
+PropertyControlGui=org.apache.jmeter.visualizers.PropertyControlGui
 ProxyControl=org.apache.jmeter.protocol.http.proxy.ProxyControl
 ProxyControlGui=org.apache.jmeter.protocol.http.proxy.gui.ProxyControlGui
 PublisherSampler=org.apache.jmeter.protocol.jms.sampler.PublisherSampler

Modified: jakarta/jmeter/trunk/docs/changes.html
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/changes.html?rev=581749&r1=581748&r2=581749&view=diff
==============================================================================
--- jakarta/jmeter/trunk/docs/changes.html (original)
+++ jakarta/jmeter/trunk/docs/changes.html Wed Oct  3 16:46:42 2007
@@ -140,12 +140,12 @@
 								
 
 												<li	>
-								SaveService no longer needs to instantiate classes
+								Bug 43430 - Count of active threads is incorrect for remote samples
 						</li>
 									
 
 												<li	>
-								Bug 43430 - Count of active threads is incorrect for remote samples
+								Throughput Controller was not working for "all thread" counts
 						</li>
 									
 
@@ -177,10 +177,37 @@
 									
 
 												<li	>
+								SaveService no longer needs to instantiate classes
+						</li>
+									
+
+												<li	>
 								New functions: __eval() and __evalVar()
 						</li>
 									
 
+												<li	>
+								Menu items now appear in execution order
+						</li>
+									
+
+												<li	>
+								Test Plan items can now only be dropped/pasted into parts of the tree where they are allowed
+						</li>
+									
+
+						</ul>
+							  									 				<h4	>
+								Non-functional Improvements
+						</h4>
+							  									 				<ul	>
+								
+
+												<li	>
+								Functor code tightened up; Functor can now be used with interfaces, as well as pre-defined targets and parameters.
+						</li>
+									
+
 						</ul>
 							  									 				<h3	>
 								Version 2.3
@@ -2886,6 +2913,7 @@
 												<li	>
 								Extra Proxy Server options: 
 Create all samplers with keep-alive disabled 
+
 Add Separator markers between sets of samples 
 Add Response Assertion to first sampler in each set 
 						</li>

Modified: jakarta/jmeter/trunk/docs/usermanual/component_reference.html
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/docs/usermanual/component_reference.html?rev=581749&r1=581748&r2=581749&view=diff
==============================================================================
--- jakarta/jmeter/trunk/docs/usermanual/component_reference.html (original)
+++ jakarta/jmeter/trunk/docs/usermanual/component_reference.html Wed Oct  3 16:46:42 2007
@@ -251,6 +251,7 @@
 					<li><a href="#WorkBench">WorkBench</a></li>
 					<li><a href="#SSL_Manager">SSL Manager</a></li>
 					<li><a href="#HTTP_Mirror_Server">HTTP Mirror Server</a></li>
+					<li><a href="#Property_Display">Property Display</a></li>
 				</ul>
 			<li><a href="#Reports">18.10 Reports</a></li>
 		<ul>
@@ -6540,7 +6541,11 @@
 			<tr>
 			<td>Filename</td>
 			<td>						Name of the file to be read. 
-  Relative file names are resolved with respect to the current test plan.
+  
+												<b	>
+								Relative file names are resolved with respect to the path of the active test plan.
+						</b>
+									
   Absolute file names are also supported, but note that they are unlikely to work in remote mode, 
   unless the remote server has the same directory structure.
   
@@ -7087,7 +7092,7 @@
 						</b>
 									 determines the minimum gap that JMeter needs between requests
            to treat them as separate "clicks". The default is 1000 (milliseconds) i.e. 1 second.
-           If you are using grouping, pleas ensure that you leave the required gap between clicks.
+           If you are using grouping, please ensure that you leave the required gap between clicks.
         
 			</td>
 			<td>
@@ -7119,6 +7124,14 @@
 								</td>
 		</tr>
 			<tr>
+			<td>Type</td>
+			<td>						Which type of sampler to generate (the Java default or HTTPClient)
+			</td>
+			<td>
+											Yes
+								</td>
+		</tr>
+			<tr>
 			<td>Redirect Automatically</td>
 			<td>						Set Redirect Automatically in the generated samplers?
 			</td>
@@ -7229,13 +7242,9 @@
 		</table>
 	</p>
 							  									 				<p	>
-								To add an entry to the Include or Exclude field, type the entry into the text field, and hit "Enter" when done.
-The text will be added to the List box to the right of the text field.  To clear the text field, hit the "clear"
-button.  Currently, there is no way to individually select items and delete them.
-						</p>
-							  									 				<p	>
-								These entries will be treated as Perl-type regular expressions.  They will be matched against the host name + the path of
-each browser request.  Thus, if the URL you are browsing is 
+								These entries will be treated as regular expressions (using Jakarta ORO).
+They will be matched against the host name + the path of each browser request.
+If the URL you are browsing is 
 												<b	>
 								http://jakarta.apache.org/jmeter/index.html?username=xxxx
 						</b>
@@ -7245,13 +7254,30 @@
 								"jakarta.apache.org/jmeter/index.html"
 						</b>
 									.  Thus,
-if you wanted to include all .html files, you're regular expression might look like: 
+if you want to include all .html files, your regular expression might look like: 
 												<b	>
 								".*\.html"
 						</b>
-									.  Using a
-combination of includes and excludes, you should be able to record what you are interested in and skip what you are
-not.
+									.
+
+						</p>
+							  									 				<p	>
+								
+If there are any include patterns, then the URL 
+												<b	>
+								must match at least one
+						</b>
+									 of the patterns
+, otherwise it will not be recorded.
+If there are any exclude patterns, then the URL 
+												<b	>
+								must not match any
+						</b>
+									 of the patterns
+, otherwise it will not be recorded.
+Using a combination of includes and excludes,
+you should be able to record what you are interested in and skip what you are not.
+
 						</p>
 							  									 				<p	>
 								
@@ -11242,6 +11268,29 @@
 
 														<p><b>Control Panel</b></p>
 						<div align="center"><img width='303' height='139' src="../images/screenshots/mirrorserver.png"></div>
+											  		</td></tr>
+		<tr><td><br></td></tr>
+	 </table>
+	<hr>
+							  									 						<table border="0" cellspacing="0" cellpadding="2">
+		<tr><td>
+		  <font face="arial,helvetica,sanserif">
+			 <a name="Property_Display"><h3>18.9.6 Property Display</h3></a>
+		  </font>
+		</td></tr>
+				<tr><td>
+		  															
+
+												<p	>
+								
+The Property Display shows the values of System or JMeter properties.
+Values can be changed by entering new text in the Value column.
+
+						</p>
+									
+
+														<p><b>Control Panel</b></p>
+						<div align="center"><img width='776' height='502' src="../images/screenshots/property_display.png"></div>
 											  		</td></tr>
 		<tr><td><br></td></tr>
 	 </table>

Added: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java?rev=581749&view=auto
==============================================================================
--- jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java (added)
+++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java Wed Oct  3 16:46:42 2007
@@ -0,0 +1,267 @@
+/*
+ * 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.visualizers;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+
+import org.apache.jmeter.config.ConfigTestElement;
+import org.apache.jmeter.config.gui.AbstractConfigGui;
+import org.apache.jmeter.gui.UnsharedComponent;
+import org.apache.jmeter.gui.util.MenuFactory;
+import org.apache.jmeter.samplers.SampleResult;
+import org.apache.jmeter.testelement.TestElement;
+import org.apache.jmeter.util.JMeterUtils;
+import org.apache.jorphan.gui.ObjectTableModel;
+import org.apache.jorphan.reflect.Functor;
+
+public class PropertyControlGui extends AbstractConfigGui
+    implements ActionListener, UnsharedComponent {
+
+	// Can't use Functor to access private Hashatble.Entry instances
+	// Probably a limitation of Functor?
+	public static class PropertyEntry {
+		private Map.Entry me;
+		PropertyEntry(Map.Entry me){
+			this.me=me;
+		}
+		public Object getKey() {
+			return me.getKey();
+		}
+		public Object getValue() {
+			return me.getValue();
+		}
+		public Object setValue(String value) {
+			return me.setValue(value);
+		}
+
+	}
+	private static final long serialVersionUID = 1L;
+
+	private static final String COLUMN_NAMES_0 = JMeterUtils.getResString("name"); // $NON-NLS-1$
+
+	private static final String COLUMN_NAMES_1 = JMeterUtils.getResString("value"); // $NON-NLS-1$
+
+	private static final String ADD = "add"; // $NON-NLS-1$
+
+	private static final String DELETE = "delete"; // $NON-NLS-1$
+
+	private static final String SYSTEM = "system"; // $NON-NLS-1$
+
+	private static final String JMETER = "jmeter"; // $NON-NLS-1$
+
+	private JCheckBox systemButton = new JCheckBox("System");
+	private JCheckBox jmeterButton = new JCheckBox("JMeter");
+	
+	private JLabel tableLabel = new JLabel("Properties");
+
+	/** The table containing the list of arguments. */
+	private transient JTable table;
+
+	/** The model for the arguments table. */
+	protected transient ObjectTableModel tableModel;
+
+	/** A button for adding new arguments to the table. */
+	private JButton add;
+
+	/** A button for removing arguments from the table. */
+	private JButton delete;
+
+	public PropertyControlGui() {
+		super();
+		init();
+	}
+
+	public String getLabelResource() {
+		return "property_visualiser_title"; // $NON-NLS-1$
+	}
+
+	public Collection getMenuCategories() {
+		return Arrays.asList(new String[] { MenuFactory.NON_TEST_ELEMENTS });
+	}
+
+	public void actionPerformed(ActionEvent action) {
+		String command = action.getActionCommand();
+		if (ADD.equals(command)){
+			return;
+		}
+		if (DELETE.equals(command)){
+			return;
+		}
+		if (SYSTEM.equals(command)){
+			setUpData();
+			return;
+		}
+		if (JMETER.equals(command)){
+			setUpData();
+			return;
+		}
+
+	}
+
+	public void add(SampleResult sample) {
+	}
+
+	public TestElement createTestElement() {
+		TestElement el = new ConfigTestElement();// TODO replace with simpler version?
+		modifyTestElement(el);
+		return el;
+	}
+	public void configure(TestElement element) {
+	    super.configure(element);
+	    setUpData();
+	}
+	
+	private void setUpData(){
+		tableModel.clearData();
+		Properties p=null;
+		if (systemButton.isSelected()){
+			p = System.getProperties();
+		}
+		if (jmeterButton.isSelected()) {
+			p = JMeterUtils.getJMeterProperties();
+		}
+		if (p == null) return;
+		Set s = p.entrySet();
+		ArrayList al = new ArrayList(s);
+		Collections.sort(al, new Comparator(){
+			public int compare(Object o1, Object o2) {
+				String m1,m2;
+				m1=(String)((Map.Entry)o1).getKey();
+				m2=(String)((Map.Entry)o2).getKey();
+				return m1.compareTo(m2);
+			}
+		});
+		Iterator i = al.iterator();
+		while(i.hasNext()){
+			tableModel.addRow(i.next());
+		}
+	    
+	}
+
+	public void modifyTestElement(TestElement element) {
+		configureTestElement(element);
+	}
+	private Component makeMainPanel() {
+		initializeTableModel();
+		table = new JTable(tableModel);
+		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+		return makeScrollPane(table);
+	}
+
+	/**
+	 * Create a panel containing the title label for the table.
+	 * 
+	 * @return a panel containing the title label
+	 */
+	private Component makeLabelPanel() {
+		JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+		ButtonGroup bg = new ButtonGroup();
+		bg.add(systemButton);
+		bg.add(jmeterButton);
+		jmeterButton.setSelected(true);
+		systemButton.setActionCommand(SYSTEM);
+		jmeterButton.setActionCommand(JMETER);
+		systemButton.addActionListener(this);
+		jmeterButton.addActionListener(this);
+		
+		labelPanel.add(systemButton);
+		labelPanel.add(jmeterButton);
+		labelPanel.add(tableLabel);
+		return labelPanel;
+	}
+
+	/**
+	 * Create a panel containing the add and delete buttons.
+	 * 
+	 * @return a GUI panel containing the buttons
+	 */
+	private JPanel makeButtonPanel() {
+		add = new JButton(JMeterUtils.getResString("add")); // $NON-NLS-1$
+		add.setActionCommand(ADD);
+		add.setEnabled(true);
+
+		delete = new JButton(JMeterUtils.getResString("delete")); // $NON-NLS-1$
+		delete.setActionCommand(DELETE);
+
+		JPanel buttonPanel = new JPanel();
+		buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
+ 		add.addActionListener(this);
+		delete.addActionListener(this);
+		buttonPanel.add(add);
+		buttonPanel.add(delete);
+		return buttonPanel;
+	}
+
+	/**
+	 * Initialize the components and layout of this component.
+	 */
+	private void init() {
+		JPanel p = this;
+
+			setLayout(new BorderLayout(0, 5));
+			setBorder(makeBorder());
+			add(makeTitlePanel(), BorderLayout.NORTH);
+			p = new JPanel();
+
+		p.setLayout(new BorderLayout());
+
+		p.add(makeLabelPanel(), BorderLayout.NORTH);
+		p.add(makeMainPanel(), BorderLayout.CENTER);
+		// Force a minimum table height of 70 pixels
+		p.add(Box.createVerticalStrut(70), BorderLayout.WEST);
+		//p.add(makeButtonPanel(), BorderLayout.SOUTH);
+
+		add(p, BorderLayout.CENTER);
+		table.revalidate();
+	}
+	private void initializeTableModel() {
+		tableModel = new ObjectTableModel(new String[] { COLUMN_NAMES_0, COLUMN_NAMES_1 },
+				new Functor[] {
+				new Functor(Map.Entry.class, "getKey"), // $NON-NLS-1$
+				new Functor(Map.Entry.class, "getValue") },  // $NON-NLS-1$
+				new Functor[] {
+			    null, //new Functor("setName"), // $NON-NLS-1$
+				new Functor(Map.Entry.class,"setValue", new Class[] { Object.class }) // $NON-NLS-1$
+			}, 
+				new Class[] { String.class, String.class });
+	}
+}
\ No newline at end of file

Propchange: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/PropertyControlGui.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

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=581749&r1=581748&r2=581749&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 Wed Oct  3 16:46:42 2007
@@ -512,6 +512,7 @@
 property_tool_tip={0}\: {1}
 property_undefined=Undefined
 property_value_param=Value of property
+property_visualiser_title=Property Display
 protocol=Protocol (default http)\:
 protocol_java_border=Java class
 protocol_java_classname=Classname\:

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=581749&r1=581748&r2=581749&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Wed Oct  3 16:46:42 2007
@@ -45,6 +45,7 @@
 <li>New functions: __eval() and __evalVar()</li>
 <li>Menu items now appear in execution order</li>
 <li>Test Plan items can now only be dropped/pasted into parts of the tree where they are allowed</li>
+<li>Property Display to show the value of System and JMeter properties and allow them to be changed</li>
 </ul>
 
 <h4>Non-functional Improvements</h4>

Added: jakarta/jmeter/trunk/xdocs/images/screenshots/property_display.png
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/images/screenshots/property_display.png?rev=581749&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/jmeter/trunk/xdocs/images/screenshots/property_display.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml?rev=581749&r1=581748&r2=581749&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml (original)
+++ jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml Wed Oct  3 16:46:42 2007
@@ -3542,6 +3542,15 @@
 </description>
 </component>
 
+<component name="Property Display" index="&sect-num;.9.6"  width="776" height="502" screenshot="property_display.png">
+<description>
+<p>
+The Property Display shows the values of System or JMeter properties.
+Values can be changed by entering new text in the Value column.
+</p>
+</description>
+</component>
+
 <a href="#">^</a>
 
 </section>



---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org