From 360a302511549a4a62d02335ad974d920d30c9e1 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 22 Jul 2015 09:10:34 -0400 Subject: [PATCH] fix test compilation Original commit: elastic/x-pack-elasticsearch@53074ee0c1baf0821ce78c008cbb220a128e0ca6 --- .../.settings/org.eclipse.core.resources.prefs | 6 ++++++ shield/.settings/org.eclipse.jdt.core.prefs | 18 ++++++++++++++++++ shield/.settings/org.eclipse.jdt.ui.prefs | 6 ++++++ .../shield/tribe/TribeShieldLoadedTests.java | 18 +++++------------- .../test/ShieldIntegrationTest.java | 3 ++- 5 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 shield/.settings/org.eclipse.core.resources.prefs create mode 100644 shield/.settings/org.eclipse.jdt.core.prefs create mode 100644 shield/.settings/org.eclipse.jdt.ui.prefs diff --git a/shield/.settings/org.eclipse.core.resources.prefs b/shield/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..6fd0a9aab13 --- /dev/null +++ b/shield/.settings/org.eclipse.core.resources.prefs @@ -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/=UTF-8 \ No newline at end of file diff --git a/shield/.settings/org.eclipse.jdt.core.prefs b/shield/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..aefac3b3626 --- /dev/null +++ b/shield/.settings/org.eclipse.jdt.core.prefs @@ -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 \ No newline at end of file diff --git a/shield/.settings/org.eclipse.jdt.ui.prefs b/shield/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 00000000000..a42667f8698 --- /dev/null +++ b/shield/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +formatter_settings_version=12 +# Intellij IDEA import order +org.eclipse.jdt.ui.importorder=;com;org;java;javax;\#; +# License header +org.eclipse.jdt.ui.text.custom_code_templates= \ No newline at end of file diff --git a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java index 70f1019def8..11e32b035ec 100644 --- a/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java +++ b/shield/src/test/java/org/elasticsearch/shield/tribe/TribeShieldLoadedTests.java @@ -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) Settings.Builder builder = defaultSettings(); if (randomBoolean()) { - builder.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) - .put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); + builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); } if (randomBoolean()) { - builder.put("tribe.t1." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) - .put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); + builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); } 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 Settings.Builder builder = defaultSettings(); if (randomBoolean()) { - builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) - .put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); + builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); } - builder.put("tribe.t1.plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false); - try { NodeBuilder.nodeBuilder().settings(builder.build()).build(); 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 Settings.Builder builder = addTribeSettings(defaultSettings(), "t2"); if (randomBoolean()) { - builder.put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false) - .put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); + builder.put("plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); } //load shield explicitly on tribe t1 - 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); + builder.put("tribe.t1.plugin.types", ShieldPlugin.class.getName() + "," + LicensePlugin.class.getName()); try { NodeBuilder.nodeBuilder().settings(builder.build()).build(); diff --git a/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java b/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java index 3d30b48cd24..9c8e568d430 100644 --- a/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java +++ b/shield/src/test/java/org/elasticsearch/test/ShieldIntegrationTest.java @@ -8,17 +8,18 @@ package org.elasticsearch.test; import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.google.common.base.Function; import com.google.common.collect.Collections2; + import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; 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.NodesInfoResponse; -import org.elasticsearch.action.admin.cluster.node.info.PluginInfo; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.plugins.Plugin; +import org.elasticsearch.plugins.PluginInfo; import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.audit.index.IndexAuditTrail; import org.elasticsearch.shield.authc.support.SecuredString;