fix test fallout from rebase
update test to jakarta package name and refix moved tests
This commit is contained in:
parent
8f7e0c4c2f
commit
6d43d62a5a
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
package org.hibernate.orm.test.multitenancy;
|
||||
|
||||
import org.hibernate.MultiTenancyStrategy;
|
||||
import org.hibernate.boot.MetadataSources;
|
||||
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
|
||||
import org.hibernate.cfg.Environment;
|
||||
|
@ -31,7 +30,6 @@ public class ConfigurationValidationTest extends BaseUnitTestCase {
|
|||
ServiceRegistryImplementor serviceRegistry = null;
|
||||
try {
|
||||
serviceRegistry = (ServiceRegistryImplementor) new StandardServiceRegistryBuilder()
|
||||
.applySetting( Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA )
|
||||
.applySetting( Environment.MULTI_TENANT_CONNECTION_PROVIDER, "class.not.present.in.classpath" )
|
||||
.build();
|
||||
|
||||
|
@ -53,7 +51,6 @@ public class ConfigurationValidationTest extends BaseUnitTestCase {
|
|||
ServiceRegistryImplementor serviceRegistry = null;
|
||||
try {
|
||||
serviceRegistry = (ServiceRegistryImplementor) new StandardServiceRegistryBuilder()
|
||||
.applySetting( Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA )
|
||||
.applySetting( Environment.CONNECTION_HANDLING, PhysicalConnectionHandlingMode.DELAYED_ACQUISITION_AND_RELEASE_AFTER_STATEMENT.name() )
|
||||
.addService(
|
||||
MultiTenantConnectionProvider.class,
|
||||
|
|
|
@ -12,7 +12,6 @@ import java.util.Map;
|
|||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.hibernate.MultiTenancyStrategy;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.boot.Metadata;
|
||||
import org.hibernate.boot.MetadataSources;
|
||||
|
@ -59,7 +58,6 @@ public class DiscriminatorMultiTenancyTest extends BaseUnitTestCase {
|
|||
@Before
|
||||
public void setUp() {
|
||||
Map settings = new HashMap();
|
||||
settings.put(Environment.MULTI_TENANT, MultiTenancyStrategy.DISCRIMINATOR);
|
||||
settings.put(Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, currentTenantResolver);
|
||||
settings.put(Environment.CACHE_REGION_FACTORY, CachingRegionFactory.class.getName());
|
||||
settings.put(Environment.GENERATE_STATISTICS, "true");
|
||||
|
|
|
@ -9,7 +9,6 @@ package org.hibernate.orm.test.multitenancy.schema;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.hibernate.MultiTenancyStrategy;
|
||||
import org.hibernate.SessionBuilder;
|
||||
import org.hibernate.boot.Metadata;
|
||||
import org.hibernate.boot.MetadataSources;
|
||||
|
@ -61,7 +60,6 @@ public abstract class AbstractSchemaBasedMultiTenancyTest<T extends MultiTenantC
|
|||
T multiTenantConnectionProvider = buildMultiTenantConnectionProvider();
|
||||
|
||||
Map settings = new HashMap();
|
||||
settings.put( Environment.MULTI_TENANT, MultiTenancyStrategy.SCHEMA );
|
||||
settings.put( Environment.CACHE_REGION_FACTORY, CachingRegionFactory.class.getName() );
|
||||
settings.put( Environment.GENERATE_STATISTICS, "true" );
|
||||
|
||||
|
@ -178,7 +176,7 @@ public abstract class AbstractSchemaBasedMultiTenancyTest<T extends MultiTenantC
|
|||
// make sure we get the correct people back, from cache
|
||||
// first, jboss
|
||||
doInHibernateSessionBuilder( this::jboss, session -> {
|
||||
Customer customer = (Customer) session.load( Customer.class, 1L );
|
||||
Customer customer = session.load( Customer.class, 1L );
|
||||
Assert.assertEquals( "steve", customer.getName() );
|
||||
// also, make sure this came from second level
|
||||
Assert.assertEquals( 1, sessionFactory.getStatistics().getSecondLevelCacheHitCount() );
|
||||
|
@ -187,7 +185,7 @@ public abstract class AbstractSchemaBasedMultiTenancyTest<T extends MultiTenantC
|
|||
sessionFactory.getStatistics().clear();
|
||||
// then, acme
|
||||
doInHibernateSessionBuilder( this::acme, session -> {
|
||||
Customer customer = (Customer) session.load( Customer.class, 1L );
|
||||
Customer customer = session.load( Customer.class, 1L );
|
||||
Assert.assertEquals( "john", customer.getName() );
|
||||
// also, make sure this came from second level
|
||||
Assert.assertEquals( 1, sessionFactory.getStatistics().getSecondLevelCacheHitCount() );
|
||||
|
@ -198,7 +196,7 @@ public abstract class AbstractSchemaBasedMultiTenancyTest<T extends MultiTenantC
|
|||
sessionFactory.getCache().evictEntityRegions();
|
||||
// first jboss
|
||||
doInHibernateSessionBuilder( this::jboss, session -> {
|
||||
Customer customer = (Customer) session.load( Customer.class, 1L );
|
||||
Customer customer = session.load( Customer.class, 1L );
|
||||
Assert.assertEquals( "steve", customer.getName() );
|
||||
// also, make sure this came from second level
|
||||
Assert.assertEquals( 0, sessionFactory.getStatistics().getSecondLevelCacheHitCount() );
|
||||
|
@ -207,7 +205,7 @@ public abstract class AbstractSchemaBasedMultiTenancyTest<T extends MultiTenantC
|
|||
sessionFactory.getStatistics().clear();
|
||||
// then, acme
|
||||
doInHibernateSessionBuilder( this::acme, session -> {
|
||||
Customer customer = (Customer) session.load( Customer.class, 1L );
|
||||
Customer customer = session.load( Customer.class, 1L );
|
||||
Assert.assertEquals( "john", customer.getName() );
|
||||
// also, make sure this came from second level
|
||||
Assert.assertEquals( 0, sessionFactory.getStatistics().getSecondLevelCacheHitCount() );
|
||||
|
|
|
@ -8,10 +8,10 @@ package org.hibernate.test.tenantid;
|
|||
|
||||
import org.hibernate.annotations.TenantId;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToOne;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
@Entity
|
||||
public class Account {
|
||||
|
|
|
@ -8,10 +8,10 @@ package org.hibernate.test.tenantid;
|
|||
|
||||
import org.hibernate.annotations.TenantId;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.OneToMany;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
Loading…
Reference in New Issue