From 0faa05b3f29d23e8d4e647de25d2616c4408c2dc Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 4 Jan 2011 18:09:46 +0200 Subject: [PATCH] add more integration versioning tests --- .../elasticsearch/ElasticSearchException.java | 4 +- ...nsportShardReplicationOperationAction.java | 2 +- .../ConcurrentDocumentOperationTests.java | 2 +- .../versioning/SimpleVersioningTests.java | 114 ++++++++++++++++++ 4 files changed, 118 insertions(+), 4 deletions(-) rename modules/test/integration/src/test/java/org/elasticsearch/test/integration/{load => versioning}/ConcurrentDocumentOperationTests.java (97%) create mode 100644 modules/test/integration/src/test/java/org/elasticsearch/test/integration/versioning/SimpleVersioningTests.java diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchException.java b/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchException.java index 64911b726d6..425642e02a5 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchException.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/ElasticSearchException.java @@ -77,10 +77,10 @@ public class ElasticSearchException extends RuntimeException { /** - * Retrieve the innermost cause of this exception, if any. + * Retrieve the innermost cause of this exception, if none, returns the current exception. */ public Throwable getRootCause() { - Throwable rootCause = null; + Throwable rootCause = this; Throwable cause = getCause(); while (cause != null && cause != rootCause) { rootCause = cause; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java index 8cab0be69bf..9d71d8fd051 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/support/replication/TransportShardReplicationOperationAction.java @@ -429,7 +429,7 @@ public abstract class TransportShardReplicationOperationAction