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 gcloud.test.db_all_test; | 5 library gcloud.test.db_all_test; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 import 'package:gcloud/db.dart' as db; | 10 import 'package:gcloud/db.dart' as db; |
11 import 'package:gcloud/src/datastore_impl.dart' as datastore_impl; | 11 import 'package:gcloud/src/datastore_impl.dart' as datastore_impl; |
12 import 'package:unittest/unittest.dart'; | 12 import 'package:unittest/unittest.dart'; |
13 | 13 |
14 import 'db/e2e/db_test_impl.dart' as db_test; | 14 import 'db/e2e/db_test_impl.dart' as db_test; |
15 import 'db/e2e/metamodel_test_impl.dart' as db_metamodel_test; | 15 import 'db/e2e/metamodel_test_impl.dart' as db_metamodel_test; |
16 import 'datastore/e2e/datastore_test_impl.dart' as datastore_test; | 16 import 'datastore/e2e/datastore_test_impl.dart' as datastore_test; |
17 | 17 |
18 | 18 |
19 import 'common_e2e.dart'; | 19 import 'common_e2e.dart'; |
20 | 20 |
21 main() { | 21 main() { |
22 var scopes = datastore_impl.DatastoreImpl.SCOPES; | 22 var scopes = datastore_impl.DatastoreImpl.SCOPES; |
23 | 23 |
24 var now = new DateTime.now().millisecondsSinceEpoch; | 24 var now = new DateTime.now().millisecondsSinceEpoch; |
25 String namespace = '${Platform.operatingSystem}${now}'; | 25 String namespace = '${Platform.operatingSystem}${now}'; |
26 | 26 |
27 withAuthClient(scopes, (String project, httpClient) { | 27 withAuthClient(scopes, (String project, httpClient) { |
28 var datastore = new datastore_impl.DatastoreImpl(httpClient, 's~$project'); | 28 var datastore = new datastore_impl.DatastoreImpl(httpClient, project); |
29 var datastoreDB = new db.DatastoreDB(datastore); | 29 var datastoreDB = new db.DatastoreDB(datastore); |
30 | 30 |
31 return runE2EUnittest(() { | 31 return runE2EUnittest(() { |
32 datastore_test.runTests(datastore, namespace); | 32 datastore_test.runTests(datastore, namespace); |
33 | 33 |
34 test('sleep-between-test-suites', () { | 34 test('sleep-between-test-suites', () { |
35 expect(new Future.delayed(const Duration(seconds: 10)), completes); | 35 expect(new Future.delayed(const Duration(seconds: 10)), completes); |
36 }); | 36 }); |
37 | 37 |
38 db_test.runTests(datastoreDB, namespace); | 38 db_test.runTests(datastoreDB, namespace); |
39 | 39 |
40 test('sleep-between-test-suites', () { | 40 test('sleep-between-test-suites', () { |
41 expect(new Future.delayed(const Duration(seconds: 10)), completes); | 41 expect(new Future.delayed(const Duration(seconds: 10)), completes); |
42 }); | 42 }); |
43 | 43 |
44 db_metamodel_test.runTests(datastore, datastoreDB); | 44 db_metamodel_test.runTests(datastore, datastoreDB); |
45 }).whenComplete(() { | 45 }).whenComplete(() { |
46 return datastore_test.cleanupDB(datastore, namespace); | 46 return datastore_test.cleanupDB(datastore, namespace); |
47 }); | 47 }); |
48 }); | 48 }); |
49 } | 49 } |
OLD | NEW |