azure 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/azure.gemspec +1 -1
- data/lib/azure.rb +1 -0
- data/lib/azure/blob/blob.rb +1 -1
- data/lib/azure/blob/blob_service.rb +14 -9
- data/lib/azure/blob/block.rb +2 -2
- data/lib/azure/blob/serialization.rb +6 -6
- data/lib/azure/configurable.rb +8 -0
- data/lib/azure/core/filtered_service.rb +1 -1
- data/lib/azure/core/http/debug_filter.rb +2 -2
- data/lib/azure/core/http/http_error.rb +1 -1
- data/lib/azure/core/http/http_filter.rb +15 -15
- data/lib/azure/core/http/http_request.rb +6 -6
- data/lib/azure/core/http/http_response.rb +1 -1
- data/lib/azure/core/http/retry_policy.rb +12 -12
- data/lib/azure/core/http/signer_filter.rb +1 -1
- data/lib/azure/core/service.rb +1 -1
- data/lib/azure/queue/queue_service.rb +91 -91
- data/lib/azure/queue/serialization.rb +1 -1
- data/lib/azure/service/cors.rb +1 -1
- data/lib/azure/service/logging.rb +1 -1
- data/lib/azure/service/metrics.rb +1 -1
- data/lib/azure/service/serialization.rb +10 -10
- data/lib/azure/service/signed_identifier.rb +1 -1
- data/lib/azure/service/storage_service.rb +2 -2
- data/lib/azure/service_bus/auth/wrap_service.rb +2 -2
- data/lib/azure/service_bus/brokered_message.rb +6 -6
- data/lib/azure/service_bus/interval.rb +2 -2
- data/lib/azure/service_bus/queue.rb +11 -11
- data/lib/azure/service_bus/relay.rb +4 -4
- data/lib/azure/service_bus/resource.rb +1 -1
- data/lib/azure/service_bus/rule.rb +1 -1
- data/lib/azure/service_bus/serialization.rb +2 -2
- data/lib/azure/service_bus/service_bus_service.rb +92 -92
- data/lib/azure/service_bus/sql_filter.rb +1 -1
- data/lib/azure/service_bus/sql_rule_action.rb +3 -3
- data/lib/azure/service_bus/subscription.rb +1 -1
- data/lib/azure/service_bus/topic.rb +11 -11
- data/lib/azure/storage_management/storage_management_service.rb +2 -2
- data/lib/azure/table/batch.rb +28 -28
- data/lib/azure/table/batch_response.rb +5 -5
- data/lib/azure/table/edmtype.rb +1 -1
- data/lib/azure/table/entity.rb +2 -2
- data/lib/azure/table/query.rb +6 -6
- data/lib/azure/table/serialization.rb +4 -4
- data/lib/azure/table/table_service.rb +30 -30
- data/lib/azure/version.rb +1 -1
- data/lib/azure/virtual_machine_management/virtual_machine_management_service.rb +5 -4
- data/lib/azure/virtual_network_management/serialization.rb +2 -2
- data/test/fixtures/list_os_images.xml +1 -1
- data/test/fixtures/list_virtual_networks.xml +0 -1
- data/test/fixtures/management_certificate.pem +55 -0
- data/test/fixtures/management_certificate.publishsettings +12 -0
- data/test/fixtures/updated_storage_accounts.xml +8 -8
- data/test/integration/blob/blob_metadata_test.rb +5 -5
- data/test/integration/blob/blob_pages_test.rb +5 -5
- data/test/integration/blob/blob_properties_test.rb +3 -3
- data/test/integration/blob/block_blob_test.rb +64 -15
- data/test/integration/blob/container/container_acl_test.rb +2 -2
- data/test/integration/blob/container/container_metadata_test.rb +2 -2
- data/test/integration/blob/container/create_container_test.rb +3 -3
- data/test/integration/blob/container/delete_container_test.rb +1 -1
- data/test/integration/blob/container/get_container_properties_test.rb +2 -2
- data/test/integration/blob/container/list_containers_test.rb +3 -3
- data/test/integration/blob/copy_blob_test.rb +4 -4
- data/test/integration/blob/create_blob_snapshot_test.rb +2 -2
- data/test/integration/blob/create_page_blob_test.rb +2 -2
- data/test/integration/blob/delete_blob_test.rb +4 -4
- data/test/integration/blob/get_blob_test.rb +7 -7
- data/test/integration/blob/informative_errors_test.rb +2 -2
- data/test/integration/blob/lease/acquire_lease_test.rb +1 -1
- data/test/integration/blob/lease/break_lease_test.rb +2 -2
- data/test/integration/blob/lease/release_lease_test.rb +2 -2
- data/test/integration/blob/lease/renew_lease_test.rb +2 -2
- data/test/integration/blob/list_blobs_test.rb +1 -1
- data/test/integration/database/delete_sql_server_firewall_test.rb +0 -1
- data/test/integration/database/delete_sql_server_test.rb +0 -1
- data/test/integration/location/Location_List_test.rb +0 -1
- data/test/integration/location/RoleSize_List_test.rb +0 -1
- data/test/integration/queue/clear_messages_test.rb +3 -3
- data/test/integration/queue/create_message_test.rb +5 -5
- data/test/integration/queue/create_queue_test.rb +1 -1
- data/test/integration/queue/delete_message_test.rb +4 -4
- data/test/integration/queue/delete_queue_test.rb +1 -1
- data/test/integration/queue/informative_errors_test.rb +2 -2
- data/test/integration/queue/list_messages_encoded_test.rb +2 -2
- data/test/integration/queue/list_messages_test.rb +3 -3
- data/test/integration/queue/list_queues_test.rb +1 -1
- data/test/integration/queue/peek_messages_test.rb +3 -3
- data/test/integration/queue/queue_metadata_test.rb +4 -4
- data/test/integration/queue/update_message_test.rb +4 -4
- data/test/integration/service_bus/informative_errors_test.rb +1 -1
- data/test/integration/service_bus/queues_test.rb +6 -6
- data/test/integration/service_bus/relay_test.rb +3 -3
- data/test/integration/service_bus/rules_test.rb +2 -2
- data/test/integration/service_bus/subscriptions_test.rb +4 -4
- data/test/integration/service_bus/topics_test.rb +2 -2
- data/test/integration/table/delete_entity_batch_test.rb +3 -3
- data/test/integration/table/delete_entity_test.rb +3 -3
- data/test/integration/table/delete_table_test.rb +1 -1
- data/test/integration/table/get_table_test.rb +4 -4
- data/test/integration/table/informative_errors_test.rb +2 -2
- data/test/integration/table/insert_entity_batch_test.rb +3 -3
- data/test/integration/table/insert_entity_test.rb +3 -3
- data/test/integration/table/insert_or_merge_entity_batch_test.rb +7 -7
- data/test/integration/table/insert_or_merge_entity_test.rb +8 -8
- data/test/integration/table/insert_or_replace_entity_batch_test.rb +7 -7
- data/test/integration/table/insert_or_replace_entity_test.rb +7 -7
- data/test/integration/table/merge_entity_batch_test.rb +1 -1
- data/test/integration/table/merge_entity_test.rb +1 -1
- data/test/integration/table/query_entities_test.rb +21 -21
- data/test/integration/table/query_tables_test.rb +2 -2
- data/test/integration/table/query_test.rb +21 -21
- data/test/integration/table/table_acl_test.rb +4 -4
- data/test/integration/table/update_entity_batch_test.rb +6 -6
- data/test/integration/table/update_entity_test.rb +8 -8
- data/test/unit/config/azure_test.rb +19 -0
- data/test/unit/core/auth/shared_key_lite_test.rb +3 -3
- data/test/unit/core/auth/shared_key_test.rb +2 -2
- data/test/unit/service/serialization_test.rb +44 -44
- metadata +4 -6
- data/.gitignore +0 -30
- data/.travis.yml +0 -13
- data/ChangeLog.txt +0 -56
- data/README.md +0 -702
|
@@ -23,7 +23,7 @@ describe Azure::Table::TableService do
|
|
|
23
23
|
let(:table_name){ TableNameHelper.name }
|
|
24
24
|
|
|
25
25
|
let(:entity_properties) {
|
|
26
|
-
{
|
|
26
|
+
{
|
|
27
27
|
"PartitionKey" => "testingpartition",
|
|
28
28
|
"CustomStringProperty" => "CustomPropertyValue",
|
|
29
29
|
"CustomIntegerProperty" => 37,
|
|
@@ -32,13 +32,13 @@ describe Azure::Table::TableService do
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
before {
|
|
35
|
+
before {
|
|
36
36
|
subject.create_table table_name
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
after { TableNameHelper.clean }
|
|
40
40
|
|
|
41
|
-
it "creates an entity if it does not already exist" do
|
|
41
|
+
it "creates an entity if it does not already exist" do
|
|
42
42
|
entity = entity_properties.dup
|
|
43
43
|
entity["RowKey"] = "abcd1234"
|
|
44
44
|
|
|
@@ -62,7 +62,7 @@ describe Azure::Table::TableService do
|
|
|
62
62
|
result.must_be_kind_of Azure::Table::Entity
|
|
63
63
|
result.table.must_equal table_name
|
|
64
64
|
result.etag.must_equal etags[0]
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
entity.each { |k,v|
|
|
67
67
|
unless entity[k].class == Time
|
|
68
68
|
result.properties[k].must_equal entity[k]
|
|
@@ -72,7 +72,7 @@ describe Azure::Table::TableService do
|
|
|
72
72
|
}
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
-
it "updates an existing entity, removing any properties not included in the update operation" do
|
|
75
|
+
it "updates an existing entity, removing any properties not included in the update operation" do
|
|
76
76
|
entity = entity_properties.dup
|
|
77
77
|
entity["RowKey"] = "abcd1234_existing"
|
|
78
78
|
|
|
@@ -91,7 +91,7 @@ describe Azure::Table::TableService do
|
|
|
91
91
|
assert exists, "cannot verify existing record"
|
|
92
92
|
|
|
93
93
|
batch = Azure::Table::Batch.new table_name, entity["PartitionKey"]
|
|
94
|
-
batch.insert_or_replace entity["RowKey"], {
|
|
94
|
+
batch.insert_or_replace entity["RowKey"], {
|
|
95
95
|
"PartitionKey" => entity["PartitionKey"],
|
|
96
96
|
"RowKey" => entity["RowKey"],
|
|
97
97
|
"NewCustomProperty" => "NewCustomValue"
|
|
@@ -102,7 +102,7 @@ describe Azure::Table::TableService do
|
|
|
102
102
|
etags[0].wont_equal existing_etag
|
|
103
103
|
|
|
104
104
|
result = subject.get_entity table_name, entity["PartitionKey"], entity["RowKey"]
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
result.must_be_kind_of Azure::Table::Entity
|
|
107
107
|
result.table.must_equal table_name
|
|
108
108
|
|
|
@@ -22,7 +22,7 @@ describe Azure::Table::TableService do
|
|
|
22
22
|
let(:table_name){ TableNameHelper.name }
|
|
23
23
|
|
|
24
24
|
let(:entity_properties) {
|
|
25
|
-
{
|
|
25
|
+
{
|
|
26
26
|
"PartitionKey" => "testingpartition",
|
|
27
27
|
"CustomStringProperty" => "CustomPropertyValue",
|
|
28
28
|
"CustomIntegerProperty" => 37,
|
|
@@ -31,13 +31,13 @@ describe Azure::Table::TableService do
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
before {
|
|
34
|
+
before {
|
|
35
35
|
subject.create_table table_name
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
after { TableNameHelper.clean }
|
|
39
39
|
|
|
40
|
-
it "creates an entity if it does not already exist" do
|
|
40
|
+
it "creates an entity if it does not already exist" do
|
|
41
41
|
entity = entity_properties.dup
|
|
42
42
|
entity["RowKey"] = "abcd1234"
|
|
43
43
|
|
|
@@ -58,7 +58,7 @@ describe Azure::Table::TableService do
|
|
|
58
58
|
result.must_be_kind_of Azure::Table::Entity
|
|
59
59
|
result.table.must_equal table_name
|
|
60
60
|
result.etag.must_equal etag
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
entity.each { |k,v|
|
|
63
63
|
unless entity[k].class == Time
|
|
64
64
|
result.properties[k].must_equal entity[k]
|
|
@@ -68,7 +68,7 @@ describe Azure::Table::TableService do
|
|
|
68
68
|
}
|
|
69
69
|
end
|
|
70
70
|
|
|
71
|
-
it "updates an existing entity, removing any properties not included in the update operation" do
|
|
71
|
+
it "updates an existing entity, removing any properties not included in the update operation" do
|
|
72
72
|
entity = entity_properties.dup
|
|
73
73
|
entity["RowKey"] = "abcd1234_existing"
|
|
74
74
|
|
|
@@ -86,7 +86,7 @@ describe Azure::Table::TableService do
|
|
|
86
86
|
|
|
87
87
|
assert exists, "cannot verify existing record"
|
|
88
88
|
|
|
89
|
-
etag = subject.insert_or_replace_entity table_name, {
|
|
89
|
+
etag = subject.insert_or_replace_entity table_name, {
|
|
90
90
|
"PartitionKey" => entity["PartitionKey"],
|
|
91
91
|
"RowKey" => entity["RowKey"],
|
|
92
92
|
"NewCustomProperty" => "NewCustomValue"
|
|
@@ -96,7 +96,7 @@ describe Azure::Table::TableService do
|
|
|
96
96
|
etag.wont_equal existing_etag
|
|
97
97
|
|
|
98
98
|
result = subject.get_entity table_name, entity["PartitionKey"], entity["RowKey"]
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
result.must_be_kind_of Azure::Table::Entity
|
|
101
101
|
result.table.must_equal table_name
|
|
102
102
|
|
|
@@ -54,7 +54,7 @@ describe Azure::Table::TableService do
|
|
|
54
54
|
|
|
55
55
|
it "updates an existing entity, merging the properties" do
|
|
56
56
|
batch = Azure::Table::Batch.new table_name, entity_properties["PartitionKey"]
|
|
57
|
-
batch.merge entity_properties["RowKey"], {
|
|
57
|
+
batch.merge entity_properties["RowKey"], {
|
|
58
58
|
"PartitionKey" => entity_properties["PartitionKey"],
|
|
59
59
|
"RowKey" => entity_properties["RowKey"],
|
|
60
60
|
"NewCustomProperty" => "NewCustomValue"
|
|
@@ -52,7 +52,7 @@ describe Azure::Table::TableService do
|
|
|
52
52
|
after { TableNameHelper.clean }
|
|
53
53
|
|
|
54
54
|
it "updates an existing entity, merging the properties" do
|
|
55
|
-
etag = subject.merge_entity table_name, {
|
|
55
|
+
etag = subject.merge_entity table_name, {
|
|
56
56
|
"PartitionKey" => entity_properties["PartitionKey"],
|
|
57
57
|
"RowKey" => entity_properties["RowKey"],
|
|
58
58
|
"NewCustomProperty" => "NewCustomValue"
|
|
@@ -16,13 +16,13 @@ require "integration/test_helper"
|
|
|
16
16
|
require "azure/table/table_service"
|
|
17
17
|
require "azure/core/http/http_error"
|
|
18
18
|
|
|
19
|
-
describe Azure::Table::TableService do
|
|
19
|
+
describe Azure::Table::TableService do
|
|
20
20
|
describe "#query_entities" do
|
|
21
21
|
subject { Azure::Table::TableService.new }
|
|
22
22
|
let(:table_name){ TableNameHelper.name }
|
|
23
23
|
let(:entities_per_partition){3}
|
|
24
24
|
let(:partitions){ ["part1", "part2", "part3"]}
|
|
25
|
-
let(:entities){
|
|
25
|
+
let(:entities){
|
|
26
26
|
entities = {}
|
|
27
27
|
index = 0
|
|
28
28
|
partitions.each { |p|
|
|
@@ -34,18 +34,18 @@ describe Azure::Table::TableService do
|
|
|
34
34
|
}
|
|
35
35
|
entities
|
|
36
36
|
}
|
|
37
|
-
let(:entity_properties){
|
|
38
|
-
{
|
|
37
|
+
let(:entity_properties){
|
|
38
|
+
{
|
|
39
39
|
"CustomStringProperty" => "CustomPropertyValue",
|
|
40
40
|
"CustomIntegerProperty" => 37,
|
|
41
41
|
"CustomBooleanProperty" => true,
|
|
42
42
|
"CustomDateProperty" => Time.now
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
before {
|
|
45
|
+
before {
|
|
46
46
|
subject.create_table table_name
|
|
47
47
|
partitions.each { |p|
|
|
48
|
-
entities[p].each { |e|
|
|
48
|
+
entities[p].each { |e|
|
|
49
49
|
entity = entity_properties.dup
|
|
50
50
|
entity[:PartitionKey] = p
|
|
51
51
|
entity[:RowKey] = e
|
|
@@ -58,7 +58,7 @@ describe Azure::Table::TableService do
|
|
|
58
58
|
|
|
59
59
|
it "Queries a table for list of entities" do
|
|
60
60
|
result = subject.query_entities table_name
|
|
61
|
-
result.must_be_kind_of Array
|
|
61
|
+
result.must_be_kind_of Array
|
|
62
62
|
result.length.must_equal ((partitions.length + 1) * entities_per_partition)
|
|
63
63
|
|
|
64
64
|
result.each { |e|
|
|
@@ -78,7 +78,7 @@ describe Azure::Table::TableService do
|
|
|
78
78
|
row_key = entities[partition][0]
|
|
79
79
|
|
|
80
80
|
result = subject.query_entities table_name, { :partition_key => partition, :row_key => row_key }
|
|
81
|
-
result.must_be_kind_of Array
|
|
81
|
+
result.must_be_kind_of Array
|
|
82
82
|
result.length.must_equal 1
|
|
83
83
|
|
|
84
84
|
result.each { |e|
|
|
@@ -97,7 +97,7 @@ describe Azure::Table::TableService do
|
|
|
97
97
|
projection = ["CustomIntegerProperty", "ThisPropertyDoesNotExist"]
|
|
98
98
|
puts '#########################################'
|
|
99
99
|
result = subject.query_entities table_name, { :select => projection }
|
|
100
|
-
result.must_be_kind_of Array
|
|
100
|
+
result.must_be_kind_of Array
|
|
101
101
|
result.length.must_equal ((partitions.length + 1) * entities_per_partition)
|
|
102
102
|
|
|
103
103
|
result.each { |e|
|
|
@@ -109,7 +109,7 @@ describe Azure::Table::TableService do
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
it "can filter by one or more properties, returning a matching set of entities" do
|
|
112
|
-
subject.insert_entity table_name, entity_properties.merge({
|
|
112
|
+
subject.insert_entity table_name, entity_properties.merge({
|
|
113
113
|
"PartitionKey" => "filter-test-partition",
|
|
114
114
|
"RowKey" => "filter-test-key",
|
|
115
115
|
"CustomIntegerProperty" => entity_properties["CustomIntegerProperty"] + 1,
|
|
@@ -118,41 +118,41 @@ describe Azure::Table::TableService do
|
|
|
118
118
|
|
|
119
119
|
filter = "CustomIntegerProperty gt #{entity_properties["CustomIntegerProperty"]} and CustomBooleanProperty eq false"
|
|
120
120
|
result = subject.query_entities table_name, { :filter => filter }
|
|
121
|
-
result.must_be_kind_of Array
|
|
121
|
+
result.must_be_kind_of Array
|
|
122
122
|
result.length.must_equal 1
|
|
123
123
|
result.first.properties["PartitionKey"].must_equal "filter-test-partition"
|
|
124
124
|
|
|
125
125
|
filter = "CustomIntegerProperty gt #{entity_properties["CustomIntegerProperty"]} and CustomBooleanProperty eq true"
|
|
126
126
|
result = subject.query_entities table_name, { :filter => filter }
|
|
127
|
-
result.must_be_kind_of Array
|
|
127
|
+
result.must_be_kind_of Array
|
|
128
128
|
result.length.must_equal 0
|
|
129
129
|
end
|
|
130
130
|
|
|
131
131
|
it "can limit the result set using the top parameter" do
|
|
132
132
|
result = subject.query_entities table_name, { :top => 3 }
|
|
133
|
-
result.must_be_kind_of Array
|
|
133
|
+
result.must_be_kind_of Array
|
|
134
134
|
result.length.must_equal 3
|
|
135
135
|
result.continuation_token.wont_be_nil
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
it "can page results using the top parameter and continuation_token" do
|
|
139
139
|
result = subject.query_entities table_name, { :top => 3 }
|
|
140
|
-
result.must_be_kind_of Array
|
|
140
|
+
result.must_be_kind_of Array
|
|
141
141
|
result.length.must_equal 3
|
|
142
142
|
result.continuation_token.wont_be_nil
|
|
143
143
|
|
|
144
144
|
result2 = subject.query_entities table_name, { :top => 3, :continuation_token => result.continuation_token }
|
|
145
|
-
result2.must_be_kind_of Array
|
|
145
|
+
result2.must_be_kind_of Array
|
|
146
146
|
result2.length.must_equal 3
|
|
147
147
|
result2.continuation_token.wont_be_nil
|
|
148
148
|
|
|
149
149
|
result3 = subject.query_entities table_name, { :top => 3, :continuation_token => result2.continuation_token }
|
|
150
|
-
result3.must_be_kind_of Array
|
|
150
|
+
result3.must_be_kind_of Array
|
|
151
151
|
result3.length.must_equal 3
|
|
152
152
|
result3.continuation_token.wont_be_nil
|
|
153
153
|
|
|
154
154
|
result4 = subject.query_entities table_name, { :top => 3, :continuation_token => result3.continuation_token }
|
|
155
|
-
result4.must_be_kind_of Array
|
|
155
|
+
result4.must_be_kind_of Array
|
|
156
156
|
result4.length.must_equal 3
|
|
157
157
|
result4.continuation_token.must_be_nil
|
|
158
158
|
end
|
|
@@ -168,7 +168,7 @@ describe Azure::Table::TableService do
|
|
|
168
168
|
filter = "CustomIntegerProperty eq #{entity_properties["CustomIntegerProperty"]}"
|
|
169
169
|
projection = ["PartitionKey", "CustomIntegerProperty"]
|
|
170
170
|
result = subject.query_entities table_name, { :select => projection, :filter => filter, :top => 3 }
|
|
171
|
-
result.must_be_kind_of Array
|
|
171
|
+
result.must_be_kind_of Array
|
|
172
172
|
result.length.must_equal 3
|
|
173
173
|
result.continuation_token.wont_be_nil
|
|
174
174
|
|
|
@@ -177,17 +177,17 @@ describe Azure::Table::TableService do
|
|
|
177
177
|
result.first.properties.length.must_equal 2
|
|
178
178
|
|
|
179
179
|
result2 = subject.query_entities table_name, { :select => projection, :filter => filter, :top => 3, :continuation_token => result.continuation_token }
|
|
180
|
-
result2.must_be_kind_of Array
|
|
180
|
+
result2.must_be_kind_of Array
|
|
181
181
|
result2.length.must_equal 3
|
|
182
182
|
result2.continuation_token.wont_be_nil
|
|
183
183
|
|
|
184
184
|
result3 = subject.query_entities table_name, { :select => projection, :filter => filter, :top => 3, :continuation_token => result2.continuation_token }
|
|
185
|
-
result3.must_be_kind_of Array
|
|
185
|
+
result3.must_be_kind_of Array
|
|
186
186
|
result3.length.must_equal 3
|
|
187
187
|
result3.continuation_token.wont_be_nil
|
|
188
188
|
|
|
189
189
|
result4 = subject.query_entities table_name, { :select => projection, :filter => filter, :top => 3, :continuation_token => result3.continuation_token }
|
|
190
|
-
result4.must_be_kind_of Array
|
|
190
|
+
result4.must_be_kind_of Array
|
|
191
191
|
result4.length.must_equal 3
|
|
192
192
|
result4.continuation_token.must_be_nil
|
|
193
193
|
end
|
|
@@ -16,7 +16,7 @@ require "integration/test_helper"
|
|
|
16
16
|
require "azure/table/table_service"
|
|
17
17
|
require "azure/core/http/http_error"
|
|
18
18
|
|
|
19
|
-
describe Azure::Table::TableService do
|
|
19
|
+
describe Azure::Table::TableService do
|
|
20
20
|
describe "#query_tables" do
|
|
21
21
|
subject { Azure::Table::TableService.new }
|
|
22
22
|
let(:tables){ [TableNameHelper.name, TableNameHelper.name] }
|
|
@@ -27,7 +27,7 @@ describe Azure::Table::TableService do
|
|
|
27
27
|
result = subject.query_tables
|
|
28
28
|
result.must_be_kind_of Array
|
|
29
29
|
|
|
30
|
-
tables.each { |t|
|
|
30
|
+
tables.each { |t|
|
|
31
31
|
table = result.find {|c|
|
|
32
32
|
c[:properties]["TableName"] == t
|
|
33
33
|
}
|
|
@@ -17,13 +17,13 @@ require "azure/table/table_service"
|
|
|
17
17
|
require "azure/table/query"
|
|
18
18
|
require "azure/core/http/http_error"
|
|
19
19
|
|
|
20
|
-
describe Azure::Table::TableService do
|
|
20
|
+
describe Azure::Table::TableService do
|
|
21
21
|
describe "#query_entities" do
|
|
22
22
|
subject { Azure::Table::TableService.new }
|
|
23
23
|
let(:table_name){ TableNameHelper.name }
|
|
24
24
|
let(:entities_per_partition){3}
|
|
25
25
|
let(:partitions){ ["part1", "part2", "part3"]}
|
|
26
|
-
let(:entities){
|
|
26
|
+
let(:entities){
|
|
27
27
|
entities = {}
|
|
28
28
|
index = 0
|
|
29
29
|
partitions.each { |p|
|
|
@@ -35,18 +35,18 @@ describe Azure::Table::TableService do
|
|
|
35
35
|
}
|
|
36
36
|
entities
|
|
37
37
|
}
|
|
38
|
-
let(:entity_properties){
|
|
39
|
-
{
|
|
38
|
+
let(:entity_properties){
|
|
39
|
+
{
|
|
40
40
|
"CustomStringProperty" => "CustomPropertyValue",
|
|
41
41
|
"CustomIntegerProperty" => 37,
|
|
42
42
|
"CustomBooleanProperty" => true,
|
|
43
43
|
"CustomDateProperty" => Time.now
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
before {
|
|
46
|
+
before {
|
|
47
47
|
subject.create_table table_name
|
|
48
48
|
partitions.each { |p|
|
|
49
|
-
entities[p].each { |e|
|
|
49
|
+
entities[p].each { |e|
|
|
50
50
|
entity = entity_properties.dup
|
|
51
51
|
entity[:PartitionKey] = p
|
|
52
52
|
entity[:RowKey] = e
|
|
@@ -61,7 +61,7 @@ describe Azure::Table::TableService do
|
|
|
61
61
|
q = Azure::Table::Query.new.from table_name
|
|
62
62
|
|
|
63
63
|
result = q.execute
|
|
64
|
-
result.must_be_kind_of Array
|
|
64
|
+
result.must_be_kind_of Array
|
|
65
65
|
result.length.must_equal ((partitions.length + 1) * entities_per_partition)
|
|
66
66
|
|
|
67
67
|
result.each { |e|
|
|
@@ -86,7 +86,7 @@ describe Azure::Table::TableService do
|
|
|
86
86
|
.row(row_key)
|
|
87
87
|
|
|
88
88
|
result = q.execute
|
|
89
|
-
result.must_be_kind_of Array
|
|
89
|
+
result.must_be_kind_of Array
|
|
90
90
|
result.length.must_equal 1
|
|
91
91
|
|
|
92
92
|
result.each { |e|
|
|
@@ -110,7 +110,7 @@ describe Azure::Table::TableService do
|
|
|
110
110
|
.select(projection[1])
|
|
111
111
|
|
|
112
112
|
result = q.execute
|
|
113
|
-
result.must_be_kind_of Array
|
|
113
|
+
result.must_be_kind_of Array
|
|
114
114
|
result.length.must_equal ((partitions.length + 1) * entities_per_partition)
|
|
115
115
|
|
|
116
116
|
result.each { |e|
|
|
@@ -122,7 +122,7 @@ describe Azure::Table::TableService do
|
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
it "can filter by one or more properties, returning a matching set of entities" do
|
|
125
|
-
subject.insert_entity table_name, entity_properties.merge({
|
|
125
|
+
subject.insert_entity table_name, entity_properties.merge({
|
|
126
126
|
"PartitionKey" => "filter-test-partition",
|
|
127
127
|
"RowKey" => "filter-test-key",
|
|
128
128
|
"CustomIntegerProperty" => entity_properties["CustomIntegerProperty"] + 1,
|
|
@@ -135,7 +135,7 @@ describe Azure::Table::TableService do
|
|
|
135
135
|
.where("CustomBooleanProperty eq false")
|
|
136
136
|
|
|
137
137
|
result = q.execute
|
|
138
|
-
result.must_be_kind_of Array
|
|
138
|
+
result.must_be_kind_of Array
|
|
139
139
|
result.length.must_equal 1
|
|
140
140
|
result.first.properties["PartitionKey"].must_equal "filter-test-partition"
|
|
141
141
|
|
|
@@ -144,7 +144,7 @@ describe Azure::Table::TableService do
|
|
|
144
144
|
.where("CustomIntegerProperty gt #{entity_properties['CustomIntegerProperty']}")
|
|
145
145
|
.where("CustomBooleanProperty eq true")
|
|
146
146
|
result = q.execute
|
|
147
|
-
result.must_be_kind_of Array
|
|
147
|
+
result.must_be_kind_of Array
|
|
148
148
|
result.length.must_equal 0
|
|
149
149
|
end
|
|
150
150
|
|
|
@@ -154,7 +154,7 @@ describe Azure::Table::TableService do
|
|
|
154
154
|
.top(3)
|
|
155
155
|
|
|
156
156
|
result = q.execute
|
|
157
|
-
result.must_be_kind_of Array
|
|
157
|
+
result.must_be_kind_of Array
|
|
158
158
|
result.length.must_equal 3
|
|
159
159
|
result.continuation_token.wont_be_nil
|
|
160
160
|
end
|
|
@@ -165,7 +165,7 @@ describe Azure::Table::TableService do
|
|
|
165
165
|
.top(3)
|
|
166
166
|
|
|
167
167
|
result = q.execute
|
|
168
|
-
result.must_be_kind_of Array
|
|
168
|
+
result.must_be_kind_of Array
|
|
169
169
|
result.length.must_equal 3
|
|
170
170
|
result.continuation_token.wont_be_nil
|
|
171
171
|
|
|
@@ -176,7 +176,7 @@ describe Azure::Table::TableService do
|
|
|
176
176
|
.next_partition(result.continuation_token[:next_partition_key])
|
|
177
177
|
|
|
178
178
|
result2 = q.execute
|
|
179
|
-
result2.must_be_kind_of Array
|
|
179
|
+
result2.must_be_kind_of Array
|
|
180
180
|
result2.length.must_equal 3
|
|
181
181
|
result2.continuation_token.wont_be_nil
|
|
182
182
|
|
|
@@ -187,7 +187,7 @@ describe Azure::Table::TableService do
|
|
|
187
187
|
.next_partition(result2.continuation_token[:next_partition_key])
|
|
188
188
|
|
|
189
189
|
result3 = q.execute
|
|
190
|
-
result3.must_be_kind_of Array
|
|
190
|
+
result3.must_be_kind_of Array
|
|
191
191
|
result3.length.must_equal 3
|
|
192
192
|
result3.continuation_token.wont_be_nil
|
|
193
193
|
|
|
@@ -198,7 +198,7 @@ describe Azure::Table::TableService do
|
|
|
198
198
|
.next_partition(result3.continuation_token[:next_partition_key])
|
|
199
199
|
|
|
200
200
|
result4 = q.execute
|
|
201
|
-
result4.must_be_kind_of Array
|
|
201
|
+
result4.must_be_kind_of Array
|
|
202
202
|
result4.length.must_equal 3
|
|
203
203
|
result4.continuation_token.must_be_nil
|
|
204
204
|
end
|
|
@@ -220,7 +220,7 @@ describe Azure::Table::TableService do
|
|
|
220
220
|
.top(3)
|
|
221
221
|
|
|
222
222
|
result = q.execute
|
|
223
|
-
result.must_be_kind_of Array
|
|
223
|
+
result.must_be_kind_of Array
|
|
224
224
|
result.length.must_equal 3
|
|
225
225
|
result.continuation_token.wont_be_nil
|
|
226
226
|
|
|
@@ -231,19 +231,19 @@ describe Azure::Table::TableService do
|
|
|
231
231
|
q.next_row(result.continuation_token[:next_row_key]).next_partition(result.continuation_token[:next_partition_key])
|
|
232
232
|
|
|
233
233
|
result2 = q.execute
|
|
234
|
-
result2.must_be_kind_of Array
|
|
234
|
+
result2.must_be_kind_of Array
|
|
235
235
|
result2.length.must_equal 3
|
|
236
236
|
result2.continuation_token.wont_be_nil
|
|
237
237
|
|
|
238
238
|
q.next_row(result2.continuation_token[:next_row_key]).next_partition(result2.continuation_token[:next_partition_key])
|
|
239
239
|
result3 = q.execute
|
|
240
|
-
result3.must_be_kind_of Array
|
|
240
|
+
result3.must_be_kind_of Array
|
|
241
241
|
result3.length.must_equal 3
|
|
242
242
|
result3.continuation_token.wont_be_nil
|
|
243
243
|
|
|
244
244
|
q.next_row(result3.continuation_token[:next_row_key]).next_partition(result3.continuation_token[:next_partition_key])
|
|
245
245
|
result4 = q.execute
|
|
246
|
-
result4.must_be_kind_of Array
|
|
246
|
+
result4.must_be_kind_of Array
|
|
247
247
|
result4.length.must_equal 3
|
|
248
248
|
result4.continuation_token.must_be_nil
|
|
249
249
|
end
|