]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8798 Add parent-join plugin
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>
Thu, 27 Jul 2017 12:34:06 +0000 (14:34 +0200)
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>
Wed, 9 Aug 2017 13:09:54 +0000 (15:09 +0200)
server/sonar-server/src/test/java/org/sonar/elasticsearch/test/EsTestCluster.java
server/sonar-server/src/test/java/org/sonar/server/es/EsTester.java

index ec3154a60482a5cc614bd424769300c02bdb8bed..91d403e4d3771ad8cfa8d5875647ffdacfee2a4b 100644 (file)
@@ -424,7 +424,10 @@ public final class EsTestCluster {
          * no sniff client for now - doesn't work will all tests since it might throw NoNodeAvailableException if nodes are shut down.
          * we first need support of transportClientRatio as annotations or so
          */
-        transportClient = new TransportClientFactory(false, nodeConfigurationSource.transportClientSettings(), baseDir, nodeConfigurationSource.transportClientPlugins())
+        Collection<Class<? extends Plugin>> plugins = new ArrayList<>();
+        plugins.addAll(nodeConfigurationSource.transportClientPlugins());
+        plugins.addAll(mockPlugins);
+        transportClient = new TransportClientFactory(false, nodeConfigurationSource.transportClientSettings(), baseDir, plugins)
           .client(node, clusterName);
       }
       return clientWrapper.apply(transportClient);
index 3c27ce34a8bbb225ea0a987b34309fc41ab8ed6d..addb74de18ad4ade6f67c7c6e881bd8cfba0b37d 100644 (file)
@@ -49,6 +49,7 @@ import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.discovery.DiscoveryModule;
 import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.join.ParentJoinPlugin;
 import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.search.SearchHit;
 import org.elasticsearch.test.NodeConfigurationSource;
@@ -96,7 +97,7 @@ public class EsTester extends ExternalResource {
       tempDirectory = Files.createTempDirectory("es-unit-test");
       tempDirectory.toFile().deleteOnExit();
       cluster = new EsTestCluster(new Random().nextLong(), tempDirectory, 1, "test cluster", getNodeConfigSource(), "node-",
-        Collections.emptyList(), i -> i);
+        Collections.singletonList(ParentJoinPlugin.class), i -> i);
       Random random = new Random();
       cluster.beforeTest(random, random.nextDouble());
       cluster.wipe(NO_TEMPLATES_SURVIVING_WIPE);