pmdDataFactory.setDomainId("steel-wheels");
pmdDataFactory.initialize(new DesignTimeDataFactoryContext());
pmdDataFactory.setQuery("default", PARAMETRIZED_QUERY, null, null);
final DataFactoryMetaData metaData = pmdDataFactory.getMetaData();
final Object queryHash = metaData.getQueryHash(pmdDataFactory, "default", new StaticDataRow());
assertNotNull(queryHash);
final PmdDataFactory pmdDataFactory2 = new PmdDataFactory();
pmdDataFactory2.setConnectionProvider(new PmdConnectionProvider());
pmdDataFactory2.setXmiFile("devresource/metadata/metadata.xmi");
pmdDataFactory2.setDomainId("steel-wheels");
pmdDataFactory2.initialize(new DesignTimeDataFactoryContext());
pmdDataFactory2.setQuery("default", QUERY, null, null);
pmdDataFactory2.setQuery("default2", PARAMETRIZED_QUERY, null, null);
assertNotEquals("Physical Query is not the same", queryHash, metaData.getQueryHash(pmdDataFactory2, "default", new StaticDataRow()));
assertEquals("Physical Query is the same", queryHash, metaData.getQueryHash(pmdDataFactory2, "default2", new StaticDataRow()));
final PmdDataFactory pmdDataFactory3 = new PmdDataFactory();
pmdDataFactory3.setConnectionProvider(new PmdConnectionProvider());
pmdDataFactory3.setXmiFile("devresource/metadata/metadata.xmi");
pmdDataFactory3.setDomainId("steel-wheels2");
pmdDataFactory3.setQuery("default", QUERY, null, null);
pmdDataFactory3.setQuery("default2", PARAMETRIZED_QUERY, null, null);
assertNotEquals("Physical Connection is not the same", queryHash, metaData.getQueryHash(pmdDataFactory3, "default", new StaticDataRow()));
assertNotEquals("Physical Connection is the same", queryHash, metaData.getQueryHash(pmdDataFactory3, "default2", new StaticDataRow()));
final PmdDataFactory pmdDataFactory4 = new PmdDataFactory();
pmdDataFactory4.setConnectionProvider(new PmdConnectionProvider());
pmdDataFactory4.setXmiFile("devresource/metadata/metadata2.xmi");
pmdDataFactory4.setDomainId("steel-wheels");
pmdDataFactory4.setQuery("default", QUERY, null, null);
pmdDataFactory4.setQuery("default2", PARAMETRIZED_QUERY, null, null);
assertNotEquals("Physical Connection is not the same", queryHash, metaData.getQueryHash(pmdDataFactory4, "default", new StaticDataRow()));
assertNotEquals("Physical Connection is the same", queryHash, metaData.getQueryHash(pmdDataFactory4, "default2", new StaticDataRow()));
}