How to use azure-common - 10 common examples

To help you get started, we’ve selected a few azure-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-node / test / services / sharedaccesssignature-tests.js View on Github external
//

var assert = require('assert');

var qs = require('querystring');

// Test includes
var testutil = require('../../../util/util');

// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var WebResource = common.WebResource;
var SharedAccessSignature = storage.SharedAccessSignature;
var Constants = common.Constants;
var ServiceClientConstants = common.ServiceClientConstants;
var BlobConstants = Constants.BlobConstants;
var QueryStringConstants = Constants.QueryStringConstants;

suite('sharedaccesssignature-tests', function () {
  test('GenerateSignatureContainer', function (done) {
    var credentials = new SharedAccessSignature(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY);

    var sharedAccessPolicy = {
      Id: 'YWJjZGVmZw==',
      AccessPolicy: {
        Permissions: BlobConstants.SharedAccessPermissions.READ,
        Start: '2011-10-11T00%3A00%3A00',
        Expiry: '2011-10-12T00%3A00%3A00'
      }
    };
github Azure / azure-sdk-for-node / test / services / queue / queueservice-tests.js View on Github external
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

var assert = require('assert');

// Test includes
var testutil = require('../../util/util');
var queuetestutil = require('../../framework/queue-test-utils');

// Lib includes
var azure = testutil.libRequire('azure');
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var azureutil = common.util;

var Constants = common.Constants;
var ServiceClientConstants = common.ServiceClientConstants;
var HttpConstants = Constants.HttpConstants;

var queueService;
var queueNames = [];
var queueNamesPrefix = 'queue';

var testPrefix = 'queueservice-tests';

var tableService;
var suiteUtil;

suite('queueservice-tests', function () {
  suiteSetup(function (done) {
github Azure / azure-sdk-for-node / test / services / blob / blobservice-tests.js View on Github external
// Test includes
var testutil = require('../../util/util');
var blobtestutil = require('../../framework/blob-test-utils');

// Lib includes
var common = require('azure-common');
var storage = testutil.libRequire('services/legacyStorage');

var azureutil = common.util;
var azure = testutil.libRequire('azure');
var WebResource = common.WebResource;

var SharedAccessSignature = storage.SharedAccessSignature;
var BlobService = storage.BlobService;
var ServiceClient = common.ServiceClient;
var ExponentialRetryPolicyFilter = common.ExponentialRetryPolicyFilter;
var Constants = common.Constants;
var BlobConstants = Constants.BlobConstants;
var HttpConstants = Constants.HttpConstants;
var ServiceClientConstants = common.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;

var containerNames = [];
var containerNamesPrefix = 'cont';

var blobNames = [];
var blobNamesPrefix = 'blob';

var testPrefix = 'blobservice-tests';

var blobService;
github Azure / azure-sdk-for-node / test / services / table / querytablesresultcontinuation-tests.js View on Github external
// limitations under the License.
//

var assert = require('assert');

// Test includes
var testutil = require('../../util/util');
var tabletestutil = require('../../framework/table-test-utils');

// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var azureutil = common.util;
var testutil = testutil.libRequire('common/lib/util/util');

var ServiceClient = common.ServiceClient;
var TableQuery = storage.TableQuery;
var Constants = common.Constants;
var HttpConstants = Constants.HttpConstants;
var StorageErrorCodeStrings = Constants.StorageErrorCodeStrings;

var tableService;
var tableNames = [];
var tablePrefix = 'tablecont';

suite('querytablesresultcontinuation-tests', function () {
  setup(function (done) {
    tableService = storage.createTableService()
      .withFilter(new common.ExponentialRetryPolicyFilter());

    done();
  });
github Azure / azure-sdk-for-node / test / services / table / tabledatatype-tests.js View on Github external
//

var assert = require('assert');
var _ = require('underscore');

// Test includes
var testutil = require('../../util/util');
var tabletestutil = require('../../framework/table-test-utils');

// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');

var azureutil = common.util;

var ServiceClient = common.ServiceClient;
var TableQuery = storage.TableQuery;
var Constants = common.Constants;
var HttpConstants = Constants.HttpConstants;
var StorageErrorCodeStrings = Constants.StorageErrorCodeStrings;

var tableNames = [];
var tablePrefix = 'tabledatatype';

var testPrefix = 'tabledatatype-tests';

var tableService;
var suiteUtil;

describe('Table Service', function () {
  before(function (done) {
    tableService = storage.createTableService()
github Azure / azure-sdk-for-node / test / services / HDInsight / hdinsight-createCluster-unit-tests.js View on Github external
// 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) {
github Azure / azure-sdk-for-node / test / services / table / internal / sharedkeylitetable-tests.js View on Github external
// 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 assert = require('assert');

// Test includes
var testutil = require('../../../util/util');

// Lib includes
var common = require('azure-common');
var SharedKeyLiteTable = require('azure-storage-legacy').SharedKeyLiteTable;
var WebResource = common.WebResource;
var ServiceClientConstants = common.ServiceClientConstants;
var Constants = common.Constants;
var HeaderConstants = Constants.HeaderConstants;
var QueryStringConstants = Constants.QueryStringConstants;

var sharedkey;

suite('sharedkeylitetable-tests', function () {
  setup(function (done) {
    sharedkey = new SharedKeyLiteTable(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY, false);

    done();
  });

  teardown(function (done) {
    // clean up
    done();
github Azure / azure-sdk-for-node / test / services / blob / blobservice-tests.js View on Github external
// Lib includes
var common = require('azure-common');
var storage = testutil.libRequire('services/legacyStorage');

var azureutil = common.util;
var azure = testutil.libRequire('azure');
var WebResource = common.WebResource;

var SharedAccessSignature = storage.SharedAccessSignature;
var BlobService = storage.BlobService;
var ServiceClient = common.ServiceClient;
var ExponentialRetryPolicyFilter = common.ExponentialRetryPolicyFilter;
var Constants = common.Constants;
var BlobConstants = Constants.BlobConstants;
var HttpConstants = Constants.HttpConstants;
var ServiceClientConstants = common.ServiceClientConstants;
var QueryStringConstants = Constants.QueryStringConstants;

var containerNames = [];
var containerNamesPrefix = 'cont';

var blobNames = [];
var blobNamesPrefix = 'blob';

var testPrefix = 'blobservice-tests';

var blobService;
var suiteUtil;

describe('BlobService', function () {
  before(function (done) {
    blobService = storage.createBlobService()
github Azure / azure-sdk-for-node / test / services / sharedkey-tests.js View on Github external
//
// See the License for the specific language governing permissions and
// limitations under the License.
//

var assert = require('assert');

// Test includes
var testutil = require('../../../util/util');

// Lib includes
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var WebResource = common.WebResource;
var SharedKey = storage.SharedKey;
var ServiceClientConstants = common.ServiceClientConstants;
var Constants = common.Constants;
var QueryStringConstants = Constants.QueryStringConstants;
var HeaderConstants = Constants.HeaderConstants;

var sharedkey;

suite('sharedkey-tests', function () {
  setup(function (done) {
    sharedkey = new SharedKey(ServiceClientConstants.DEVSTORE_STORAGE_ACCOUNT, ServiceClientConstants.DEVSTORE_STORAGE_ACCESS_KEY, false);

    done();
  });

  teardown(function (done) {
    // clean up
    done();
github Azure / azure-sdk-for-node / test / services / queue / queueservice-tests.js View on Github external
//

var assert = require('assert');

// Test includes
var testutil = require('../../util/util');
var queuetestutil = require('../../framework/queue-test-utils');

// Lib includes
var azure = testutil.libRequire('azure');
var common = require('azure-common');
var storage = require('azure-storage-legacy');
var azureutil = common.util;

var Constants = common.Constants;
var ServiceClientConstants = common.ServiceClientConstants;
var HttpConstants = Constants.HttpConstants;

var queueService;
var queueNames = [];
var queueNamesPrefix = 'queue';

var testPrefix = 'queueservice-tests';

var tableService;
var suiteUtil;

suite('queueservice-tests', function () {
  suiteSetup(function (done) {
    queueService = storage.createQueueService()
      .withFilter(new common.ExponentialRetryPolicyFilter());