public HDInsightManagementHelper(CommonTestsFixture testMixture, MockContext context) { resourceManagementClient = testMixture.GetServiceClient <ResourceManagementClient>(context); storageManagementClient = testMixture.GetServiceClient <StorageManagementClient>(context); hdInsightManagementClient = testMixture.GetServiceClient <HDInsightManagementClient>(context); sqlManagementClient = testMixture.GetServiceClient <SqlManagementClient>(context); }
/// <summary> /// Default constructor for management clients, using the TestSupport Infrastructure /// </summary> /// <param name="testFixture">the test class</param> /// <returns>A HDInsight job management client, created from the current context (environment variables)</returns> public static HDInsightJobManagementClient GetHDInsightJobManagementClient(this CommonTestsFixture testFixture, MockContext context) { var credentials = new BasicAuthenticationCredentials { UserName = testFixture.HttpUserName, Password = testFixture.HttpUserPassword }; TestEnvironment currentEnvironment = TestEnvironmentFactory.GetTestEnvironment(); var client = context.GetServiceClientWithCredentials<HDInsightJobManagementClient>(currentEnvironment, credentials, true); client.ClusterDnsName = testFixture.HDInsightClusterUrl; client.Username = CultureInfo.CurrentCulture.TextInfo.ToLower(credentials.UserName); return client; }
public ClusterCreateParameters GetClusterCreateParameters(CommonTestsFixture commonData) { return(new ClusterCreateParameters { ClusterSizeInNodes = 3, ClusterType = commonData.HDInsightClusterType, WorkerNodeSize = commonData.WorkNodeSize, DefaultStorageInfo = new AzureStorageInfo(commonData.StorageAccountName.ToLowerInvariant(), commonData.StorageAccountAccessKey, commonData.ContainerName), UserName = commonData.HttpUserName, Password = commonData.HttpUserPassword, Location = commonData.Location, SshUserName = commonData.SshUserName, SshPassword = commonData.SshUserPassword, Version = commonData.HDInsightClusterVersion }); }