get watcher verify working

Original commit: elastic/x-pack-elasticsearch@56978b71f9
This commit is contained in:
Robert Muir 2015-07-22 09:49:57 -04:00
parent b7470ea469
commit 8dea4500c5
12 changed files with 81 additions and 16 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

@ -16,6 +16,8 @@
</parent> </parent>
<properties> <properties>
<!-- TODO: try to avoid this... -->
<elasticsearch.assembly.descriptor>${basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
<elasticsearch.plugin.classname>org.elasticsearch.watcher.WatcherPlugin</elasticsearch.plugin.classname> <elasticsearch.plugin.classname>org.elasticsearch.watcher.WatcherPlugin</elasticsearch.plugin.classname>
<!-- TODO: fix plugin dependencies for full isolation --> <!-- TODO: fix plugin dependencies for full isolation -->
<elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated> <elasticsearch.plugin.isolated>false</elasticsearch.plugin.isolated>

View File

@ -0,0 +1,49 @@
<?xml version="1.0"?>
<assembly>
<id>plugin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<filtered>false</filtered>
<directory>bin/watcher</directory>
<outputDirectory>bin</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useTransitiveFiltering>true</useTransitiveFiltering>
<excludes>
<exclude>org.elasticsearch:elasticsearch</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useTransitiveDependencies>false</useTransitiveDependencies>
<includes>
<include>com.sun.mail:javax.mail</include>
<include>javax.activation:activation</include>
<include>com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer</include>
</includes>
</dependencySet>
</dependencySets>
<files>
<file>
<source>${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties</source>
<outputDirectory></outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>LICENSE.txt</source>
<outputDirectory>/</outputDirectory>
</file>
<file>
<source>NOTICE.txt</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
</assembly>

View File

@ -39,7 +39,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest {
return Settings.settingsBuilder() return Settings.settingsBuilder()
.put(super.nodeSettings(nodeOrdinal)) .put(super.nodeSettings(nodeOrdinal))
.put("plugin.types", WatcherPlugin.class.getName() + "," + LicensePlugin.class.getName()) .put("plugin.types", WatcherPlugin.class.getName() + "," + LicensePlugin.class.getName())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put(WatcherPlugin.ENABLED_SETTING, false) .put(WatcherPlugin.ENABLED_SETTING, false)
.put(Node.HTTP_ENABLED, true) .put(Node.HTTP_ENABLED, true)
.build(); .build();
@ -49,7 +48,6 @@ public class WatcherPluginDisableTests extends ElasticsearchIntegrationTest {
protected Settings transportClientSettings() { protected Settings transportClientSettings() {
return Settings.builder() return Settings.builder()
.put(super.transportClientSettings()) .put(super.transportClientSettings())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }

View File

@ -51,7 +51,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
protected Settings nodeSettings(int nodeOrdinal) { protected Settings nodeSettings(int nodeOrdinal) {
return Settings.builder() return Settings.builder()
.put(super.nodeSettings(nodeOrdinal)) .put(super.nodeSettings(nodeOrdinal))
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }
@ -59,7 +58,6 @@ public class IndexActionTests extends ElasticsearchIntegrationTest {
protected Settings transportClientSettings() { protected Settings transportClientSettings() {
return Settings.builder() return Settings.builder()
.put(super.transportClientSettings()) .put(super.transportClientSettings())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }

View File

@ -95,7 +95,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest {
//Set path so ScriptService will pick up the test scripts //Set path so ScriptService will pick up the test scripts
return settingsBuilder().put(super.nodeSettings(nodeOrdinal)) return settingsBuilder().put(super.nodeSettings(nodeOrdinal))
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put("path.conf", configPath).build(); .put("path.conf", configPath).build();
} }
@ -103,7 +102,6 @@ public class SearchInputTests extends ElasticsearchIntegrationTest {
protected Settings transportClientSettings() { protected Settings transportClientSettings() {
return Settings.builder() return Settings.builder()
.put(super.transportClientSettings()) .put(super.transportClientSettings())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }

View File

@ -45,7 +45,6 @@ public class BasicShieldTests extends AbstractWatcherIntegrationTests {
.put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName()) .put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName())
// Use just the transport user here, so we can test Watcher roles specifically // Use just the transport user here, so we can test Watcher roles specifically
.put("shield.user", "transport_client:changeme") .put("shield.user", "transport_client:changeme")
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }

View File

@ -114,7 +114,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
.put("scroll.size", randomIntBetween(1, 100)) .put("scroll.size", randomIntBetween(1, 100))
.put("plugin.types", Strings.collectionToCommaDelimitedString(pluginTypes())) .put("plugin.types", Strings.collectionToCommaDelimitedString(pluginTypes()))
.put(ShieldSettings.settings(shieldEnabled)) .put(ShieldSettings.settings(shieldEnabled))
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put("watcher.trigger.schedule.engine", scheduleImplName) .put("watcher.trigger.schedule.engine", scheduleImplName)
.build(); .build();
} }
@ -199,7 +198,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
if (shieldEnabled == false) { if (shieldEnabled == false) {
return Settings.builder() return Settings.builder()
.put(super.transportClientSettings()) .put(super.transportClientSettings())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put("plugin.types", WatcherPlugin.class.getName()) .put("plugin.types", WatcherPlugin.class.getName())
.build(); .build();
} }
@ -207,7 +205,6 @@ public abstract class AbstractWatcherIntegrationTests extends ElasticsearchInteg
return Settings.builder() return Settings.builder()
.put("client.transport.sniff", false) .put("client.transport.sniff", false)
.put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName()) .put("plugin.types", ShieldPlugin.class.getName() + "," + WatcherPlugin.class.getName())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put("shield.user", "admin:changeme") .put("shield.user", "admin:changeme")
.build(); .build();
} }

View File

@ -63,7 +63,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
+ "," + licensePluginClass().getName()) + "," + licensePluginClass().getName())
.put(Node.HTTP_ENABLED, true) .put(Node.HTTP_ENABLED, true)
.put(ShieldSettings.settings(shieldEnabled)) .put(ShieldSettings.settings(shieldEnabled))
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }
@ -81,7 +80,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
String token = basicAuthHeaderValue("admin", new SecuredString("changeme".toCharArray())); String token = basicAuthHeaderValue("admin", new SecuredString("changeme".toCharArray()));
return Settings.builder() return Settings.builder()
.put(Headers.PREFIX + ".Authorization", token) .put(Headers.PREFIX + ".Authorization", token)
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} else { } else {
return Settings.EMPTY; return Settings.EMPTY;
@ -98,7 +96,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
+ (shieldEnabled ? ShieldPlugin.class.getName() + "," : "")) + (shieldEnabled ? ShieldPlugin.class.getName() + "," : ""))
.put("shield.user", "admin:changeme") .put("shield.user", "admin:changeme")
.put(Node.HTTP_ENABLED, true) .put(Node.HTTP_ENABLED, true)
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }
@ -107,7 +104,6 @@ public class WatcherRestTests extends ElasticsearchRestTestCase {
.put(Node.HTTP_ENABLED, true) .put(Node.HTTP_ENABLED, true)
.put("plugin.types", WatcherPlugin.class.getName() + "," .put("plugin.types", WatcherPlugin.class.getName() + ","
+ "," + LicensePlugin.class.getName()) + "," + LicensePlugin.class.getName())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }

View File

@ -95,7 +95,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest {
return settingsBuilder() return settingsBuilder()
.put(super.nodeSettings(nodeOrdinal)) .put(super.nodeSettings(nodeOrdinal))
// we're not extending from the base watcher test case, so we should prevent the watcher plugin from being loaded // we're not extending from the base watcher test case, so we should prevent the watcher plugin from being loaded
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.put("path.conf", configPath).build(); .put("path.conf", configPath).build();
} }
@ -103,7 +102,6 @@ public class SearchTransformTests extends ElasticsearchIntegrationTest {
protected Settings transportClientSettings() { protected Settings transportClientSettings() {
return Settings.builder() return Settings.builder()
.put(super.transportClientSettings()) .put(super.transportClientSettings())
.put(PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, false)
.build(); .build();
} }