use of infoeval.main.mysql.Row in project Info-Evaluation by TechnionYP5777.
the class SqlTablesFillerTest method basicInfoTableSizeTest.
@Ignore
@Test
public void basicInfoTableSizeTest() throws Exception {
Connector conn = new Connector();
ArrayList<Row> rows = conn.runQuery("SELECT COUNT(*) FROM basic_info");
Row row = rows.get(0);
Entry<Object, Class> col = row.row.get(0);
assertEquals(ENTRIES_NUM, (long) col.getValue().cast(col.getKey()));
}
use of infoeval.main.mysql.Row in project Info-Evaluation by TechnionYP5777.
the class QueryResultsSerializerTest method serializeANDdeSerializeTest.
@Ignore
@Test
@SuppressWarnings("unchecked")
public void serializeANDdeSerializeTest() throws Exception {
int serialized_id = -1;
String query_identifier = "testQuery";
ArrayList<Row> rows = new ArrayList<Row>();
Row row1 = new Row();
row1.add(1, "integer");
Row row2 = new Row();
row2.add(2, "integer");
Row row3 = new Row();
row3.add(3, "integer");
rows.add(row1);
rows.add(row2);
rows.add(row3);
serialized_id = resultsSer.serializeQueryResults(connector, query_identifier, rows);
ArrayList<Row> result = (ArrayList<Row>) resultsSer.deSerializeQueryResults(connector, serialized_id);
int i = 1;
for (Row r : result) {
int val = (int) r.row.get(0).getValue().cast(r.row.get(0).getKey());
assertEquals(val, i);
++i;
}
connector.close();
}
use of infoeval.main.mysql.Row in project Info-Evaluation by TechnionYP5777.
the class ConnectorTest method wikiIdTableSizeTest.
@Ignore
@Test
public void wikiIdTableSizeTest() throws Exception {
Connector conn = new Connector();
assert conn.getConnection() != null;
ArrayList<Row> rows = conn.runQuery("SELECT COUNT(*) FROM WikiID");
Row row = rows.get(0);
Entry<Object, Class> col = row.row.get(0);
Object size = col.getValue().cast(col.getKey());
assertEquals(ENTRIES_NUM, size);
Extractor ext = new Extractor();
ext.executeQuery(QueryTypes.WIKI_ID);
assertEquals(ext.getResults().size(), size);
conn.close();
}
Aggregations