protected virtual void CreateTestStorageEntities() { TestQueue = QueueClient.GetQueueReference(string.Format("test-input-{0}", _testId)); TestQueue.CreateIfNotExists(); TestQueue.Clear(); TestInputContainer = BlobClient.GetContainerReference(string.Format("test-input-{0}", _testId)); TestInputContainer.CreateIfNotExists(); TestOutputContainer = BlobClient.GetContainerReference(string.Format("test-output-{0}", _testId)); TestOutputContainer.CreateIfNotExists(); TestTable = TableClient.GetTableReference("test"); TestTable.CreateIfNotExists(); DeleteEntities(TestTable, "AAA"); DeleteEntities(TestTable, "BBB"); var batch = new TableBatchOperation(); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "001", Region = "West", Name = "Test Entity 1", Status = 0 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "002", Region = "East", Name = "Test Entity 2", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "003", Region = "West", Name = "Test Entity 3", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "004", Region = "West", Name = "Test Entity 4", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "005", Region = "East", Name = "Test Entity 5", Status = 0 }); TestTable.ExecuteBatch(batch); batch = new TableBatchOperation(); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "001", Region = "South", Name = "Test Entity 1", Status = 0 }); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "002", Region = "West", Name = "Test Entity 2", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "003", Region = "West", Name = "Test Entity 3", Status = 0 }); TestTable.ExecuteBatch(batch); string serviceBusQueueName = string.Format("test-input-{0}", _testId); string connectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.ServiceBus); var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString); namespaceManager.DeleteQueue(serviceBusQueueName); namespaceManager.CreateQueue(serviceBusQueueName); ServiceBusQueueClient = Microsoft.ServiceBus.Messaging.QueueClient.CreateFromConnectionString(connectionString, serviceBusQueueName); }
private void CreateTestStorageEntities() { TestQueue = _queueClient.GetQueueReference("test-input"); TestQueue.CreateIfNotExists(); TestQueue.Clear(); TestContainer = _blobClient.GetContainerReference("test-output"); TestContainer.CreateIfNotExists(); }
private void CreateTestStorageEntities() { string connectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.Storage); CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString); CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient(); TestQueue = queueClient.GetQueueReference("test-input"); TestQueue.CreateIfNotExists(); TestQueue.Clear(); CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); TestContainer = blobClient.GetContainerReference("test-output"); TestContainer.CreateIfNotExists(); }
protected virtual void CreateTestStorageEntities() { TestQueue = QueueClient.GetQueueReference(string.Format("test-input-{0}", FixtureId)); TestQueue.CreateIfNotExists(); TestQueue.Clear(); // This queue name should really be suffixed by -fsharp, -csharp, -node etc. MobileTablesQueue = QueueClient.GetQueueReference("mobiletables-input"); MobileTablesQueue.CreateIfNotExists(); // do not clear this queue since it is currently shared between fixtures TestInputContainer = BlobClient.GetContainerReference(string.Format("test-input-{0}", FixtureId)); TestInputContainer.CreateIfNotExists(); // Processing a large number of blobs on startup can take a while, // so let's start with an empty container. TestHelpers.ClearContainer(TestInputContainer); TestOutputContainer = BlobClient.GetContainerReference(string.Format("test-output-{0}", FixtureId)); TestOutputContainer.CreateIfNotExists(); TestHelpers.ClearContainer(TestOutputContainer); TestTable = TableClient.GetTableReference("test"); TestTable.CreateIfNotExists(); DeleteEntities(TestTable, "AAA"); DeleteEntities(TestTable, "BBB"); var batch = new TableBatchOperation(); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "001", Region = "West", Name = "Test Entity 1", Status = 0 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "002", Region = "East", Name = "Test Entity 2", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "003", Region = "West", Name = "Test Entity 3", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "004", Region = "West", Name = "Test Entity 4", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "AAA", RowKey = "005", Region = "East", Name = "Test Entity 5", Status = 0 }); TestTable.ExecuteBatch(batch); batch = new TableBatchOperation(); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "001", Region = "South", Name = "Test Entity 1", Status = 0 }); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "002", Region = "West", Name = "Test Entity 2", Status = 1 }); batch.Insert(new TestEntity { PartitionKey = "BBB", RowKey = "003", Region = "West", Name = "Test Entity 3", Status = 0 }); TestTable.ExecuteBatch(batch); string serviceBusQueueName = string.Format("test-input-{0}", FixtureId); string connectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.ServiceBus); var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString); namespaceManager.DeleteQueue(serviceBusQueueName); namespaceManager.CreateQueue(serviceBusQueueName); ServiceBusQueueClient = Microsoft.ServiceBus.Messaging.QueueClient.CreateFromConnectionString(connectionString, serviceBusQueueName); }