https://issues.apache.org/bugzilla/show_bug.cgi?id=50569

--- Comment #2 from [email protected] 2011-01-12 03:33:53 EST ---
I am using JMeter for functional testing of our messaging server, so I send a
tcp request and then afterwards check the response message against a database
record and this for different supported dbms.

I ran into problems comparing floating point types (floats: legacy use which I
can't change). So I created the patch to see if I can get better results when
working with the actual objects. It also makes it easier to write validation
code outside of jmeter that I can call from BeanShell.

On review I noticed that I used:
List<HashMap<String, Object> > results = null;

Instead of the Map interface:
List<Map<String, Object> > results

So I will upload a new patch reflecting that.

Here follows an example:
-----------------------
*** Jdbc Request Sampler ***
Query:select vendor_name, vendor_balance from vendor where vendor_id =
${vendorId}
Result variable name:resultList

*** BeanShell Assertion ***
(child to the Jdbc Request Sampler)
Script:
//----------------------------------------
list = vars.getObject("resultList"); // This is a List<Map<String, Object> >
print("resultList=" + list);

map = list.get(0); // get first row results, should only be one row,
Map<String,Object>
vendorName = map.get("vendor_name");
vendorBalance = map.get("vendor_balance");
if(!vendorBalance.equals(expectedBalance)) {
  Failure = true;
  FailureMessage = "TEST FAILED: vendor=" + vendorName + ",balance=" +
",expectedBalance=" + expectedBalance;
}
//----------------------------------------

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to