ResultSetUtils.union(rs1, rs2) ;
}
private void test_RS_fmt(ResultSet rs, ResultsFormat fmt, boolean ordered)
{
ResultSetRewindable rs1 = ResultSetFactory.makeRewindable(rs) ;
ByteArrayOutputStream arr = new ByteArrayOutputStream() ;
ResultSetFormatter.output(arr, rs1, fmt) ;
byte bytes[] = arr.toByteArray() ;
rs1.reset() ;
ByteArrayInputStream ins = new ByteArrayInputStream(bytes) ;
ResultSetRewindable rs2 = ResultSetFactory.makeRewindable(ResultSetFactory.load(ins, fmt)) ;
// Ordered? Unordered?
boolean b = ResultSetCompare.equalsByTerm(rs1, rs2) ;
if ( ordered )
{
rs1.reset() ;
rs2.reset() ;
b = b & ResultSetCompare.equalsByTerm(rs1, rs2) ;
}
if ( !b )
{
System.out.println(new String(bytes)) ;
rs1.reset() ;
rs2.reset() ;
ResultSetFormatter.out(rs1) ;
ResultSetFormatter.out(rs2) ;
}
assertTrue(b) ;