Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var mocha = require('mocha');
var sinon = require('sinon');
var should = require('should');
var _ = require('underscore');
var HDInsightTestUtils = require('../../framework/hdinsight-test-utils');
var azureUtil = require('azure-common').util;
var uuid = require('uuid');
var Validate = require('azure-common').validate;
// Test includes
var testutil = require('../../util/util');
var PerformRequestStubUtil = require('./PerformRequestStubUtil');
var HDInsightTestUtils = require('../../framework/hdinsight-test-utils');
var azure = testutil.libRequire('azure');
var performRequestStubUtil;
describe('HDInsight createCluster (under unit test)', function() {
var HDInsight = require('azure-asm-hdinsight').HDInsightService;
var hdInsight;
var hdInsightTestUtils;
beforeEach(function (done) {
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
var _ = require('underscore');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var Constants = azureCommon.Constants;
var validate = azureCommon.validate;
var HeaderConstants = Constants.HeaderConstants;
var WebResource = azureCommon.WebResource;
var registrationResult = require('./models/registrationresult');
/**
* Creates a new ApnsService object using the specified {@link NotificationHubService} object.
*
*
* __Note__: An instance of this object is created automatically when a {@link NotificationHubService}
* object is created. See {@link NotificationHubService#apns}.
* @class
* The ApnsService class is used to send notifications using the Apple Push Notification Service (APNS).
* This service is used to communicate with iOS device.
* @constructor
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var util = require('util');
var _ = require('underscore');
var wns = require('wns');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var Constants = azureCommon.Constants;
var validate = azureCommon.validate;
var HeaderConstants = Constants.HeaderConstants;
var WebResource = azureCommon.WebResource;
var registrationResult = require('./models/registrationresult');
// valid badge values from http://msdn.microsoft.com/en-us/library/windows/apps/br212849.aspx
var badges = ['none','activity','alert','available','away','busy','newMessage','paused','playing','unavailable','error', 'attention'];
// valid notification types from http://msdn.microsoft.com/en-us/library/windows/apps/hh465435.aspx
var types = ['wns/toast', 'wns/badge', 'wns/tile', 'wns/raw'];
// White list of methods to use from wns module
var templateSpecs = {
TileSquareBlock: [0, 2],
TileSquareText01: [0, 4],
TileSquareText02: [0, 2],
* Creates a new BasicAuthenticationCloudCredentials object.
* Either a pair of cert / key values need to be pass or a pem file location.
*
* @param {string} credentials.username The username.
* @param {string} credentials.password The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;
exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;
exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;
// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
exports.AnonymousCloudCredentials = azureCommon.AnonymousCloudCredentials;
exports.SharedAccessSignature = storage.SharedAccessSignature;
exports.SharedKey = storage.SharedKey;
exports.SharedKeyLite = storage.SharedKeyLite;
exports.SharedKeyTable = storage.SharedKeyTable;
exports.SharedKeyLiteTable = storage.SharedKeyLiteTable;
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Module dependencies.
var util = require('util');
var _ = require('underscore');
var uuid = require('uuid');
var azureCommon = require('azure-common');
var azureUtil = azureCommon.util;
var js2xml = azureCommon.js2xml;
var Validate = azureCommon.validate;
var WebResource = azureCommon.WebResource;
var ServiceManagementClient = azureCommon.ServiceManagementClient;
var ServiceManagementSettings = azureCommon.ServiceManagementSettings;
/**
*
* Creates a new HDInsightService object
* @class
* The HDInsightService class is used to perform operations on the Microsoft Azure HDInsight Service.
*
* @constructor
* @param {string} configOrSubscriptionId configuration store or subscription ID for the account or the connection string
* @param {object} authentication The authentication object for the client.
*
* You must use either keyfile/certfile or keyvalue/certvalue
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Module dependencies.
var util = require('util');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var validate = azureCommon.validate;
var StorageServiceClient = azureCommon.StorageServiceClient;
var BatchServiceClient = require('./batchserviceclient');
var SharedKeyTable = require('./internal/sharedkeytable');
var TableQuery = require('./tablequery');
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;
var TableConstants = Constants.TableConstants;
// Models requires
var tableResult = require('./models/tableresult');
var tableQueryResult = require('./models/listresult')(tableResult);
var entityResult = require('./models/entityresult');
var entityQueryResult = require('./models/listresult')(entityResult);
var servicePropertiesResult = require('./models/servicepropertiesresult');
// limitations under the License.
//
// Module dependencies.
var util = require('util');
var querystring = require('querystring');
var _ = require('underscore');
var azureCommon = require('azure-common');
var ServiceManagementSettings = azureCommon.ServiceManagementSettings;
var ServiceManagementClient = azureCommon.ServiceManagementClient;
var WebResource = azureCommon.WebResource;
var ServiceManagementSerialize = require('./models/servicemanagementserialize');
var Constants = azureCommon.Constants;
var validate = azureCommon.validate;
var jsonTransformer = require('./jsontransform/jsontransformer');
var serviceManagementMeta = require('./jsontransform/servicemanagementmeta.json');
function attributeToKeyValue(object) {
for(var key in object)
{
if (key === Constants.XML_METADATA_MARKER) {
for (var atrKey in object[key]) {
if (object[key].hasOwnProperty(atrKey)) {
var newKey = atrKey[0].toUpperCase() + atrKey.substr(1);
object[newKey] = object[key][atrKey];
}
}
delete object[key];
} else if (typeof(object[key]) == 'object') {
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Module dependencies.
var util = require('util');
var _ = require('underscore');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var validate = azureCommon.validate;
var StorageServiceClient = azureCommon.StorageServiceClient;
var SharedKey = require('../blob/internal/sharedkey');
var WebResource = azureCommon.WebResource;
var Constants = azureCommon.Constants;
var QueryStringConstants = Constants.QueryStringConstants;
var HttpConstants = Constants.HttpConstants;
var HeaderConstants = Constants.HeaderConstants;
// Models requires
var ListQueuesResultContinuation = require('./models/listqueuesresultcontinuation');
var QueueResult = require('./models/queueresult');
var QueueMessageResult = require('./models/queuemessageresult');
var servicePropertiesResult = require('./models/servicepropertiesresult');
/**
* Creates a new BasicAuthenticationCloudCredentials object.
* Either a pair of cert / key values need to be pass or a pem file location.
* @method
* @param {string} credentials.username The username.
* @param {string} credentials.password The password.
* @return {BasicAuthenticationCloudCredentials}
*/
exports.createBasicAuthenticationCloudCredentials = azureWebSite.createBasicAuthenticationCloudCredentials;
exports.Constants = azureCommon.Constants;
exports.ServiceClient = azureCommon.ServiceClient;
exports.ServiceClientConstants = azureCommon.ServiceClientConstants;
exports.ConnectionStringParser = azureCommon.ConnectionStringParser;
exports.Logger = azureCommon.Logger;
exports.WebResource = azureCommon.WebResource;
exports.Validate = azureCommon.validate;
exports.date = azureCommon.date;
exports.ServiceSettings = azureCommon.ServiceSettings;
exports.ServiceBusSettings = azureCommon.ServiceBusSettings;
exports.ServiceManagementSettings = azureCommon.ServiceManagementSettings;
exports.StorageServiceSettings = azureCommon.StorageServiceSettings;
// Credentials
exports.CertificateCloudCredentials = azureCommon.CertificateCloudCredentials;
exports.TokenCloudCredentials = azureCommon.TokenCloudCredentials;
exports.AnonymousCloudCredentials = azureCommon.AnonymousCloudCredentials;
exports.SharedAccessSignature = storage.SharedAccessSignature;
exports.SharedKey = storage.SharedKey;
exports.SharedKeyLite = storage.SharedKeyLite;
exports.SharedKeyTable = storage.SharedKeyTable;
exports.SharedKeyLiteTable = storage.SharedKeyLiteTable;
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var _ = require('underscore');
var azureCommon = require('azure-common');
var azureutil = azureCommon.util;
var Constants = azureCommon.Constants;
var validate = azureCommon.validate;
var HeaderConstants = Constants.HeaderConstants;
var WebResource = azureCommon.WebResource;
var registrationResult = require('./models/registrationresult');
/**
* Creates a new GcmService object.
*
*
* __Note__: An instance of this object is created automatically when a {@link NotificationHubService}
* object is created. See {@link NotificationHubService#gcm}.
* @class
* The GcmService class is used to send notifications using [Google Cloud Messaging](http://developer.android.com/google/gcm/index.html).
* @constructor
*
* @param {NotificationHubService} notificationHubService The notification hub service.