Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-9174 Qualify region names in v53.InfinispanRegionFactory
- Loading branch information
Showing
14 changed files
with
117 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...s/src/test/java/org/infinispan/test/hibernate/cache/commons/functional/QualifierTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,46 @@ | |||
package org.infinispan.test.hibernate.cache.commons.functional; | |||
|
|||
import static org.junit.Assert.assertFalse; | |||
import static org.junit.Assert.assertTrue; | |||
|
|||
import java.util.Collections; | |||
import java.util.List; | |||
import java.util.Map; | |||
|
|||
import org.hibernate.cfg.AvailableSettings; | |||
import org.infinispan.hibernate.cache.commons.InfinispanBaseRegion; | |||
import org.infinispan.manager.EmbeddedCacheManager; | |||
import org.infinispan.test.hibernate.cache.commons.util.TestRegionFactory; | |||
import org.infinispan.test.hibernate.cache.commons.util.TestRegionFactoryProvider; | |||
import org.infinispan.test.hibernate.cache.commons.util.TestSessionAccess; | |||
import org.junit.Test; | |||
|
|||
public class QualifierTest extends AbstractFunctionalTest { | |||
public static final String FOO_BAR = "foo.bar"; | |||
|
|||
@Override | |||
public List<Object[]> getParameters() { | |||
return Collections.singletonList(READ_WRITE_DISTRIBUTED); | |||
} | |||
|
|||
@Override | |||
protected void addSettings(Map settings) { | |||
super.addSettings(settings); | |||
settings.put(AvailableSettings.CACHE_REGION_PREFIX, FOO_BAR); | |||
} | |||
|
|||
@Test | |||
public void testRegionNamesQualified() { | |||
TestRegionFactory factory = TestRegionFactoryProvider.INSTANCE.findRegionFactory(sessionFactory().getCache()); | |||
EmbeddedCacheManager cacheManager = factory.getCacheManager(); | |||
for (String cacheName : cacheManager.getCacheNames()) { | |||
assertTrue(cacheName.startsWith(FOO_BAR)); | |||
} | |||
// In Hibernate < 5.3 the region factory got qualified names and couldn't use any unqualified form | |||
if (!TestRegionFactoryProvider.INSTANCE.getRegionFactoryClass().getName().contains(".v51.")) { | |||
for (InfinispanBaseRegion region : TestSessionAccess.findTestSessionAccess().getAllRegions(sessionFactory())) { | |||
assertFalse(region.getName().startsWith(FOO_BAR)); | |||
} | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters