cfg.setProperty(Environment.USE_QUERY_CACHE, "true");
cfg.setProperty(Environment.CACHE_REGION_FACTORY,
"org.hibernate.test.cache.infinispan.functional.SingleNodeTestCase$TestInfinispanRegionFactory");
Properties envProps = Environment.getProperties();
envProps.put(AvailableSettings.JTA_PLATFORM, new JBossStandAloneJtaPlatform());
serviceRegistry = ServiceRegistryBuilder.buildServiceRegistry(envProps);
String[] mappings = new String[]{"org/hibernate/test/cache/infinispan/functional/Item.hbm.xml"};
for (String mapping : mappings) {
cfg.addResource(mapping, Thread.currentThread().getContextClassLoader());