Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-1472 Caches should be started within test itself #596

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -231,9 +231,9 @@ public Writer getObjectWriter(Object o) throws IOException {
Writer writer = writers.get(clazz);
if (writer == null) {
if (Thread.currentThread().isInterrupted())
throw new IOException(String.format(
throw new IOException(new InterruptedException(String.format(
"Cache manager is shutting down, so type write externalizer for type=%s cannot be resolved. Interruption being pushed up.",
clazz.getName()), new InterruptedException());
clazz.getName())));
}
return writer;
}
Expand Down
Expand Up @@ -53,7 +53,9 @@ protected void createCacheManagers() throws Exception {

defineConfigurationOnAllManagers("c1", c);
defineConfigurationOnAllManagers("c2", c);
}

private void startAllCaches() {
cm1.startCaches("c1", "c2", "cache1", "cache2", CacheContainer.DEFAULT_CACHE_NAME);
cm2.startCaches("c1", "c2", "cache1", "cache2", CacheContainer.DEFAULT_CACHE_NAME);
}
Expand All @@ -63,6 +65,7 @@ protected Configuration getConfiguration() {
}

public void testCommitSpanningCaches() throws Exception {
startAllCaches();
Cache c1 = cm1.getCache("c1");
Cache c1Replica = cm2.getCache("c1");
Cache c2 = cm1.getCache("c2");
Expand Down Expand Up @@ -116,6 +119,7 @@ public void testCommitSpanningCaches() throws Exception {
}

public void testRollbackSpanningCaches() throws Exception {
startAllCaches();
Cache c1 = cm1.getCache("c1");
Cache c1Replica = cm2.getCache("c1");
Cache c2 = cm1.getCache("c2");
Expand Down Expand Up @@ -169,6 +173,7 @@ public void testRollbackSpanningCaches() throws Exception {
}

public void testRollbackSpanningCaches2() throws Exception {
startAllCaches();
Cache c1 = cm1.getCache("c1");

assert c1.getConfiguration().getCacheMode().isClustered();
Expand All @@ -183,6 +188,7 @@ public void testRollbackSpanningCaches2() throws Exception {
}

public void testSimpleCommit() throws Exception {
startAllCaches();
Cache c1 = cm1.getCache("c1");
Cache c1Replica = cm2.getCache("c1");

Expand All @@ -200,6 +206,7 @@ public void testSimpleCommit() throws Exception {
}

public void testPutIfAbsent() throws Exception {
startAllCaches();
Cache c1 = cm1.getCache("c1");
Cache c1Replica = cm2.getCache("c1");

Expand Down Expand Up @@ -240,6 +247,7 @@ public void testDefaultCacheAndNamedCacheDifferentNodes() throws Exception {
}

private void runTest(Cache cache1, Cache cache2) throws Exception {
startAllCaches();
assertFalse(cache1.containsKey("a"));
assertFalse(cache2.containsKey("b"));

Expand Down