mondrianDataFactory.initialize(new DesignTimeDataFactoryContext());
mondrianDataFactory.setQuery("default", PARAMETRIZED_QUERY, null, null);
final DataFactoryMetaData metaData = mondrianDataFactory.getMetaData();
final Object queryHash = metaData.getQueryHash(mondrianDataFactory, "default", new StaticDataRow());
assertNotNull(queryHash);
final BandedMDXDataFactory mdxDataFactory = new BandedMDXDataFactory(createProvider());
mdxDataFactory.initialize(new DesignTimeDataFactoryContext());
mdxDataFactory.setQuery("default", QUERY, null, null);
mdxDataFactory.setQuery("default2", PARAMETRIZED_QUERY, null, null);
assertNotEquals("Physical Query is not the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default", new StaticDataRow()));
assertEquals("Physical Query is the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default2", new StaticDataRow()));
final DriverConnectionProvider connectionProvider = createProvider();
connectionProvider.setProperty("Catalog",
"test/org/pentaho/reporting/engine/classic/extensions/datasources/olap4j/steelwheels2.mondrian.xml");
final BandedMDXDataFactory mdxDataFactory2 = new BandedMDXDataFactory(connectionProvider);
mdxDataFactory2.initialize(new DesignTimeDataFactoryContext());
mdxDataFactory2.setQuery("default", QUERY, null, null);
mdxDataFactory2.setQuery("default2", PARAMETRIZED_QUERY, null, null);
assertNotEquals("Physical Connection is not the same", queryHash, metaData.getQueryHash(mdxDataFactory, "default", new StaticDataRow()));
assertNotEquals("Physical Connection is the same", queryHash, metaData.getQueryHash(mdxDataFactory2, "default2", new StaticDataRow()));
}