This is an automated email from the ASF dual-hosted git repository.

aldettinger pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 8d881bc  Re-enabled SolrTransactionsTest
8d881bc is described below

commit 8d881bcb7c70444e8539418251d4db0f576e08dc
Author: aldettinger <aldettin...@gmail.com>
AuthorDate: Fri Jun 22 23:30:01 2018 +0200

    Re-enabled SolrTransactionsTest
---
 .../camel/component/solr/SolrTransactionsTest.java | 29 +++++++++++++++++++---
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
 
b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
index a0a6bdd..c052b35 100644
--- 
a/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
+++ 
b/components/camel-solr/src/test/java/org/apache/camel/component/solr/SolrTransactionsTest.java
@@ -16,14 +16,27 @@
  */
 package org.apache.camel.component.solr;
 
-import org.junit.Ignore;
+import org.apache.camel.CamelExecutionException;
+import org.apache.solr.client.solrj.impl.HttpSolrClient;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.allOf;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.isA;
+import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
 
-@Ignore("Rollback is currently not supported in SolrCloud mode. (SOLR-4895)")
 public class SolrTransactionsTest extends SolrComponentTestSupport {
 
-    public SolrTransactionsTest(SolrFixtures.TestServerType serverToTest) {
-        super(serverToTest);
+    @Rule
+    public ExpectedException thrown = ExpectedException.none();
+
+    private SolrFixtures.TestServerType solrServerType;
+
+    public SolrTransactionsTest(SolrFixtures.TestServerType solrServerType) {
+        super(solrServerType);
+        this.solrServerType = solrServerType;
     }
 
     @Test
@@ -43,6 +56,14 @@ public class SolrTransactionsTest extends 
SolrComponentTestSupport {
     @Test
     public void testRollback() throws Exception {
 
+        if (SolrFixtures.TestServerType.USE_CLOUD == this.solrServerType) {
+            // Twisting expectations in this case as rollback is currently no
+            // more supported in SolrCloud mode. See SOLR-4895
+            thrown.expect(CamelExecutionException.class);
+            final String expectedMessagePart = "Rollback is currently not 
supported in SolrCloud mode. (SOLR-4895)";
+            
thrown.expectCause(allOf(isA(HttpSolrClient.RemoteSolrException.class), 
hasMessage(containsString(expectedMessagePart))));
+        }
+
         //insert and verify
         solrInsertTestEntry();
         assertEquals("wrong number of entries found", 0, 
executeSolrQuery("id:" + TEST_ID).getResults().getNumFound());

Reply via email to