29
29
import org .junit .Test ;
30
30
import org .logicalcobwebs .proxool .ProxoolFacade ;
31
31
32
- import org .hibernate .boot .registry .StandardServiceRegistry ;
33
- import org .hibernate .boot .registry .StandardServiceRegistryBuilder ;
34
32
import org .hibernate .cfg .Environment ;
35
- import org .hibernate .engine .jdbc .connections .spi .ConnectionProvider ;
33
+ import org .hibernate .service .ServiceRegistry ;
34
+ import org .hibernate .service .ServiceRegistryBuilder ;
35
+ import org .hibernate .service .internal .StandardServiceRegistryImpl ;
36
+ import org .hibernate .service .jdbc .connections .spi .ConnectionProvider ;
36
37
import org .hibernate .testing .junit4 .BaseUnitTestCase ;
37
38
38
39
import static org .junit .Assert .assertEquals ;
@@ -50,19 +51,18 @@ public class ProxoolConnectionProviderTest extends BaseUnitTestCase {
50
51
@ Test
51
52
public void testPoolsClosed () {
52
53
assertDefinedPools (); // zero-length-vararg used as parameter
53
- StandardServiceRegistry serviceRegistry = buildServiceRegistry ( "pool-one" );
54
+ StandardServiceRegistryImpl serviceRegistry = ( StandardServiceRegistryImpl ) buildServiceRegistry ( "pool-one" );
54
55
ConnectionProvider providerOne = serviceRegistry .getService ( ConnectionProvider .class );
55
56
assertDefinedPools ( "pool-one" );
56
57
57
58
58
- StandardServiceRegistry serviceRegistryTwo = buildServiceRegistry ( "pool-two" );
59
+ StandardServiceRegistryImpl serviceRegistryTwo = ( StandardServiceRegistryImpl ) buildServiceRegistry ( "pool-two" );
59
60
ConnectionProvider providerTwo = serviceRegistryTwo .getService ( ConnectionProvider .class );
60
61
assertDefinedPools ( "pool-one" , "pool-two" );
61
-
62
- StandardServiceRegistryBuilder .destroy ( serviceRegistry );
62
+ serviceRegistry .destroy ();
63
63
assertDefinedPools ( "pool-two" );
64
64
65
- StandardServiceRegistryBuilder .destroy ( serviceRegistryTwo );
65
+ serviceRegistryTwo .destroy ();
66
66
assertDefinedPools ();
67
67
}
68
68
@@ -75,13 +75,13 @@ private void assertDefinedPools(String... expectedPoolNames) {
75
75
}
76
76
77
77
78
- private StandardServiceRegistry buildServiceRegistry (String poolName ){
78
+ private ServiceRegistry buildServiceRegistry (String poolName ){
79
79
80
- return new StandardServiceRegistryBuilder ( )
80
+ return new ServiceRegistryBuilder ( )
81
81
.applySetting ( Environment .PROXOOL_POOL_ALIAS , poolName )
82
82
.applySetting ( Environment .PROXOOL_PROPERTIES , poolName + ".properties" )
83
83
.applySetting ( Environment .CONNECTION_PROVIDER , ProxoolConnectionProvider .class .getName () )
84
- .build ();
84
+ .buildServiceRegistry ();
85
85
86
86
}
87
87
}
0 commit comments