super(s);
}
public void testMetaDataJndi()
{
final JndiConnectionProvider drc = new JndiConnectionProvider();
drc.setConnectionPath("sampledata");
final SQLReportDataFactory sqlReportDataFactory = new SQLReportDataFactory(drc);
final DataFactoryMetaData metaData = sqlReportDataFactory.getMetaData();
assertEquals("Name property set, so display name must be test",
"sampledata", metaData.getDisplayConnectionName(sqlReportDataFactory));
sqlReportDataFactory.setQuery("test", "SELECT * FROM TABLE");
assertNotNull("QueryHash must exist",
metaData.getQueryHash(sqlReportDataFactory, "test", new StaticDataRow()));
final SQLReportDataFactory sqlReportDataFactory2 = new SQLReportDataFactory(drc);
sqlReportDataFactory2.setQuery("test", "SELECT * FROM TABLE2");
assertNotEquals("Physical Queries do not match, so query hash must be different",
metaData.getQueryHash(sqlReportDataFactory, "test", new StaticDataRow()),
(metaData.getQueryHash(sqlReportDataFactory2, "test", new StaticDataRow())));
sqlReportDataFactory2.setQuery("test2", "SELECT * FROM TABLE");
final Object qh1 = metaData.getQueryHash(sqlReportDataFactory, "test", new StaticDataRow());
final Object qh2 = metaData.getQueryHash(sqlReportDataFactory2, "test2", new StaticDataRow());
assertEquals("Physical Queries match, so queries are considered the same", qh1, qh2);
final JndiConnectionProvider drc2 = new JndiConnectionProvider();
drc.setConnectionPath("sampledata2");
final SQLReportDataFactory sqlReportDataFactory3 = new SQLReportDataFactory(drc2);
sqlReportDataFactory3.setQuery("test", "SELECT * FROM TABLE2");
assertNotEquals("Connections do not match, so query hash must be different",
metaData.getQueryHash(sqlReportDataFactory, "test", new StaticDataRow()),