fix test compilation

Original commit: elastic/x-pack-elasticsearch@53074ee0c1
This commit is contained in:
Robert Muir 2015-07-22 09:10:34 -04:00
parent d68f94b859
commit 360a302511
5 changed files with 37 additions and 14 deletions

View File

@ -0,0 +1,6 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,18 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=enabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nullable=org.elasticsearch.common.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=warning
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.lineSplit=140
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=4

File diff suppressed because one or more lines are too long

View File

@ -29,12 +29,10 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
//all good if the plugin is loaded on both tribe node and tribe clients, no matter how it gets loaded (manually or from classpath) //all good if the plugin is loaded on both tribe node and tribe clients, no matter how it gets loaded (manually or from classpath)
Settings.Builder builder = defaultSettings(); Settings.Builder builder = defaultSettings();
if (randomBoolean()) { if (randomBoolean()) {
builder.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
} }
if (randomBoolean()) { if (randomBoolean()) {
builder.put("tribe.t1." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
} }
try (Node node = NodeBuilder.nodeBuilder().settings(builder.build()).build()) { try (Node node = NodeBuilder.nodeBuilder().settings(builder.build()).build()) {
@ -49,12 +47,9 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
//startup failure if any of the tribe clients doesn't have shield installed //startup failure if any of the tribe clients doesn't have shield installed
Settings.Builder builder = defaultSettings(); Settings.Builder builder = defaultSettings();
if (randomBoolean()) { if (randomBoolean()) {
builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
} }
builder.put("tribe.t1.plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false);
try { try {
NodeBuilder.nodeBuilder().settings(builder.build()).build(); NodeBuilder.nodeBuilder().settings(builder.build()).build();
fail("node initialization should have failed due to missing shield plugin"); fail("node initialization should have failed due to missing shield plugin");
@ -69,14 +64,11 @@ public class TribeShieldLoadedTests extends ElasticsearchTestCase {
//startup failure if any of the tribe clients doesn't have shield installed //startup failure if any of the tribe clients doesn't have shield installed
Settings.Builder builder = addTribeSettings(defaultSettings(), "t2"); Settings.Builder builder = addTribeSettings(defaultSettings(), "t2");
if (randomBoolean()) { if (randomBoolean()) {
builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
} }
//load shield explicitly on tribe t1 //load shield explicitly on tribe t1
builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()) builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName());
//disable loading from classpath on tribe t2 only
.put("tribe.t2.plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false);
try { try {
NodeBuilder.nodeBuilder().settings(builder.build()).build(); NodeBuilder.nodeBuilder().settings(builder.build()).build();

View File

@ -8,17 +8,18 @@ package org.elasticsearch.test;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import com.google.common.base.Function; import com.google.common.base.Function;
import com.google.common.collect.Collections2; import com.google.common.collect.Collections2;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus;
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo; import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.action.admin.cluster.node.info.PluginInfo;
import org.elasticsearch.client.Client; import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.plugins.PluginInfo;
import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.ShieldPlugin;
import org.elasticsearch.shield.audit.index.IndexAuditTrail; import org.elasticsearch.shield.audit.index.IndexAuditTrail;
import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.SecuredString;