Search in sources :

Example 6 with StackCreationMock

use of com.sequenceiq.it.cloudbreak.v2.mock.StackCreationMock in project cloudbreak by hortonworks.

the class MockClusterCreationWithSaltSuccessTest method breakDown.

@AfterClass
public void breakDown() {
    StackCreationMock stackCreationMock = getItContext().getContextParam(CloudbreakV2Constants.MOCK_SERVER, StackCreationMock.class);
    stackCreationMock.stop();
}
Also used : StackCreationMock(com.sequenceiq.it.cloudbreak.v2.mock.StackCreationMock) AfterClass(org.testng.annotations.AfterClass)

Example 7 with StackCreationMock

use of com.sequenceiq.it.cloudbreak.v2.mock.StackCreationMock in project cloudbreak by hortonworks.

the class MockStackCreationWithSaltSuccessTest method configMockServer.

@BeforeClass
@Parameters({ "stackName", "mockPort", "sshPort" })
public void configMockServer(String stackName, @Optional("9443") int mockPort, @Optional("2020") int sshPort) {
    IntegrationTestContext itContext = getItContext();
    List<InstanceGroup> instanceGroups = itContext.getContextParam(CloudbreakITContextConstants.TEMPLATE_ID, List.class);
    int numberOfServers = 0;
    for (InstanceGroup ig : instanceGroups) {
        numberOfServers += ig.getNodeCount();
    }
    StackCreationMock stackCreationMock = (StackCreationMock) applicationContext.getBean(StackCreationMock.NAME, mockPort, sshPort, numberOfServers);
    stackCreationMock.addSPIEndpoints();
    stackCreationMock.mockImageCatalogResponse(itContext);
    itContext.putContextParam(CloudbreakV2Constants.MOCK_SERVER, stackCreationMock);
    itContext.putContextParam(CloudbreakITContextConstants.MOCK_INSTANCE_MAP, stackCreationMock.getInstanceMap());
}
Also used : IntegrationTestContext(com.sequenceiq.it.IntegrationTestContext) StackCreationMock(com.sequenceiq.it.cloudbreak.v2.mock.StackCreationMock) InstanceGroup(com.sequenceiq.it.cloudbreak.InstanceGroup) BeforeClass(org.testng.annotations.BeforeClass) Parameters(org.testng.annotations.Parameters)

Aggregations

StackCreationMock (com.sequenceiq.it.cloudbreak.v2.mock.StackCreationMock)6 Parameters (org.testng.annotations.Parameters)4 IntegrationTestContext (com.sequenceiq.it.IntegrationTestContext)3 Test (org.testng.annotations.Test)3 KerberosRequest (com.sequenceiq.cloudbreak.api.model.KerberosRequest)2 AfterClass (org.testng.annotations.AfterClass)2 BeforeClass (org.testng.annotations.BeforeClass)2 ClusterV1Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v1.ClusterV1Endpoint)1 ClusterRequest (com.sequenceiq.cloudbreak.api.model.ClusterRequest)1 GatewayJson (com.sequenceiq.cloudbreak.api.model.GatewayJson)1 HostGroupRequest (com.sequenceiq.cloudbreak.api.model.HostGroupRequest)1 AmbariV2Request (com.sequenceiq.cloudbreak.api.model.v2.AmbariV2Request)1 StackV2Request (com.sequenceiq.cloudbreak.api.model.v2.StackV2Request)1 CloudVmMetaDataStatus (com.sequenceiq.cloudbreak.cloud.model.CloudVmMetaDataStatus)1 AbstractCloudbreakIntegrationTest (com.sequenceiq.it.cloudbreak.AbstractCloudbreakIntegrationTest)1 HostGroup (com.sequenceiq.it.cloudbreak.HostGroup)1 InstanceGroup (com.sequenceiq.it.cloudbreak.InstanceGroup)1 AbstractStackCreationV2Test (com.sequenceiq.it.cloudbreak.v2.AbstractStackCreationV2Test)1