diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/DependenciesInfoTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/DependenciesInfoTask.groovy index aa01b1d7dfd..cce6b891109 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/DependenciesInfoTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/DependenciesInfoTask.groovy @@ -20,20 +20,16 @@ package org.elasticsearch.gradle import org.elasticsearch.gradle.precommit.DependencyLicensesTask -import org.gradle.api.DefaultTask import org.gradle.api.artifacts.Configuration import org.gradle.api.artifacts.Dependency -import org.gradle.api.artifacts.DependencyResolutionListener import org.gradle.api.artifacts.DependencySet import org.gradle.api.internal.ConventionTask import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputDirectory +import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.OutputFile import org.gradle.api.tasks.TaskAction -import java.util.regex.Matcher -import java.util.regex.Pattern - /** * A task to gather information about the dependencies and export them into a csv file. * @@ -46,31 +42,31 @@ import java.util.regex.Pattern * * */ -public class DependenciesInfoTask extends ConventionTask { +class DependenciesInfoTask extends ConventionTask { /** Dependencies to gather information from. */ - @Input - public Configuration runtimeConfiguration + @InputFiles + Configuration runtimeConfiguration /** We subtract compile-only dependencies. */ - @Input - public Configuration compileOnlyConfiguration - - private LinkedHashMap mappings + @InputFiles + Configuration compileOnlyConfiguration /** Directory to read license files */ @InputDirectory - public File licensesDir = new File(project.projectDir, 'licenses') + File licensesDir = new File(project.projectDir, 'licenses') @OutputFile File outputFile = new File(project.buildDir, "reports/dependencies/dependencies.csv") - public DependenciesInfoTask() { + private LinkedHashMap mappings + + DependenciesInfoTask() { description = 'Create a CSV file with dependencies information.' } @TaskAction - public void generateDependenciesInfo() { + void generateDependenciesInfo() { final DependencySet runtimeDependencies = runtimeConfiguration.getAllDependencies() // we have to resolve the transitive dependencies and create a group:artifactId:version map diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy index b42bc83b472..6a522af12dd 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/RestTestsFromSnippetsTask.groovy @@ -31,7 +31,7 @@ import java.nio.file.Path /** * Generates REST tests for each snippet marked // TEST. */ -public class RestTestsFromSnippetsTask extends SnippetsTask { +class RestTestsFromSnippetsTask extends SnippetsTask { /** * These languages aren't supported by the syntax highlighter so we * shouldn't use them. @@ -58,7 +58,7 @@ public class RestTestsFromSnippetsTask extends SnippetsTask { @OutputDirectory File testRoot = project.file('build/rest') - public RestTestsFromSnippetsTask() { + RestTestsFromSnippetsTask() { project.afterEvaluate { // Wait to set this so testRoot can be customized project.sourceSets.test.output.dir(testRoot, builtBy: this) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy index 520fed560aa..9ef0aa6197c 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/doc/SnippetsTask.groovy @@ -28,6 +28,7 @@ import org.gradle.api.InvalidUserDataException import org.gradle.api.file.ConfigurableFileTree import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import java.nio.file.Path @@ -36,7 +37,7 @@ import java.util.regex.Matcher /** * A task which will run a closure on each snippet in the documentation. */ -public class SnippetsTask extends DefaultTask { +class SnippetsTask extends DefaultTask { private static final String SCHAR = /(?:\\\/|[^\/])/ private static final String SUBSTITUTION = /s\/($SCHAR+)\/($SCHAR*)\// private static final String CATCH = /catch:\s*((?:\/[^\/]+\/)|[^ \]]+)/ @@ -51,6 +52,7 @@ public class SnippetsTask extends DefaultTask { * Action to take on each snippet. Called with a single parameter, an * instance of Snippet. */ + @Internal Closure perSnippet /** @@ -73,7 +75,7 @@ public class SnippetsTask extends DefaultTask { Map defaultSubstitutions = [:] @TaskAction - public void executeTask() { + void executeTask() { /* * Walks each line of each file, building snippets as it encounters * the lines that make up the snippet. diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/AntFixture.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/AntFixture.groovy index 32aca9e5808..00f7f7885cb 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/AntFixture.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/AntFixture.groovy @@ -26,20 +26,20 @@ import org.gradle.api.GradleException import org.gradle.api.Task import org.gradle.api.tasks.Exec import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal /** * A fixture for integration tests which runs in a separate process launched by Ant. */ -public class AntFixture extends AntTask implements Fixture { +class AntFixture extends AntTask implements Fixture { /** The path to the executable that starts the fixture. */ - @Input + @Internal String executable private final List arguments = new ArrayList<>() - @Input - public void args(Object... args) { + void args(Object... args) { arguments.addAll(args) } @@ -49,16 +49,15 @@ public class AntFixture extends AntTask implements Fixture { */ private final Map environment = new HashMap<>() - @Input - public void env(String key, Object value) { + void env(String key, Object value) { environment.put(key, value) } /** A flag to indicate whether the command should be executed from a shell. */ - @Input + @Internal boolean useShell = false - @Input + @Internal int maxWaitInSeconds = 30 /** @@ -72,6 +71,7 @@ public class AntFixture extends AntTask implements Fixture { * as well as a groovy AntBuilder, to enable running ant condition checks. The default wait * condition is for http on the http port. */ + @Internal Closure waitCondition = { AntFixture fixture, AntBuilder ant -> File tmpFile = new File(fixture.cwd, 'wait.success') ant.get(src: "http://${fixture.addressAndPort}", @@ -83,13 +83,14 @@ public class AntFixture extends AntTask implements Fixture { private final Task stopTask - public AntFixture() { + AntFixture() { stopTask = createStopTask() finalizedBy(stopTask) } @Override - public Task getStopTask() { + @Internal + Task getStopTask() { return stopTask } @@ -168,6 +169,7 @@ public class AntFixture extends AntTask implements Fixture { } /** Returns a debug string used to log information about how the fixture was run. */ + @Internal protected String getCommandString() { String commandString = "\n${name} configuration:\n" commandString += "-----------------------------------------\n" @@ -247,46 +249,55 @@ public class AntFixture extends AntTask implements Fixture { * A path relative to the build dir that all configuration and runtime files * will live in for this fixture */ + @Internal protected File getBaseDir() { return new File(project.buildDir, "fixtures/${name}") } /** Returns the working directory for the process. Defaults to "cwd" inside baseDir. */ + @Internal protected File getCwd() { return new File(baseDir, 'cwd') } /** Returns the file the process writes its pid to. Defaults to "pid" inside baseDir. */ + @Internal protected File getPidFile() { return new File(baseDir, 'pid') } /** Reads the pid file and returns the process' pid */ - public int getPid() { + @Internal + int getPid() { return Integer.parseInt(pidFile.getText('UTF-8').trim()) } /** Returns the file the process writes its bound ports to. Defaults to "ports" inside baseDir. */ + @Internal protected File getPortsFile() { return new File(baseDir, 'ports') } /** Returns an address and port suitable for a uri to connect to this node over http */ - public String getAddressAndPort() { + @Internal + String getAddressAndPort() { return portsFile.readLines("UTF-8").get(0) } /** Returns a file that wraps around the actual command when {@code spawn == true}. */ + @Internal protected File getWrapperScript() { return new File(cwd, Os.isFamily(Os.FAMILY_WINDOWS) ? 'run.bat' : 'run') } /** Returns a file that the wrapper script writes when the command failed. */ + @Internal protected File getFailureMarker() { return new File(cwd, 'run.failed') } /** Returns a file that the wrapper script writes when the command failed. */ + @Internal protected File getRunLog() { return new File(cwd, 'run.log') } diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RunTask.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RunTask.groovy index c34b2f00f4c..f74d2944b88 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RunTask.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RunTask.groovy @@ -2,14 +2,16 @@ package org.elasticsearch.gradle.test import org.gradle.api.DefaultTask import org.gradle.api.Task +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.options.Option import org.gradle.util.ConfigureUtil -public class RunTask extends DefaultTask { +class RunTask extends DefaultTask { + @Internal ClusterConfiguration clusterConfig - public RunTask() { + RunTask() { description = "Runs elasticsearch with '${project.path}'" group = 'Verification' clusterConfig = new ClusterConfiguration(project) @@ -26,13 +28,13 @@ public class RunTask extends DefaultTask { option = "debug-jvm", description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch." ) - public void setDebug(boolean enabled) { + void setDebug(boolean enabled) { clusterConfig.debug = enabled; } /** Configure the cluster that will be run. */ @Override - public Task configure(Closure closure) { + Task configure(Closure closure) { ConfigureUtil.configure(closure, clusterConfig) return this } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/AbstractLazyPropertyCollection.java b/buildSrc/src/main/java/org/elasticsearch/gradle/AbstractLazyPropertyCollection.java index 94cdb091eac..f5b2003868b 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/AbstractLazyPropertyCollection.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/AbstractLazyPropertyCollection.java @@ -16,7 +16,7 @@ public abstract class AbstractLazyPropertyCollection { this.owner = owner; } - abstract List getNormalizedCollection(); + public abstract List getNormalizedCollection(); void assertNotNull(Object value, String description) { if (value == null) { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/EmptyDirTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/EmptyDirTask.java index 4ee2192ff34..dc5047562f8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/EmptyDirTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/EmptyDirTask.java @@ -24,6 +24,7 @@ import javax.inject.Inject; import org.gradle.api.DefaultTask; import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.TaskAction; import org.gradle.internal.file.Chmod; @@ -49,11 +50,16 @@ public class EmptyDirTask extends DefaultTask { throw new UnsupportedOperationException(); } - @Input + @Internal public File getDir() { return dir; } + @Input + public String getDirPath() { + return dir.getPath(); + } + /** * @param dir The directory to create */ diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/ExportElasticsearchBuildResourcesTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/ExportElasticsearchBuildResourcesTask.java index cb771846510..dff60f7693b 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/ExportElasticsearchBuildResourcesTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/ExportElasticsearchBuildResourcesTask.java @@ -26,7 +26,6 @@ import org.gradle.api.logging.Logging; import org.gradle.api.tasks.Classpath; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.OutputDirectory; -import org.gradle.api.tasks.SkipWhenEmpty; import org.gradle.api.tasks.StopExecutionException; import org.gradle.api.tasks.TaskAction; @@ -66,7 +65,6 @@ public class ExportElasticsearchBuildResourcesTask extends DefaultTask { } @Input - @SkipWhenEmpty public Set getResources() { return Collections.unmodifiableSet(resources); } @@ -78,8 +76,8 @@ public class ExportElasticsearchBuildResourcesTask extends DefaultTask { return System.getProperty("java.class.path"); } - public void setOutputDir(DirectoryProperty outputDir) { - this.outputDir = outputDir; + public void setOutputDir(File outputDir) { + this.outputDir.set(outputDir); } public File copy(String resource) { @@ -95,6 +93,7 @@ public class ExportElasticsearchBuildResourcesTask extends DefaultTask { @TaskAction public void doExport() { if (resources.isEmpty()) { + setDidWork(false); throw new StopExecutionException(); } resources.stream().parallel() diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java index d23c9b9e748..1d302ded632 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyList.java @@ -1,7 +1,6 @@ package org.elasticsearch.gradle; import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.Nested; import java.util.ArrayList; import java.util.Collection; @@ -171,8 +170,7 @@ public class LazyPropertyList extends AbstractLazyPropertyCollection implemen } @Override - @Nested - List getNormalizedCollection() { + public List getNormalizedCollection() { return delegate.stream() .peek(this::validate) .filter(entry -> entry.getNormalization() != PropertyNormalization.IGNORE_VALUE) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyMap.java b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyMap.java index 781bb095bb5..a6e8d5cbbe8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyMap.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/LazyPropertyMap.java @@ -2,7 +2,6 @@ package org.elasticsearch.gradle; import org.gradle.api.Named; import org.gradle.api.tasks.Input; -import org.gradle.api.tasks.Nested; import java.util.Collection; import java.util.LinkedHashMap; @@ -117,8 +116,7 @@ public class LazyPropertyMap extends AbstractLazyPropertyCollection implem } @Override - @Nested - List getNormalizedCollection() { + public List getNormalizedCollection() { return delegate.values().stream() .peek(this::validate) .filter(entry -> entry.getNormalization() != PropertyNormalization.IGNORE_VALUE) diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java index d884207d590..07f13ab338c 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java @@ -28,6 +28,7 @@ import org.gradle.api.logging.Logging; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputDirectory; import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.TaskAction; @@ -306,6 +307,7 @@ public class DependencyLicensesTask extends DefaultTask { return new File(licensesDir, jarName + SHA_EXTENSION); } + @Internal Set getShaFiles() { File[] array = licensesDir.listFiles(); if (array == null) { diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java index f858ec26fc1..123aa397da8 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/ForbiddenPatternsTask.java @@ -87,7 +87,7 @@ public class ForbiddenPatternsTask extends DefaultTask { @InputFiles @SkipWhenEmpty - public FileCollection files() { + public FileCollection getFiles() { return getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets() .stream() .map(sourceSet -> sourceSet.getAllSource().matching(filesFilter)) @@ -99,7 +99,7 @@ public class ForbiddenPatternsTask extends DefaultTask { public void checkInvalidPatterns() throws IOException { Pattern allPatterns = Pattern.compile("(" + String.join(")|(", getPatterns().values()) + ")"); List failures = new ArrayList<>(); - for (File f : files()) { + for (File f : getFiles()) { List lines; try(Stream stream = Files.lines(f.toPath(), StandardCharsets.UTF_8)) { lines = stream.collect(Collectors.toList()); diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/UpdateShasTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/UpdateShasTask.java index c4dd1feb745..65428f17880 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/UpdateShasTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/UpdateShasTask.java @@ -22,6 +22,7 @@ package org.elasticsearch.gradle.precommit; import org.gradle.api.DefaultTask; import org.gradle.api.logging.Logger; import org.gradle.api.logging.Logging; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.TaskProvider; @@ -77,6 +78,7 @@ public class UpdateShasTask extends DefaultTask { Files.write(shaFile.toPath(), sha.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE); } + @Internal public DependencyLicensesTask getParentTask() { return parentTask.get(); } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/tar/SymbolicLinkPreservingUntarTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/tar/SymbolicLinkPreservingUntarTask.java index 183d7721b8a..8b65bfc553f 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/tar/SymbolicLinkPreservingUntarTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/tar/SymbolicLinkPreservingUntarTask.java @@ -27,8 +27,8 @@ import org.gradle.api.GradleException; import org.gradle.api.file.DirectoryProperty; import org.gradle.api.file.RegularFileProperty; import org.gradle.api.model.ObjectFactory; -import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputFile; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.OutputDirectory; import org.gradle.api.tasks.TaskAction; @@ -69,13 +69,17 @@ public class SymbolicLinkPreservingUntarTask extends DefaultTask { private Function transform; + @Internal + public Function getTransform() { + return transform; + } + /** * A transform to apply to the tar entry, to derive the relative path from the entry name. If the return value is null, the entry is * dropped from the exploded tar archive. * * @param transform the transform */ - @Input public void setTransform(Function transform) { this.transform = transform; } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java index 147e0a097a4..0e29d5e1e77 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchCluster.java @@ -27,6 +27,7 @@ import org.gradle.api.NamedDomainObjectContainer; import org.gradle.api.Project; import org.gradle.api.logging.Logger; import org.gradle.api.logging.Logging; +import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Nested; import java.io.File; @@ -107,14 +108,17 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named { return nodes.getAt(clusterName + "-0"); } + @Internal public int getNumberOfNodes() { return nodes.size(); } + @Internal public String getName() { return clusterName; } + @Internal public String getPath() { return path; } @@ -383,24 +387,28 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named { } @Override + @Internal public String getHttpSocketURI() { waitForAllConditions(); return getFirstNode().getHttpSocketURI(); } @Override + @Internal public String getTransportPortURI() { waitForAllConditions(); return getFirstNode().getTransportPortURI(); } @Override + @Internal public List getAllHttpSocketURI() { waitForAllConditions(); return nodes.stream().flatMap(each -> each.getAllHttpSocketURI().stream()).collect(Collectors.toList()); } @Override + @Internal public List getAllTransportPortURI() { waitForAllConditions(); return nodes.stream().flatMap(each -> each.getAllTransportPortURI().stream()).collect(Collectors.toList()); @@ -424,6 +432,7 @@ public class ElasticsearchCluster implements TestClusterConfiguration, Named { } @Override + @Internal public boolean isProcessAlive() { return nodes.stream().noneMatch(node -> node.isProcessAlive() == false); } diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index ff6c41f8143..f93d24f43c1 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -42,6 +42,7 @@ import org.gradle.api.tasks.InputFile; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.Optional; import org.gradle.api.tasks.PathSensitive; import org.gradle.api.tasks.PathSensitivity; import org.gradle.api.tasks.util.PatternFilterable; @@ -171,6 +172,8 @@ public class ElasticsearchNode implements TestClusterConfiguration { setVersion(VersionProperties.getElasticsearch()); } + @Input + @Optional public String getName() { return nameCustomization.apply(name); } @@ -346,6 +349,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { jvmArgs.addAll(Arrays.asList(values)); } + @Internal public Path getConfigDir() { return configFile.getParent(); } @@ -368,6 +372,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { this.javaHome = javaHome; } + @Internal public File getJavaHome() { return javaHome; } @@ -701,31 +706,37 @@ public class ElasticsearchNode implements TestClusterConfiguration { } @Override + @Internal public String getHttpSocketURI() { return getHttpPortInternal().get(0); } @Override + @Internal public String getTransportPortURI() { return getTransportPortInternal().get(0); } @Override + @Internal public List getAllHttpSocketURI() { waitForAllConditions(); return getHttpPortInternal(); } @Override + @Internal public List getAllTransportPortURI() { waitForAllConditions(); return getTransportPortInternal(); } + @Internal public File getServerLog() { return confPathLogs.resolve(defaultConfig.get("cluster.name") + "_server.json").toFile(); } + @Internal public File getAuditLog() { return confPathLogs.resolve(defaultConfig.get("cluster.name") + "_audit.json").toFile(); } @@ -1096,30 +1107,30 @@ public class ElasticsearchNode implements TestClusterConfiguration { } @Input - private Set getRemotePlugins() { + public Set getRemotePlugins() { Set file = plugins.stream().filter(uri -> uri.getScheme().equalsIgnoreCase("file") == false).collect(Collectors.toSet()); return file; } @Classpath - private List getInstalledClasspath() { + public List getInstalledClasspath() { return getInstalledFileSet(filter -> filter.include("**/*.jar")); } @InputFiles @PathSensitive(PathSensitivity.RELATIVE) - private List getInstalledFiles() { + public List getInstalledFiles() { return getInstalledFileSet(filter -> filter.exclude("**/*.jar")); } @Classpath - private Set getDistributionClasspath() { + public Set getDistributionClasspath() { return getDistributionFiles(filter -> filter.include("**/*.jar")); } @InputFiles @PathSensitive(PathSensitivity.RELATIVE) - private Set getDistributionFiles() { + public Set getDistributionFiles() { return getDistributionFiles(filter -> filter.exclude("**/*.jar")); } @@ -1136,41 +1147,42 @@ public class ElasticsearchNode implements TestClusterConfiguration { } @Nested - private Map getKeystoreSettings() { - return keystoreSettings; + public List getKeystoreSettings() { + return keystoreSettings.getNormalizedCollection(); } @Nested - private Map getKeystoreFiles() { - return keystoreFiles; + public List getKeystoreFiles() { + return keystoreFiles.getNormalizedCollection(); } @Nested - private Map getSettings() { - return settings; + public List getSettings() { + return settings.getNormalizedCollection(); } @Nested - private Map getSystemProperties() { - return systemProperties; + public List getSystemProperties() { + return systemProperties.getNormalizedCollection(); } @Nested - private Map getEnvironment() { - return environment; + public List getEnvironment() { + return environment.getNormalizedCollection(); } @Nested - private List getJvmArgs() { - return jvmArgs; + public List getJvmArgs() { + return jvmArgs.getNormalizedCollection(); } @Nested - private Map getExtraConfigFiles() { - return extraConfigFiles; + public List getExtraConfigFiles() { + return extraConfigFiles.getNormalizedCollection(); } @Override + @Internal public boolean isProcessAlive() { requireNonNull( esProcess, @@ -1236,6 +1248,7 @@ public class ElasticsearchNode implements TestClusterConfiguration { return Files.exists(httpPortsFile) && Files.exists(transportPortFile); } + @Internal public boolean isHttpSslEnabled() { return Boolean.valueOf( settings.getOrDefault("xpack.security.http.ssl.enabled", "false").toString()