jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Abram Catalano <>
Subject Re: JDBC response assertions
Date Mon, 07 Jan 2008 23:58:17 GMT
 > This can get complicated, so it might be useful to extend the JDBC 
sampler to make such checks easier.
Yeah, I'm not bad at regex, but I'd rather deal with columns, values and 
newlines as structured data.

 > Bugzilla can be used for enhancement requests too ... but it might be 
best to discuss the proposal on JMeter user first. I'll start a thread 
if no-one beats me to it.

What I've done locally here is add 1) "rawResponseData" to 2) add res.setRawResponseData(data) in JDBCSampler.  
Code below.  There are a bunch of cases I didn't catch with this  (when 
_queryType != SELECT).

 if (SELECT.equals(_queryType)) {
                stmt = conn.createStatement();
                ResultSet rs = null;
                try {
                    rs = stmt.executeQuery(getQuery());
                    Data data = getDataFromResultSet(rs);
                } finally {

Then, I have the rawResponseData Data object available in BeanShell.  
Quick example:

 (BeanShell code)

import org.apache.jorphan.collections.*;
header = SampleResult.getRawResponseData().getHeaders();
System.out.println("header length = "+header.length);

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

View raw message