HHH-10119 - Config setting names loaded from cfg.xml stored in augmented (prefixed with "hibernate.") form but not original form

(cherry picked from commit 0f5139b60a)
This commit is contained in:
Steve Ebersole 2015-09-24 11:57:49 -05:00
parent 8fde7229fe
commit 4181768650
1 changed files with 12 additions and 1 deletions

View File

@ -8,11 +8,13 @@ package org.hibernate.test.boot.cfgXml;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.engine.config.spi.ConfigurationService;
import org.hibernate.internal.util.config.ConfigurationException;
import org.hibernate.testing.junit4.BaseUnitTestCase;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
/**
@ -24,7 +26,16 @@ public class CfgXmlParsingTest extends BaseUnitTestCase {
StandardServiceRegistry ssr = new StandardServiceRegistryBuilder()
.configure( "org/hibernate/test/boot/cfgXml/hibernate.cfg.xml" )
.build();
StandardServiceRegistryBuilder.destroy( ssr );
try {
final ConfigurationService cs = ssr.getService( ConfigurationService.class );
// augmented form
assertNotNull( cs.getSettings().get( "hibernate.cache.provider_class" ) );
// original form
assertNotNull( cs.getSettings().get( "cache.provider_class" ) );
}
finally {
StandardServiceRegistryBuilder.destroy( ssr );
}
}
@Test(expected = ConfigurationException.class )