javasamplerclient.html

来自「测试工具jmeter可用来进行性能测试」· HTML 代码 · 共 347 行 · 第 1/2 页

HTML
347
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc -->
<TITLE>
JavaSamplerClient (Apache JMeter API)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.jmeter.protocol.java.sampler.JavaSamplerClient interface">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="JavaSamplerClient (Apache JMeter API)";
}
</SCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<b>Apache JMeter</b></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="JavaSamplerClient.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>

</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.jmeter.protocol.java.sampler</FONT>
<BR>
Interface JavaSamplerClient</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/AbstractJavaSamplerClient.html" title="class in org.apache.jmeter.protocol.java.sampler">AbstractJavaSamplerClient</A></DD>
</DL>
<HR>
<DL>
<DT>public interface <B>JavaSamplerClient</B></DL>

<P>
This interface defines the interactions between the JavaSampler and external
 Java programs which can be executed by JMeter. Any Java class which wants to
 be executed as a JMeter test must implement this interface (either directly
 or indirectly through AbstractJavaSamplerClient).
 <p>
 JMeter will create one instance of a JavaSamplerClient implementation for
 each user/thread in the test. Additional instances may be created for
 internal use by JMeter (for example, to find out what parameters are
 supported by the client).
 <p>
 When the test is started, setupTest() will be called on each thread's
 JavaSamplerClient instance to initialize the client. Then runTest() will be
 called for each iteration of the test. Finally, teardownTest() will be called
 to allow the client to do any necessary clean-up.
 <p>
 The JMeter JavaSampler GUI allows a list of parameters to be defined for the
 test. These are passed to the various test methods through the
 <A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/JavaSamplerContext.html" title="class in org.apache.jmeter.protocol.java.sampler"><CODE>JavaSamplerContext</CODE></A>. A list of default parameters can be defined
 through the getDefaultParameters() method. These parameters and any default
 values associated with them will be shown in the GUI. Users can add other
 parameters as well.
 <p>
 When possible, Java tests should extend <A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/AbstractJavaSamplerClient.html" title="class in org.apache.jmeter.protocol.java.sampler"><CODE>AbstractJavaSamplerClient</CODE></A> rather than implementing JavaSamplerClient
 directly. This should protect your tests from future changes to the
 interface. While it may be necessary to make changes to the JavaSamplerClient
 interface from time to time (therefore requiring changes to any
 implementations of this interface), we intend to make this abstract class
 provide reasonable default implementations of any new methods so that
 subclasses do not necessarily need to be updated for new versions.
 Implementing JavaSamplerClient directly will continue to be supported for
 cases where extending this class is not possible (for example, when the
 client class is already a subclass of some other class).
 <p>
 See <A HREF="../../../../../../org/apache/jmeter/protocol/java/test/SleepTest.html" title="class in org.apache.jmeter.protocol.java.test"><CODE>SleepTest</CODE></A> for an example of
 how to implement this interface.
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Revision: 493789 $</DD>
<DT><B>Author:</B></DT>
  <DD>Brad Kiewel, <a href="mailto:jeremy_a@bigfoot.com">Jeremy Arnold</a></DD>
</DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->


<!-- ======== CONSTRUCTOR SUMMARY ======== -->


<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/jmeter/config/Arguments.html" title="class in org.apache.jmeter.config">Arguments</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.html#getDefaultParameters()">getDefaultParameters</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provide a list of parameters which this test supports. </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../../org/apache/jmeter/samplers/SampleResult.html" title="class in org.apache.jmeter.samplers">SampleResult</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/JavaSamplerClient.html#runTest(org.apache.jmeter.protocol.java.sampler.JavaSamplerContext)">runTest</A></B>(<A HREF="../../../../../../org/apache/jmeter/protocol/java/sampler/JavaSamplerContext.html" title="class in org.apache.jmeter.protocol.java.sampler">JavaSamplerContext</A>&nbsp;context)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perform a single sample for each iteration. </TD>
</TR>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?