Skip to content

Commit d32fb4d

Browse files
author
Bulat Shakirzyanov
committed
update scenario
1 parent bc42dc6 commit d32fb4d

File tree

1 file changed

+30
-72
lines changed

1 file changed

+30
-72
lines changed

features/schema_metadata.feature

Lines changed: 30 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Feature: Schema Metadata
4444
replicate_on_write='false';
4545
"""
4646

47-
Scenario: Keyspace metadata will exist for all major Cassandra versions
47+
Scenario: Getting keyspace metadata
4848
Given the following example:
4949
"""php
5050
<?php
@@ -72,7 +72,7 @@ Feature: Schema Metadata
7272
Has Durable Writes: False
7373
"""
7474

75-
Scenario: Table metadata will exist for all major Cassandra versions
75+
Scenario: Getting table metadata
7676
Given the following example:
7777
"""php
7878
<?php
@@ -86,11 +86,7 @@ Feature: Schema Metadata
8686
8787
echo "Name: " . $table->name() . "\n";
8888
echo "Bloom Filter: " . $table->bloomFilterFPChance() . "\n";
89-
$patterns = array();
90-
$patterns[0] = '/{/';
91-
$patterns[1] = '/"/';
92-
$patterns[2] = '/:/';
93-
$patterns[3] = '/keys/';
89+
$patterns = array('/{/', '/"/', '/:/', '/keys/');
9490
$table_caching = explode(",", $table->caching());
9591
echo "Caching: " . preg_replace($patterns, "", $table_caching[0]) . "\n";
9692
echo "Comment: " . $table->comment() . "\n";
@@ -121,8 +117,7 @@ Feature: Schema Metadata
121117
"""
122118

123119
@cassandra-version-less-2.1
124-
Scenario: Additional table metadata will only exist for Cassandra versions
125-
1.2 and v2.0
120+
Scenario: Getting table metadata for io cache and replicate on write
126121
Given the following example:
127122
"""php
128123
<?php
@@ -145,8 +140,7 @@ Feature: Schema Metadata
145140
"""
146141

147142
@cassandra-version-only-2.0
148-
Scenario: Additional table metadata will only exist for Cassandra versions
149-
2.0
143+
Scenario: Getting table metadata for index interval
150144
Given the following example:
151145
"""php
152146
<?php
@@ -168,8 +162,8 @@ Feature: Schema Metadata
168162
"""
169163

170164
@cassandra-version-2.0
171-
Scenario: Additional table metadata will only exist for Cassandra versions
172-
2.0+
165+
Scenario: Getting table metadata for default TTL, memtable flush period and
166+
speculative retry
173167
Given the following example:
174168
"""php
175169
<?php
@@ -197,8 +191,7 @@ Feature: Schema Metadata
197191
"""
198192

199193
@cassandra-version-2.1
200-
Scenario: Additional table metadata will only exist for Cassandra versions
201-
2.1+
194+
Scenario: Getting table metadata for max and min index intervals
202195
Given the following example:
203196
"""php
204197
<?php
@@ -223,8 +216,7 @@ Feature: Schema Metadata
223216
"""
224217

225218
@cassandra-version-2.0
226-
Scenario: Data types can be determined by the column metadata for Cassandra
227-
versions 2.0+
219+
Scenario: Getting metadata for column and types
228220
Given the following example:
229221
"""php
230222
<?php
@@ -234,63 +226,29 @@ Feature: Schema Metadata
234226
$session = $cluster->connect("simplex");
235227
$schema = $session->schema();
236228
$table = $schema->keyspace("simplex")->table("values");
237-
$id = $table->column("id")->type();
238-
$bigint = $table->column("bigint_value")->type();
239-
$decimal = $table->column("decimal_value")->type();
240-
$double = $table->column("double_value")->type();
241-
$float = $table->column("float_value")->type();
242-
$int = $table->column("int_value")->type();
243-
$varint = $table->column("varint_value")->type();
244-
$ascii = $table->column("ascii_value")->type();
245-
$text = $table->column("text_value")->type();
246-
$varchar = $table->column("varchar_value")->type();
247-
$timestamp = $table->column("timestamp_value")->type();
248-
$blob = $table->column("blob_value")->type();
249-
$uuid = $table->column("uuid_value")->type();
250-
$timeuuid = $table->column("timeuuid_value")->type();
251-
$inet = $table->column("inet_value")->type();
252-
$list = $table->column("list_value")->type();
253-
$map = $table->column("map_value")->type();
254-
$set = $table->column("set_value")->type();
255-
256-
echo $id . "\n";
257-
echo $bigint . "\n";
258-
echo $decimal . "\n";
259-
echo $double . "\n";
260-
echo $float . "\n";
261-
echo $int . "\n";
262-
echo $varint . "\n";
263-
echo $ascii . "\n";
264-
echo $text . "\n";
265-
echo $varchar . "\n";
266-
echo $timestamp . "\n";
267-
echo $blob . "\n";
268-
echo $uuid . "\n";
269-
echo $timeuuid . "\n";
270-
echo $inet . "\n";
271-
echo $list . "\n";
272-
echo $map . "\n";
273-
echo $set . "\n";
229+
foreach ($table->columns() as $column) {
230+
echo $column->name() . ': ' . $column->type();
231+
}
274232
"""
275233
When it is executed
276234
Then its output should contain:
277235
"""
278-
int
279-
bigint
280-
decimal
281-
double
282-
float
283-
int
284-
varint
285-
ascii
286-
varchar
287-
varchar
288-
timestamp
289-
blob
290-
uuid
291-
timeuuid
292-
inet
293-
list<varchar>
294-
map<timestamp, double>
295-
set<float>
236+
id: int
237+
bigint_value: bigint
238+
decimal_value: decimal
239+
double_value: double
240+
float_value: float
241+
int_value: int
242+
varint_value: varint
243+
ascii_value: ascii
244+
text_value: varchar
245+
varchar_value: varchar
246+
timestamp_value: timestamp
247+
blob_value: blob
248+
uuid_value: uuid
249+
timeuuid_value: timeuuid
250+
inet_value: inet
251+
list_value: list<text>
252+
map_value: map<timestamp, double>
253+
set_value: set<float>
296254
"""

0 commit comments

Comments
 (0)