jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gardner, Chris" <>
Subject RE: JavaSampler.teardownTest() not being called
Date Fri, 04 Apr 2003 21:18:16 GMT
I downloaded the 20030331 build.  I have a test plan that has 1 thread
but loops three times. 
The order of setupTest(), runTest(), and teardownTest() is interesting: 

BookCreationSampler.setupTest(JavaSamplerContext javaSamplerContext) 
BookCreationSampler.runTest(JavaSamplerContext javaSamplerContext) 
BookCreationSampler.setupTest(JavaSamplerContext javaSamplerContext) 
BookCreationSampler.setupTest(JavaSamplerContext javaSamplerContext) 

Note that createBook() is called within runTest().  Why is setupTest()
being called before each loop, but teardownTest() called is after the
all the loops have completed?  I guess I was expected the JUnit paradigm
of setUp(), test(), tearDown().

-----Original Message----- 
From: Jeremy Arnold [
<> ] 
Sent: Thursday, April 03, 2003 1:35 PM 
To: JMeter Users List 
Subject: Re: JavaSampler.teardownTest() not being called 

    The JavaSampler was broken in 1.8.1 (and earlier versions -- I don't

know the whole history, but I don't think it has ever worked quite the 
way you would expect it to).  The good news is that it has been fixed in

the last month or so.  So if you're willing to use a recent nightly 
build or pull it from CVS then it should work for you. 

    Note, however, that the API has also changed a bit, so you'll have 
to make a few modifications to your JavaSamplerClient implementation.  
They are pretty simple changes though.  Take a look at the new code and the JavaDoc for 
some tips on how to do it.  Finally, you shouldn't have been extending 
JavaSampler (not that it would have made a difference).  So you will 
need to change it to extend the new AbstractJavaSamplerClient (or 
implement the JavaSamplerClient interface directly). 

    Let me know if you have any questions. 


Gardner, Chris wrote: 

>In jmeter 1.8.1 on Windows 2K, I've created a class that extends 
>JavaSampler to call a Java object.  I overrode teardownTest() to remove

>the data from a database that the called Java object effectively 
>inserted.  Unfortunately, teardownTest() is not being called.  What am
>doing wrong? 
>Chris Gardner 

To unsubscribe, e-mail: 
For additional commands, e-mail: 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message