| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library db_test; | 5 library db_test; |
| 6 | 6 |
| 7 /// NOTE: In order to run these tests, the following datastore indices must | 7 /// NOTE: In order to run these tests, the following datastore indices must |
| 8 /// exist: | 8 /// exist: |
| 9 /// $ cat index.yaml | 9 /// $ cat index.yaml |
| 10 /// indexes: | 10 /// indexes: |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 ..order('-name') | 507 ..order('-name') |
| 508 ..order('-nickname') | 508 ..order('-nickname') |
| 509 ..run(); | 509 ..run(); |
| 510 var models = await runQueryWithExponentialBackoff( | 510 var models = await runQueryWithExponentialBackoff( |
| 511 query, usersSortedAndFilteredNameDescNicknameDesc.length); | 511 query, usersSortedAndFilteredNameDescNicknameDesc.length); |
| 512 compareModels(usersSortedAndFilteredNameDescNicknameDesc, | 512 compareModels(usersSortedAndFilteredNameDescNicknameDesc, |
| 513 models); | 513 models); |
| 514 }, | 514 }, |
| 515 | 515 |
| 516 // Filter lists | 516 // Filter lists |
| 517 /* FIXME: TODO: FIXME: "IN" not supported in public proto/apiary */ | |
| 518 () async { | 517 () async { |
| 519 var query = store.query(User, partition: partition) | 518 var query = store.query(User, partition: partition) |
| 520 ..filter('languages IN', ['foo']) | 519 ..filter('languages =', 'foo') |
| 521 ..order('name') | 520 ..order('name') |
| 522 ..run(); | 521 ..run(); |
| 523 var models = await runQueryWithExponentialBackoff( | 522 var models = await runQueryWithExponentialBackoff( |
| 524 query, fooUsers.length); | 523 query, fooUsers.length); |
| 525 compareModels(fooUsers, models, anyOrder: true); | 524 compareModels(fooUsers, models, anyOrder: true); |
| 526 }, | 525 }, |
| 527 () async { | 526 () async { |
| 528 var query = store.query(User, partition: partition) | 527 var query = store.query(User, partition: partition) |
| 529 ..filter('languages IN', ['bar']) | 528 ..filter('languages =', 'bar') |
| 530 ..order('name') | 529 ..order('name') |
| 531 ..run(); | 530 ..run(); |
| 532 var models = await runQueryWithExponentialBackoff( | 531 var models = await runQueryWithExponentialBackoff( |
| 533 query, barUsers.length); | 532 query, barUsers.length); |
| 534 compareModels(barUsers, models, anyOrder: true); | 533 compareModels(barUsers, models, anyOrder: true); |
| 535 }, | 534 }, |
| 536 | 535 |
| 537 // Filter equals | 536 // Filter equals |
| 538 () async { | 537 () async { |
| 539 var wifeKey = root.append(User, id: usersWithWife.first.wife.id); | 538 var wifeKey = root.append(User, id: usersWithWife.first.wife.id); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 var scopes = datastore_impl.DatastoreImpl.SCOPES; | 682 var scopes = datastore_impl.DatastoreImpl.SCOPES; |
| 684 | 683 |
| 685 withAuthClient(scopes, (String project, httpClient) { | 684 withAuthClient(scopes, (String project, httpClient) { |
| 686 var datastore = new datastore_impl.DatastoreImpl(httpClient, 's~$project'); | 685 var datastore = new datastore_impl.DatastoreImpl(httpClient, 's~$project'); |
| 687 return datastore_test.cleanupDB(datastore, null).then((_) { | 686 return datastore_test.cleanupDB(datastore, null).then((_) { |
| 688 return runE2EUnittest( | 687 return runE2EUnittest( |
| 689 () => runTests(new db.DatastoreDB(datastore), null)); | 688 () => runTests(new db.DatastoreDB(datastore), null)); |
| 690 }); | 689 }); |
| 691 }); | 690 }); |
| 692 } | 691 } |
| OLD | NEW |