Tests: make randomRepoPath work with bwc tests

This commit is contained in:
Igor Motov 2015-05-28 10:51:18 -10:00
parent 65132d5533
commit 503f844a05
1 changed files with 6 additions and 1 deletions

View File

@ -1847,7 +1847,12 @@ public abstract class ElasticsearchIntegrationTest extends ElasticsearchTestCase
* Returns path to a random directory that can be used to create a temporary file system repo
*/
public Path randomRepoPath() {
return randomRepoPath(internalCluster().getDefaultSettings());
if (currentCluster instanceof InternalTestCluster) {
return randomRepoPath(((InternalTestCluster) currentCluster).getDefaultSettings());
} else if (currentCluster instanceof CompositeTestCluster) {
return randomRepoPath(((CompositeTestCluster) currentCluster).internalCluster().getDefaultSettings());
}
throw new UnsupportedOperationException("unsupported cluster type");
}
/**