Search in sources :

Example 26 with BootstrapServiceRegistry

use of org.hibernate.boot.registry.BootstrapServiceRegistry in project hibernate-orm by hibernate.

the class DeprecationLoggingTest method basicTest.

@Test
public void basicTest() {
    logInspection.registerListener(LogListenerImpl.INSTANCE);
    MetadataSources metadataSources = new MetadataSources().addResource("org/hibernate/test/entitymode/dom4j/Car.hbm.xml");
    try {
        metadataSources.buildMetadata();
    } finally {
        ServiceRegistry metaServiceRegistry = metadataSources.getServiceRegistry();
        if (metaServiceRegistry instanceof BootstrapServiceRegistry) {
            BootstrapServiceRegistryBuilder.destroy(metaServiceRegistry);
        }
    }
}
Also used : MetadataSources(org.hibernate.boot.MetadataSources) BootstrapServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry) ServiceRegistry(org.hibernate.service.ServiceRegistry) BootstrapServiceRegistry(org.hibernate.boot.registry.BootstrapServiceRegistry) Test(org.junit.Test)

Aggregations

BootstrapServiceRegistry (org.hibernate.boot.registry.BootstrapServiceRegistry)26 Test (org.junit.Test)18 MetadataSources (org.hibernate.boot.MetadataSources)16 ServiceRegistry (org.hibernate.service.ServiceRegistry)14 BootstrapServiceRegistryBuilder (org.hibernate.boot.registry.BootstrapServiceRegistryBuilder)11 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)11 Metadata (org.hibernate.boot.Metadata)5 MappingException (org.hibernate.MappingException)4 StandardServiceRegistry (org.hibernate.boot.registry.StandardServiceRegistry)4 TestForIssue (org.hibernate.testing.TestForIssue)4 FileInputStream (java.io.FileInputStream)3 Properties (java.util.Properties)3 AnnotationException (org.hibernate.AnnotationException)3 File (java.io.File)2 MetadataBuilder (org.hibernate.boot.MetadataBuilder)2 Configuration (org.hibernate.cfg.Configuration)2 Integrator (org.hibernate.integrator.spi.Integrator)2 InputStream (java.io.InputStream)1 OutputStreamWriter (java.io.OutputStreamWriter)1 HashMap (java.util.HashMap)1