@Override protected void verifyRows(AmbitRows<Object> rows) throws Exception { IDatabaseConnection c = getConnection(); Assert.assertNotNull(rows); Assert.assertEquals(1, rows.size()); while (rows.next()) { ITable table = c.createQueryTable( "EXPECTED", "select name,idreference,idproperty,idstructure,ifnull(text,value) as value_string,value_num,title,url,-1,id,units,comments from property_values \n" + "left join property_string using(idvalue_string) \n" + "join properties using(idproperty) join catalog_references using(idreference) \n" + "where idstructure=100215 and name='Property 1' " /* "select name,idreference,idproperty,idstructure,value_string,value_num,idtype from properties join\n"+ "(\n"+ "select idstructure,idproperty,null as value_string,value as value_num,1 as idtype from values_number where idstructure=100215\n"+ "union\n"+ "select idstructure,idproperty,value as value_string,null,0 as idtype from values_string where idstructure=100215\n"+ ") as L using (idproperty)\nwhere name='Property 1'" */ ); Assert.assertEquals(1, table.getRowCount()); for (int i = 1; i <= rows.getMetaData().getColumnCount(); i++) { Object expected = table.getValue(0, rows.getMetaData().getColumnName(i)); Object actual = rows.getObject(i); if ((expected == null) && (actual == null)) continue; else Assert.assertEquals(expected.toString(), actual.toString()); } } }
@Override protected void verifyRows(AmbitRows<IStructureRecord> rows) throws Exception { // IDatabaseConnection c = getConnection(); Assert.assertNotNull(rows); // Assert.assertEquals(4,rows.size()); while (rows.next()) { IStructureRecord r = rows.getObject(); logger.fine(r.toString()); for (Property p : r.getProperties()) { logger.fine(p.toString()); logger.fine(r.getProperty(p).toString()); } } }