TCP sampler now calls setupTest() and teardownTest() methods

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/trunk@711614 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2008-11-05 16:55:29 +00:00
parent ed49a75e84
commit d89a1ea71e
3 changed files with 14 additions and 0 deletions

View File

@ -31,8 +31,15 @@ import java.io.OutputStream;
* Interface required by TCPSampler for TCPClient implementations.
*/
public interface TCPClient {
/**
* Versions of JMeter after 2.3.2 invoke this method when the thread starts.
*/
void setupTest();
/**
* Versions of JMeter after 2.3.2 invoke this method when the thread ends.
*/
void teardownTest();
/**

View File

@ -368,6 +368,9 @@ public class TCPSampler extends AbstractSampler implements ThreadListener {
protocolHandler = getProtocol();
log.debug("Using Protocol Handler: " + //$NON-NLS-1$
(protocolHandler == null ? "NONE" : protocolHandler.getClass().getName())); //$NON-NLS-1$
if (protocolHandler != null){
protocolHandler.setupTest();
}
}
private void closeSocket() {
@ -386,5 +389,8 @@ public class TCPSampler extends AbstractSampler implements ThreadListener {
public void threadFinished() {
log.debug("Thread Finished"); //$NON-NLS-1$
closeSocket();
if (protocolHandler != null){
protocolHandler.teardownTest();
}
}
}

View File

@ -145,6 +145,7 @@ These are implemented in the AbstractTestElement class which all elements should
<li>CSVSaveService - check for EOF while reading quoted string</li>
<li>Bug 46142 - JMS Receiver now uses MessageID</li>
<li>Bug 46148 - HTTP sampler fails on SSL requests when logging for jmeter.util is set to DEBUG</li>
<li>TCP sampler now calls setupTest() and teardownTest() methods</li>
</ul>
<h3>Improvements</h3>