cleanup tests

Original commit: elastic/x-pack-elasticsearch@b7733b8269
This commit is contained in:
Areek Zillur 2014-11-04 16:12:42 -05:00
parent 97796d3634
commit 8007136e63
2 changed files with 0 additions and 35 deletions

View File

@ -5,12 +5,10 @@
*/ */
package org.elasticsearch.license.plugin; package org.elasticsearch.license.plugin;
import org.elasticsearch.common.base.Predicate;
import org.elasticsearch.common.collect.Lists; import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.settings.ImmutableSettings; import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.gateway.GatewayService;
import org.elasticsearch.license.core.ESLicense; import org.elasticsearch.license.core.ESLicense;
import org.elasticsearch.license.plugin.action.put.PutLicenseRequestBuilder; import org.elasticsearch.license.plugin.action.put.PutLicenseRequestBuilder;
import org.elasticsearch.license.plugin.action.put.PutLicenseResponse; import org.elasticsearch.license.plugin.action.put.PutLicenseResponse;
@ -26,7 +24,6 @@ import static org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST; import static org.elasticsearch.test.ElasticsearchIntegrationTest.Scope.TEST;
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.equalTo;
//@Ignore
@ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0) @ClusterScope(scope = TEST, numDataNodes = 0, numClientNodes = 0)
public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegrationTests { public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegrationTests {
@ -109,18 +106,6 @@ public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegration
int nNodes = randomIntBetween(2, 10); int nNodes = randomIntBetween(2, 10);
String[] nodes = startNodesWithConsumerPlugins(nNodes, trialLicenseDurationInSeconds, trialLicenseDurationInSeconds); String[] nodes = startNodesWithConsumerPlugins(nNodes, trialLicenseDurationInSeconds, trialLicenseDurationInSeconds);
waitUntilClusterRecovered();
assertThat(awaitBusy(new Predicate<Object>() {
@Override
public boolean apply(Object o) {
for (LazyLicenseRegistrationPluginService service : internalCluster().getDataNodeInstances(LazyLicenseRegistrationPluginService.class)) {
if (!service.registered.get()) {
return false;
}
}
return true;
}
}), equalTo(true));
logger.info(" --> trial license generated"); logger.info(" --> trial license generated");
// managerService should report feature to be enabled on all data nodes // managerService should report feature to be enabled on all data nodes
assertLicenseManagerEnabledFeatureFor(FEATURE_NAME_1); assertLicenseManagerEnabledFeatureFor(FEATURE_NAME_1);
@ -210,13 +195,4 @@ public class LicensesPluginsIntegrationTests extends AbstractLicensesIntegration
assertThat(putLicenseResponse.isAcknowledged(), equalTo(true)); assertThat(putLicenseResponse.isAcknowledged(), equalTo(true));
assertThat(putLicenseResponse.status(), equalTo(LicensesStatus.VALID)); assertThat(putLicenseResponse.status(), equalTo(LicensesStatus.VALID));
} }
private void waitUntilClusterRecovered() throws InterruptedException {
assertThat(awaitBusy(new Predicate<Object>() {
@Override
public boolean apply(Object o) {
return !clusterService().state().blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK);
}
}), equalTo(true));
}
} }

View File

@ -314,17 +314,6 @@ public class LicensesServiceTests extends AbstractLicensesIntegrationTests {
// invoke clusterChanged event to flush out pendingRegistration // invoke clusterChanged event to flush out pendingRegistration
LicensesService licensesService = (LicensesService) clientService; LicensesService licensesService = (LicensesService) clientService;
/*
try {
assertThat(awaitBusy(new Predicate<Object>() {
@Override
public boolean apply(Object o) {
return !clusterService().state().blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK);
}
}), equalTo(true));
} catch (InterruptedException e) {
logger.error("Exception while trying to registerWithTrialLicense", e);
}*/
ClusterChangedEvent event = new ClusterChangedEvent("", clusterService().state(), clusterService().state()); ClusterChangedEvent event = new ClusterChangedEvent("", clusterService().state(), clusterService().state());
licensesService.clusterChanged(event); licensesService.clusterChanged(event);
} }