use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class StackCreationTest method setContextParams.
@BeforeMethod
public void setContextParams() {
IntegrationTestContext itContext = getItContext();
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.TEMPLATE_ID, List.class), "Template id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.CREDENTIAL_ID), "Credential id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.NETWORK_ID), "Network id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.SECURITY_GROUP_ID), "Security group id is mandatory.");
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class MockInstanceTerminationReplicationTest method configMockServer.
@BeforeClass
@Parameters({ "mockPort", "sshPort" })
public void configMockServer(@Optional("9443") int mockPort, @Optional("2020") int sshPort) {
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> instanceGroupV2RequestMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
String stackName = itContext.getContextParam(CloudbreakV2Constants.STACK_NAME);
int numberOfServers = 0;
for (InstanceGroupV2Request igr : instanceGroupV2RequestMap.values()) {
numberOfServers += igr.getNodeCount();
}
InstanceTerminationReplicationMock instanceTerminationMock = (InstanceTerminationReplicationMock) applicationContext.getBean(InstanceTerminationReplicationMock.NAME, mockPort, sshPort, numberOfServers);
instanceTerminationMock.addAmbariMappings(stackName);
instanceTerminationMock.addMockEndpoints();
itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, instanceTerminationMock);
itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, instanceTerminationMock.getInstanceMap());
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class MockInstanceTerminationUnknownTest method configMockServer.
@BeforeClass
@Parameters({ "mockPort", "sshPort" })
public void configMockServer(@Optional("9443") int mockPort, @Optional("2020") int sshPort) {
IntegrationTestContext itContext = getItContext();
Map<String, InstanceGroupV2Request> instanceGroupV2RequestMap = itContext.getContextParam(CloudbreakV2Constants.INSTANCEGROUP_MAP, Map.class);
String stackName = itContext.getContextParam(CloudbreakV2Constants.STACK_NAME);
int numberOfServers = 0;
for (InstanceGroupV2Request igr : instanceGroupV2RequestMap.values()) {
numberOfServers += igr.getNodeCount();
}
InstanceTerminationUnknownMock instanceTerminationMock = (InstanceTerminationUnknownMock) applicationContext.getBean(InstanceTerminationUnknownMock.NAME, mockPort, sshPort, numberOfServers);
instanceTerminationMock.addAmbariMappings(stackName);
instanceTerminationMock.addMockEndpoints();
itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, instanceTerminationMock);
itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, instanceTerminationMock.getInstanceMap());
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class OpenstackStackCreationV2Test method networkParams.
@BeforeMethod(dependsOnGroups = "V2StackCreationInit")
@Parameters({ "subnetCidr", "floatingPool" })
public void networkParams(String subnetCidr, @Optional("") String floatingPool) {
IntegrationTestContext itContext = getItContext();
NetworkV2Request networkV2Request = createNetworkRequest(itContext, subnetCidr);
floatingPool = StringUtils.hasText(floatingPool) ? floatingPool : itContext.getContextParam(CloudbreakV2Constants.OPENSTACK_FLOATING_POOL);
Map<String, Object> networkParameters = Maps.newHashMap();
if (StringUtils.hasText(floatingPool)) {
networkParameters.put("publicNetId", floatingPool);
}
networkV2Request.setParameters(networkParameters);
}
use of com.sequenceiq.it.IntegrationTestContext in project cloudbreak by hortonworks.
the class StackScalingV2Test method setContextParameters.
@BeforeMethod
public void setContextParameters() {
IntegrationTestContext itContext = getItContext();
Assert.assertNotNull(itContext.getContextParam(CloudbreakV2Constants.STACK_NAME), "Stack name is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.STACK_ID), "Stack id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID), "Ambari user id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID), "Ambari password id is mandatory.");
Assert.assertNotNull(itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PORT_ID), "Ambari port id is mandatory.");
}
Aggregations