Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-8670 Lock the persistent global state location and add a shared …
…persistent location
- Loading branch information
1 parent
5132364
commit 4b67837
Showing
25 changed files
with
245 additions
and
33 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
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
37 changes: 37 additions & 0 deletions
37
core/src/test/java/org/infinispan/globalstate/GlobalStateTest.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.infinispan.globalstate; | ||
|
||
import java.io.File; | ||
|
||
import org.infinispan.commons.util.Util; | ||
import org.infinispan.configuration.cache.ConfigurationBuilder; | ||
import org.infinispan.configuration.global.GlobalConfigurationBuilder; | ||
import org.infinispan.manager.EmbeddedCacheManager; | ||
import org.infinispan.manager.EmbeddedCacheManagerStartupException; | ||
import org.infinispan.test.AbstractInfinispanTest; | ||
import org.infinispan.test.Exceptions; | ||
import org.infinispan.test.TestingUtil; | ||
import org.infinispan.test.fwk.TestCacheManagerFactory; | ||
import org.infinispan.test.fwk.TransportFlags; | ||
import org.testng.annotations.Test; | ||
|
||
/** | ||
* @since 9.2 | ||
*/ | ||
@Test(testName = "globalstate.GlobalStateTest", groups = "functional") | ||
public class GlobalStateTest extends AbstractInfinispanTest { | ||
|
||
public void testLockPersistentLocation() { | ||
String stateDirectory = TestingUtil.tmpDirectory(this.getClass().getSimpleName() + File.separator + "COMMON"); | ||
Util.recursiveFileRemove(stateDirectory); | ||
GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder(); | ||
global.globalState().enable().persistentLocation(stateDirectory); | ||
EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(false, global, new ConfigurationBuilder(), new TransportFlags(), false); | ||
EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(false, global, new ConfigurationBuilder(), new TransportFlags(), false); | ||
try { | ||
cm1.start(); | ||
Exceptions.expectException(EmbeddedCacheManagerStartupException.class, "org.infinispan.commons.CacheConfigurationException: ISPN000512: Cannot acquire lock.*", () -> cm2.start()); | ||
} finally { | ||
TestingUtil.killCacheManagers(cm1, cm2); | ||
} | ||
} | ||
} |
Oops, something went wrong.