doc and build file tweaks

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@323346 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 00be615a08
This commit is contained in:
Michael Stover 2003-06-15 15:29:54 +00:00
parent 637ab2a4b9
commit 61f1bb3769
13 changed files with 170 additions and 166 deletions

View File

@ -107,6 +107,7 @@ log_file.jmeter=jmeter.log
# legitimate values: xml, csv, db. Only xml and csv are currently supported.
jmeter.save.saveservice.output_format=csv
# true when field should be saved; false otherwise
# assertion_results_failure_message only affects CSV output
@ -131,3 +132,6 @@ jmeter.save.saveservice.output_format=csv
# where the fields' values are separated by specified delimiters.
#jmeter.save.saveservice.default_delimiter=,
#jmeter.save.saveservice.print_field_names=true
# File that holds a record of name changes for backward compatibility issues
upgrade_properties=/bin/upgrade.properties

2
bin/upgrade.properties Normal file
View File

@ -0,0 +1,2 @@
org.apache.jmeter.protocol.http.config.gui.UrlConfigGui=org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui
org.apache.jmeter.assertions.Assertion=org.apache.jmeter.assertions.ResponseAssertion

View File

@ -1,101 +0,0 @@
<html><head><title>JMeter Ant Task</title>
<style>
BODY {
font-family: Verdana, Arial;
}
P {
font-size: smaller;
}
PRE.code {
font-family: courier new, courier;
font-size: smaller;
border: 1px solid black;
background-color: #d0d0d0;
}
</style></head>
<body>
<h3>JMeter Ant Task</h3>
<strong>The JMeter Ant Task is donated courtesy of <a href="http://www.programmerplanet.org/ant-jmeter/">jfifield</a></strong>
<hr>
<p>
This is an <a href="http://ant.apache.org/">Ant</a> task for automating running
<a href="http://jakarta.apache.org/jmeter">JMeter</a> test plans. The task
executes one or more JMeter test plans, and logs the results to a file.
</p>
<p>
To use the task, you must have JMeter installed. You must also include
<a href="http://www.programmerplanet.org/ant-jmeter/ant-jmeter.jar">ant-jmeter.jar</a> in your Ant classpath. Adding
the jar to $ANT_HOME/lib will make this happen automatically.
</p>
<p>
Start by defining the task to make it available to your build script:
</p>
<pre class="code">&lt;taskdef
name="jmeter"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask"/&gt;
</pre>
<p>
Set the jmeterhome parameter to your JMeter install location, and the resultlog
parameter to the name of a file to log the test results to.<br>
</p>
<p>
You can either specify a single test plan using the testplan parameter, or multiple
test plans using the testplans nested element. The testplans element is a standard
Ant <a href="http://ant.apache.org/manual/CoreTypes/fileset.html">FileSet</a> element.
</p>
<pre class="code">&lt;jmeter
jmeterhome="c:\jakarta-jmeter-1.8.1"
testplan="${basedir}/loadtests/JMeterLoadTest.jmx"
resultlog="${basedir}/loadtests/JMeterResults.jtl"/&gt;
</pre>
<pre class="code">&lt;jmeter
jmeterhome="c:\jakarta-jmeter-1.8.1"
resultlog="${basedir}/loadtests/JMeterResults.jtl"&gt;
&lt;testplans dir="${basedir}/loadtests" includes="*.jmx"/&gt;
&lt;/jmeter&gt;
</pre>
<p>
I've also included an XSLT file, <a href="http://www.programmerplanet.org/ant-jmeter/jmeter-results-report.xsl">jmeter-results-report.xsl</a>, for
generating a summary report from the result log file. The summary report is
very similar to the default report created by the junitreport task. You can
use the xslt task to create the report:
</p>
<pre class="code">&lt;xslt
in="${basedir}/loadtests/JMeterResults.jtl"
out="${basedir}/loadtests/JMeterResults.html"
style="${basedir}/loadtests/jmeter-results-report.xsl"/&gt;
</pre>
<p>
If you would like failure detail messages in the report output, you must configure JMeter to output that
information to the result log. To do this, set the following property in your jmeter.properties file before
running the test plans:
</p>
<pre class="code">jmeter.save.saveservice.assertion_results=all
</pre>
<p>
The report will look something like this:
</p>
<img src="JMeter%20Ant%20Task_files/JMeterResults.jpg">
<p style="font-size: xx-small;">
<a href="mailto:jfifield@programmerplanet.org">jfifield@programmerplanet.org</a><br>
Last updated: 5/3/2003<br>
</p>
</body></html>

View File

@ -424,9 +424,8 @@ public class MainFrame extends JFrame implements TestListener, Remoteable
mainPanel = createMainPanel();
treeAndMain.setRightComponent(mainPanel);
// The setResizeWeight() method was added to JDK1.3. For now, JMeter
// should remain compatible with JDK1.2.
//treeAndMain.setResizeWeight(.2);
treeAndMain.setResizeWeight(.2);
treeAndMain.setContinuousLayout(true);
all.add(treeAndMain, BorderLayout.CENTER);

View File

@ -70,8 +70,11 @@ import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.testelement.WorkBench;
import org.apache.jmeter.testelement.property.NullProperty;
import org.apache.jmeter.util.NameUpdater;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
/****************************************
* Title: JMeter Description: Copyright: Copyright (c) 2000 Company: Apache
*
@ -82,6 +85,7 @@ import org.apache.jorphan.collections.ListedHashTree;
public class JMeterTreeModel extends DefaultTreeModel
{
private static Logger log = LoggingManager.getLoggerForClass();
/****************************************
* !ToDo (Constructor description)
@ -168,6 +172,7 @@ public class JMeterTreeModel extends DefaultTreeModel
{
throw new IllegalUserActionException("This node cannot hold sub-elements");
}
component.setProperty(TestElement.GUI_CLASS,NameUpdater.getCurrentName(component.getPropertyAsString(TestElement.GUI_CLASS)));
JMeterGUIComponent guicomp = GuiPackage.getInstance().getGui(component);
guicomp.configure(component);
guicomp.modifyTestElement(component);

View File

@ -86,6 +86,7 @@ import org.apache.jmeter.testelement.property.JMeterProperty;
import org.apache.jmeter.testelement.property.MapProperty;
import org.apache.jmeter.testelement.property.TestElementProperty;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jmeter.util.NameUpdater;
import org.apache.jorphan.collections.HashTree;
import org.apache.jorphan.collections.ListedHashTree;
import org.apache.log.Hierarchy;
@ -823,7 +824,7 @@ public class SaveService implements SaveServiceConstants
{
TestElement element = null;
element = (TestElement) Class.forName((String) config.getAttribute("class")).newInstance();
element = (TestElement) Class.forName(NameUpdater.getCurrentName((String) config.getAttribute("class"))).newInstance();
Configuration[] children = config.getChildren();
for (int i = 0; i < children.length; i++)

View File

@ -96,7 +96,7 @@ import org.xml.sax.XMLReader;
*/
public class JMeterUtils implements UnitTestManager
{
private static final String VERSION="1.9.RC20030613";
private static final String VERSION="1.9.RC20030615";
private static PatternCacheLRU patternCache = new PatternCacheLRU(1000,new Perl5Compiler());
transient private static Logger log = LoggingManager.getLoggerForClass();
@ -993,3 +993,4 @@ public class JMeterUtils implements UnitTestManager

View File

@ -0,0 +1,48 @@
/*
* Created on Jun 13, 2003
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package org.apache.jmeter.util;
import java.io.FileInputStream;
import java.util.Properties;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;
/**
* @author ano ano
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class NameUpdater
{
private static Properties nameMap;
private static Logger log = LoggingManager.getLoggerForClass();
static{
nameMap = new Properties();
try
{
nameMap.load(new FileInputStream(JMeterUtils.getJMeterHome() + JMeterUtils.getPropDefault("upgrade_properties","/bin/upgrade.properties")));
}
catch (Exception e)
{
log.error("Bad upgrade file",e);
}
}
public static String getCurrentName(String guiName)
{
if(nameMap.containsKey(guiName))
{
return nameMap.getProperty(guiName);
}
return guiName;
}
}

View File

@ -64,6 +64,7 @@ import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import org.apache.jmeter.config.Argument;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.http.control.AuthManager;
import org.apache.jmeter.protocol.http.control.CookieManager;
@ -499,7 +500,15 @@ public class HTTPSampler extends AbstractSampler
boolean first = true;
while (iter.hasNext())
{
HTTPArgument item = (HTTPArgument) iter.next().getObjectValue();
HTTPArgument item = null;
try
{
item = (HTTPArgument) iter.next().getObjectValue();
}
catch(ClassCastException e)
{
item = new HTTPArgument((Argument)iter.next().getObjectValue());
}
if (!first)
{
buf.append("&");

View File

@ -53,6 +53,10 @@
* <http://www.apache.org/>.
*/
/*
* CVS Info: $Header$
*/
package org.apache.jmeter.protocol.java.test;
import java.io.Serializable;
@ -64,31 +68,38 @@ import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
/**
* The <code>JavaTest</code> class is a simple example class for a
* JMeter Java protocol client. The class implements the
* <code>JavaSamplerClient</code> interface.
* The <code>JavaTest</code> class is a simple sampler which
* is intended for use when developing test plans.
* The sampler generates results internally,
* so does not need access to any external
* resources such as web, ftp or LDAP servers.
* In addition, because the exact values of most of the SampleResult
* can be directly set, it is possible to easily test most Assertions that use
* the sample results.
*
* <p>
* During each sample, this client will sleep for some amount of
* time. The amount of time to sleep is determined from the
* two parameters SleepTime and SleepMask using the formula:
* two parameters Sleep_Time and Sleep_Mask using the formula:
* <pre>
* totalSleepTime = SleepTime + (System.currentTimeMillis() % SleepMask)
* totalSleepTime = Sleep_Time + (System.currentTimeMillis() % Sleep_Mask)
* </pre>
* Thus, the SleepMask provides a way to add a random component
* Thus, the Sleep_Mask provides a way to add a random component
* to the sleep time.
*
* This class was derived from SleepTest.
*
* The additional functionality is the ability to define the precise values of
* <p>
* The sampler is able to define the precise values of:
* <pre>
* - responseCode
* - responseMessage
* - Label
* - success/fail status
*
* - success/fail status
* </pre>
* The elapsed time and end-time cannot be directly controlled.
*<p>
* Note: this class was derived from {@link SleepTest}.
*
* @author ANO
* @version $Id$
* @version $Version: 1.3 $ $Date$
*/
public class JavaTest
extends AbstractJavaSamplerClient
@ -192,13 +203,43 @@ public class JavaTest
getLogger().debug(whoAmI() + "\tConstruct");
}
/*
* Utility method to set up all the values
*/
private void setupValues(JavaSamplerContext context){
sleepTime = context.getLongParameter(MASK_NAME, DEFAULT_SLEEP_TIME);
sleepMask = context.getLongParameter(SLEEP_NAME, DEFAULT_SLEEP_MASK);
responseMessage = context.getParameter(
RESPONSE_MESSAGE_NAME,
RESPONSE_MESSAGE_DEFAULT);
responseCode =
context.getParameter(RESPONSE_CODE_NAME, RESPONSE_CODE_DEFAULT);
success =
context.getParameter(
SUCCESS_NAME,
SUCCESS_DEFAULT).equalsIgnoreCase(
"OK");
label = context.getParameter(LABEL_NAME, LABEL_DEFAULT);
samplerData =
context.getParameter(SAMPLER_DATA_NAME, SAMPLER_DATA_DEFAULT);
resultData = context.getParameter(
RESULT_DATA_NAME,
RESULT_DATA_DEFAULT);
}
/**
* Do any initialization required by this client. In this case,
* initialization consists of getting the values of the SleepTime
* and SleepMask parameters. It is generally recommended to do
* any initialization such as getting parameter values in the
* setupTest method rather than the runTest method in order to
* add as little overhead as possible to the test.
* Do any initialization required by this client.
*
* There is none, as it is done in runTest() in order to be able
* to vary the data for each sample.
*
* @param context the context to run with. This provides access
* to initialization parameters.
@ -207,31 +248,6 @@ public class JavaTest
{
getLogger().debug(whoAmI() + "\tsetupTest()");
listParameters(context);
sleepTime = context.getLongParameter(MASK_NAME, DEFAULT_SLEEP_TIME);
sleepMask = context.getLongParameter(SLEEP_NAME, DEFAULT_SLEEP_MASK);
responseMessage = context.getParameter(
RESPONSE_MESSAGE_NAME,
RESPONSE_MESSAGE_DEFAULT);
responseCode =
context.getParameter(RESPONSE_CODE_NAME, RESPONSE_CODE_DEFAULT);
success =
context.getParameter(
SUCCESS_NAME,
SUCCESS_DEFAULT).equalsIgnoreCase(
"OK");
label = context.getParameter(LABEL_NAME, LABEL_DEFAULT);
samplerData =
context.getParameter(SAMPLER_DATA_NAME, SAMPLER_DATA_DEFAULT);
resultData = context.getParameter(
RESULT_DATA_NAME,
RESULT_DATA_DEFAULT);
}
@ -264,19 +280,31 @@ public class JavaTest
}
/**
* Perform a single sample. In this case, this method will
* simply sleep for some amount of time.
* <p>
* Perform a single sample.<br>
* In this case, this method will simply sleep for some amount of time.
*
* This method returns a <code>SampleResult</code> object.
* <code>SampleResult</code> has many fields which can be
* used. At a minimum, the test should use
* <code>SampleResult.setTime</code> to set the time that
* the test required to execute. It is also a good idea to
* set the sampleLabel and the successful flag.
* <pre>
* The following fields are always set:
* - responseCode (default "")
* - responseMessage (default "")
* - label (default "JavaTest")
* - success (default true)
* </pre>
* The following fields are set from the user-defined
* parameters, if supplied:
* <pre>
* - samplerData
* - responseData
* </pre>
*
* @see org.apache.jmeter.samplers.SampleResult#setTime(long)
* @see org.apache.jmeter.samplers.SampleResult#setSuccessful(boolean)
* @see org.apache.jmeter.samplers.SampleResult#setSampleLabel(String)
* @see org.apache.jmeter.samplers.SampleResult#setResponsCode(String)
* @see org.apache.jmeter.samplers.SampleResult#setResponseMessage(String)
* @see org.apache.jmeter.samplers.SampleResult#setResponseData(byte [])
* @see org.apache.jmeter.samplers.SampleResult#setDataType(String)
*
* @param context the context to run with. This provides access
* to initialization parameters.
@ -286,6 +314,8 @@ public class JavaTest
*/
public SampleResult runTest(JavaSamplerContext context)
{
setupValues(context);
SampleResult results = new SampleResult();
try

View File

@ -249,7 +249,7 @@
#macro ( component $component)
#set ($screenshot = "")
#set ($screenshot = "$sshotdir/$component.getAttributeValue('screenshot')" )
#set ($screenshot = $component.getAttributeValue('screenshot') )
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
@ -265,7 +265,7 @@
#runloop($c_items)
#if ($screenshot != "")
<p><b>Control Panel</b></p>
<div align="center"><img src="$screenshot"></div>
<div align="center"><img src="$sshotdir/$screenshot"></div>
#end
#else
#unknown($c_items)

View File

@ -243,7 +243,7 @@
#macro ( component $component)
#set ($screenshot = "")
#set ($screenshot = "$sshotdir/$component.getAttributeValue('screenshot')" )
#set ($screenshot = $component.getAttributeValue('screenshot') )
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
@ -254,9 +254,9 @@
#foreach ( $items in $component.getChildren() )
#if ($items.getName().equals("description"))
#runloop($items)
<p><b>Control Panel</b></p>
#if ($screenshot != "")
<div align="center"><img src="$screenshot"></div>
<p><b>Control Panel</b></p>
<div align="center"><img src="$sshotdir/$screenshot"></div>
#end
#else
#unknown($items)

View File

@ -287,12 +287,13 @@ POST content.</p>
<section name="13.2 Logic Controllers" anchor="logic_controllers">
<component index="13.2.1" name="Interleave Controller" screenshot="logic-controller/interleave-controller.gif">
<component index="13.2.1" name="Interleave Controller" screenshot="logic-controller/interleave-controller.png">
<description><p>If you add Generative or Logic Controllers to an Interleave Controller, JMeter will alternate among each of the
other controllers for each loop iteration. </p>
</description>
<properties>
<property name="name" required="No">Descriptive name for this controller that is shown in the tree.</property>
<property name="ignore sub-controller blocks" required="No">If checked, the interleave controller will treat sub-controllers like single request elements and only allow one request per controller at a time. </property>
</properties>
<!--
@ -348,8 +349,13 @@ two Interleave Controllers inside of it.</p>
<p>The outer Interleave Controller alternates between the
two inner ones. Then, each inner Interleave Controller alternates between each of the HTTP Requests. Each JMeter
thread will send the requests in the following order: Home Page, Bug Page, CVS Page, and FAQ Page.
thread will send the requests in the following order: Home Page, Interleaved, Bug Page, Interleaved, CVS Page, Interleaved, and FAQ Page, Interleaved.
Note, the File Reporter is configured to store the results in a file named "interleave-test2.dat" in the current directory.</p>
<figure image="logic-controller/interleave3.png">
Figure 3 - Interleave Controller Example 3
</figure>
<p>If the two interleave controllers under the main interleave controller were instead simple controllers, then the order would be: Home Page, CVS Page, Interleaved, Bug Page, FAQ Page, Interleaved. However, if "ignore sub-controller blocks" was checked on the main interleave controller, then the order would be: Home Page, Interleaved, Bug Page, Interleaved, CVS Page, Interleaved, and FAQ Page, Interleaved.</p>
</example>
</component>