Rename testcluster extension to align with plugin name (#34751)

This commit is contained in:
Alpar Torok 2018-10-24 18:15:25 +03:00 committed by GitHub
parent 0f1a5ecf61
commit 4370b44ef0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View File

@ -39,8 +39,8 @@ import java.util.Map;
public class TestClustersPlugin implements Plugin<Project> {
public static final String LIST_TASK_NAME = "listElasticSearchClusters";
public static final String EXTENSION_NAME = "elasticSearchClusters";
private static final String LIST_TASK_NAME = "listTestClusters";
private static final String NODE_EXTENSION_NAME = "testClusters";
private final Logger logger = Logging.getLogger(TestClustersPlugin.class);
@ -50,7 +50,7 @@ public class TestClustersPlugin implements Plugin<Project> {
ElasticsearchNode.class,
(name) -> new ElasticsearchNode(name, GradleServicesAdapter.getInstance(project))
);
project.getExtensions().add(EXTENSION_NAME, container);
project.getExtensions().add(NODE_EXTENSION_NAME, container);
Task listTask = project.getTasks().create(LIST_TASK_NAME);
listTask.setGroup("ES cluster formation");

View File

@ -31,11 +31,11 @@ public class TestClustersPluginIT extends GradleIntegrationTestCase {
public void testListClusters() {
BuildResult result = GradleRunner.create()
.withProjectDir(getProjectDir("testclusters"))
.withArguments("listElasticSearchClusters", "-s")
.withArguments("listTestClusters", "-s")
.withPluginClasspath()
.build();
assertEquals(TaskOutcome.SUCCESS, result.task(":listElasticSearchClusters").getOutcome());
assertEquals(TaskOutcome.SUCCESS, result.task(":listTestClusters").getOutcome());
assertOutputContains(
result.getOutput(),
" * myTestCluster:"

View File

@ -2,40 +2,40 @@ plugins {
id 'elasticsearch.testclusters'
}
elasticSearchClusters {
testClusters {
myTestCluster {
distribution = 'ZIP'
}
}
task user1 {
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
doLast {
println "user1 executing"
}
}
task user2 {
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
doLast {
println "user2 executing"
}
}
task upToDate1 {
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
}
task upToDate2 {
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
}
task skipped1 {
enabled = false
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
}
task skipped2 {
enabled = false
useCluster elasticSearchClusters.myTestCluster
useCluster testClusters.myTestCluster
}