String.class );
Iterator<QueryResultsRow> it1 = ksession.getQueryResults( "cheeses" ).iterator();
Iterator<QueryResultsRow> it2 = ksession.getQueryResults( "cheesesWithParams",
new String[]{"stilton", "cheddar"} ).iterator();
QueryResultsRow row = null;
String expectedXml = "";
expectedXml += "<execution-results>\n";
expectedXml += " <result identifier='cheeses'>\n";
expectedXml += " <query-results>\n";
expectedXml += " <identifiers>\n";
expectedXml += " <identifier>stilton</identifier>\n";
expectedXml += " <identifier>cheddar</identifier>\n";
expectedXml += " </identifiers>\n";
expectedXml += " <row>\n";
row = it1.next();
expectedXml += " <org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <type>stilton</type>\n";
expectedXml += " <price>1</price>\n";
expectedXml += " <oldPrice>0</oldPrice>\n";
expectedXml += " </org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "stilton" ).toExternalForm() + "' />";
expectedXml += " <org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <type>cheddar</type>\n";
expectedXml += " <price>1</price>\n";
expectedXml += " <oldPrice>0</oldPrice>\n";
expectedXml += " </org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "cheddar" ).toExternalForm() + "' />";
expectedXml += " </row>\n";
expectedXml += " <row>\n";
row = it1.next();
expectedXml += " <org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <type>stilton</type>\n";
expectedXml += " <price>2</price>\n";
expectedXml += " <oldPrice>0</oldPrice>\n";
expectedXml += " </org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "stilton" ).toExternalForm() + "' />";
expectedXml += " <org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <type>cheddar</type>\n";
expectedXml += " <price>2</price>\n";
expectedXml += " <oldPrice>0</oldPrice>\n";
expectedXml += " </org.drools.camel.testdomain.Cheese>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "cheddar" ).toExternalForm() + "' />";
expectedXml += " </row>\n";
expectedXml += " </query-results>\n";
expectedXml += " </result>\n";
expectedXml += " <result identifier='cheeses2'>\n";
expectedXml += " <query-results>\n";
expectedXml += " <identifiers>\n";
expectedXml += " <identifier>stilton</identifier>\n";
expectedXml += " <identifier>cheddar</identifier>\n";
expectedXml += " </identifiers>\n";
expectedXml += " <row>\n";
row = it2.next();
expectedXml += " <org.drools.camel.testdomain.Cheese reference=\"../../../../result/query-results/row/org.drools.camel.testdomain.Cheese\"/>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "stilton" ).toExternalForm() + "' />";
expectedXml += " <org.drools.camel.testdomain.Cheese reference=\"../../../../result/query-results/row/org.drools.camel.testdomain.Cheese[2]\"/>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "cheddar" ).toExternalForm() + "' />";
expectedXml += " </row>\n";
expectedXml += " <row>\n";
row = it2.next();
expectedXml += " <org.drools.camel.testdomain.Cheese reference=\"../../../../result/query-results/row[2]/org.drools.camel.testdomain.Cheese\"/>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "stilton" ).toExternalForm() + "' />";
expectedXml += " <org.drools.camel.testdomain.Cheese reference=\"../../../../result/query-results/row[2]/org.drools.camel.testdomain.Cheese[2]\"/>\n";
expectedXml += " <fact-handle external-form='" + row.getFactHandle( "cheddar" ).toExternalForm() + "' />";
expectedXml += " </row>\n";
expectedXml += " </query-results>\n";
expectedXml += " </result>\n";
expectedXml += "</execution-results>\n";