Re-enabled additional tests
This commit is contained in:
parent
32ee43cfe7
commit
8ed1ed5159
|
@ -23,8 +23,6 @@ import org.hibernate.stat.Statistics;
|
|||
import org.hibernate.testing.TestForIssue;
|
||||
import org.hibernate.testing.jdbc.SQLStatementInspector;
|
||||
import org.hibernate.testing.orm.junit.DomainModel;
|
||||
import org.hibernate.testing.orm.junit.FailureExpected;
|
||||
import org.hibernate.testing.orm.junit.NotImplementedYet;
|
||||
import org.hibernate.testing.orm.junit.ServiceRegistry;
|
||||
import org.hibernate.testing.orm.junit.SessionFactory;
|
||||
import org.hibernate.testing.orm.junit.SessionFactoryScope;
|
||||
|
@ -206,7 +204,6 @@ public class MultiLoadTest {
|
|||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12944")
|
||||
@NotImplementedYet(strict = false, reason = "Caching/CacheMode supported not yet implemented")
|
||||
public void testMultiLoadFrom2ndLevelCache(SessionFactoryScope scope) {
|
||||
final SQLStatementInspector statementInspector = scope.getCollectingStatementInspector();
|
||||
statementInspector.clear();
|
||||
|
@ -261,7 +258,6 @@ public class MultiLoadTest {
|
|||
|
||||
@Test
|
||||
@TestForIssue(jiraKey = "HHH-12944")
|
||||
@NotImplementedYet(strict = false, reason = "Caching/CacheMode supported not yet implemented")
|
||||
public void testUnorderedMultiLoadFrom2ndLevelCache(SessionFactoryScope scope) {
|
||||
final SQLStatementInspector statementInspector = scope.getCollectingStatementInspector();
|
||||
statementInspector.clear();
|
||||
|
@ -450,26 +446,20 @@ public class MultiLoadTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@NotImplementedYet(strict = false, reason = "CacheMode not yet implemented")
|
||||
public void testMultiLoadWithCacheModeIgnore(SessionFactoryScope scope) {
|
||||
// do the multi-load, telling Hibernate to IGNORE the L2 cache -
|
||||
// the end result should be that the cache is (still) empty afterwards
|
||||
scope.inTransaction(
|
||||
session -> {
|
||||
session.getTransaction().begin();
|
||||
List<SimpleEntity> list = session.byMultipleIds( SimpleEntity.class )
|
||||
List<SimpleEntity> list = scope.fromTransaction(
|
||||
session ->
|
||||
session.byMultipleIds( SimpleEntity.class )
|
||||
.with( CacheMode.IGNORE )
|
||||
.multiLoad( ids( 56 ) );
|
||||
session.getTransaction().commit();
|
||||
session.close();
|
||||
|
||||
.multiLoad( ids( 56 ) )
|
||||
);
|
||||
assertEquals( 56, list.size() );
|
||||
for ( SimpleEntity entity : list ) {
|
||||
assertFalse( scope.getSessionFactory().getCache().containsEntity( SimpleEntity.class, entity.getId() ) );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultiLoadClearsBatchFetchQueue(SessionFactoryScope scope) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.hibernate.boot.internal.MetadataBuilderImpl;
|
|||
import org.hibernate.boot.model.TypeContributor;
|
||||
import org.hibernate.boot.registry.StandardServiceRegistry;
|
||||
import org.hibernate.boot.spi.MetadataImplementor;
|
||||
import org.hibernate.mapping.BasicValue;
|
||||
import org.hibernate.cache.spi.access.AccessType;
|
||||
import org.hibernate.mapping.Collection;
|
||||
import org.hibernate.mapping.PersistentClass;
|
||||
import org.hibernate.mapping.Property;
|
||||
|
@ -32,6 +32,8 @@ import org.junit.jupiter.api.extension.TestExecutionExceptionHandler;
|
|||
import org.junit.jupiter.api.extension.TestInstancePostProcessor;
|
||||
import org.junit.platform.commons.support.AnnotationSupport;
|
||||
|
||||
import jakarta.persistence.SharedCacheMode;
|
||||
|
||||
/**
|
||||
* hibernate-testing implementation of a few JUnit5 contracts to support SessionFactory-based testing,
|
||||
* including argument injection (or see {@link DomainModelScopeAware})
|
||||
|
@ -133,6 +135,11 @@ public class DomainModelExtension
|
|||
contributor.contribute( metadataBuilder, serviceRegistry );
|
||||
}
|
||||
|
||||
final SharedCacheMode sharedCacheMode = domainModelAnnotation.sharedCacheMode();
|
||||
final AccessType accessType = domainModelAnnotation.accessType();
|
||||
metadataBuilder.applySharedCacheMode( sharedCacheMode );
|
||||
metadataBuilder.applyAccessType( accessType );
|
||||
|
||||
MetadataImplementor metadataImplementor = metadataBuilder.build();
|
||||
applyCacheSettings(
|
||||
metadataImplementor,
|
||||
|
|
Loading…
Reference in New Issue