HHH-11271 : Add CacheTestUtil#sfOptionsForStart

This commit is contained in:
Gail Badner 2017-01-17 16:03:48 -05:00
parent a6ea139539
commit 0b99d306a4
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,7 @@ import org.hibernate.boot.internal.SessionFactoryBuilderImpl;
import org.hibernate.boot.internal.SessionFactoryOptionsImpl;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.cache.infinispan.InfinispanRegionFactory;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Environment;
@ -28,6 +29,7 @@ import org.hibernate.internal.util.compare.EqualsHelper;
import org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl;
import org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.testing.boot.ServiceRegistryTestingImpl;
/**
* Utilities for cache testing.
@ -203,6 +205,14 @@ public class CacheTestUtil {
throw new TimeoutException();
}
public static SessionFactoryOptions sfOptionsForStart() {
return new SessionFactoryOptionsImpl(
new SessionFactoryBuilderImpl.SessionFactoryOptionsStateStandardImpl(
ServiceRegistryTestingImpl.forUnitTesting()
)
);
}
/**
* Prevent instantiation.
*/