mondrianDataFactory.setJdbcPassword("");
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();
mdxDataFactory.setCubeFileProvider(new DefaultCubeFileProvider
("test/org/pentaho/reporting/engine/classic/extensions/datasources/mondrian/steelwheels.mondrian.xml"));
mdxDataFactory.setDataSourceProvider(provider);
mdxDataFactory.setJdbcUser("sa");
mdxDataFactory.setJdbcPassword("");
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 BandedMDXDataFactory mdxDataFactory2 = new BandedMDXDataFactory();
mdxDataFactory2.setCubeFileProvider(new DefaultCubeFileProvider
("test/org/pentaho/reporting/engine/classic/extensions/datasources/mondrian/steelwheels2.mondrian.xml"));
mdxDataFactory2.setDataSourceProvider(provider);
mdxDataFactory2.setJdbcUser("sa");
mdxDataFactory2.setJdbcPassword("");
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()));
}