OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analyzer.test.src.task.dart_work_manager_test; | 5 library analyzer.test.src.task.dart_work_manager_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/error/error.dart' show AnalysisError; | 8 import 'package:analyzer/error/error.dart' show AnalysisError; |
9 import 'package:analyzer/exception/exception.dart'; | 9 import 'package:analyzer/exception/exception.dart'; |
10 import 'package:analyzer/src/context/cache.dart'; | 10 import 'package:analyzer/src/context/cache.dart'; |
11 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; | 11 import 'package:analyzer/src/dart/scanner/scanner.dart' show ScannerErrorCode; |
12 import 'package:analyzer/src/generated/engine.dart' | 12 import 'package:analyzer/src/generated/engine.dart' |
13 show | 13 show |
14 AnalysisErrorInfoImpl, | 14 AnalysisErrorInfoImpl, |
15 AnalysisOptions, | 15 AnalysisOptions, |
16 AnalysisOptionsImpl, | 16 AnalysisOptionsImpl, |
17 CacheState, | 17 CacheState, |
18 ChangeNoticeImpl, | 18 ChangeNoticeImpl, |
19 InternalAnalysisContext; | 19 InternalAnalysisContext; |
20 import 'package:analyzer/src/generated/sdk.dart'; | 20 import 'package:analyzer/src/generated/sdk.dart'; |
21 import 'package:analyzer/src/generated/source.dart'; | 21 import 'package:analyzer/src/generated/source.dart'; |
22 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 22 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
23 import 'package:analyzer/src/task/dart.dart'; | 23 import 'package:analyzer/src/task/dart.dart'; |
24 import 'package:analyzer/src/task/dart_work_manager.dart'; | 24 import 'package:analyzer/src/task/dart_work_manager.dart'; |
25 import 'package:analyzer/task/dart.dart'; | 25 import 'package:analyzer/task/dart.dart'; |
26 import 'package:analyzer/task/general.dart'; | 26 import 'package:analyzer/task/general.dart'; |
27 import 'package:analyzer/task/model.dart'; | 27 import 'package:analyzer/task/model.dart'; |
| 28 import 'package:test/test.dart'; |
28 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 29 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
29 import 'package:typed_mock/typed_mock.dart'; | 30 import 'package:typed_mock/typed_mock.dart'; |
30 import 'package:unittest/unittest.dart'; | |
31 | 31 |
32 import '../../generated/test_support.dart'; | 32 import '../../generated/test_support.dart'; |
33 import '../../utils.dart'; | 33 import '../../utils.dart'; |
34 | 34 |
35 main() { | 35 main() { |
36 initializeTestEnvironment(); | 36 initializeTestEnvironment(); |
37 defineReflectiveTests(DartWorkManagerTest); | 37 defineReflectiveSuite(() { |
| 38 defineReflectiveTests(DartWorkManagerTest); |
| 39 }); |
38 } | 40 } |
39 | 41 |
40 @reflectiveTest | 42 @reflectiveTest |
41 class DartWorkManagerTest { | 43 class DartWorkManagerTest { |
42 InternalAnalysisContext context = new _InternalAnalysisContextMock(); | 44 InternalAnalysisContext context = new _InternalAnalysisContextMock(); |
43 AnalysisCache cache; | 45 AnalysisCache cache; |
44 DartWorkManager manager; | 46 DartWorkManager manager; |
45 | 47 |
46 CaughtException caughtException = new CaughtException(null, null); | 48 CaughtException caughtException = new CaughtException(null, null); |
47 | 49 |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 class _SourceFactoryMock extends TypedMock implements SourceFactory {} | 865 class _SourceFactoryMock extends TypedMock implements SourceFactory {} |
864 | 866 |
865 class _SourceMock extends TypedMock implements Source { | 867 class _SourceMock extends TypedMock implements Source { |
866 final String shortName; | 868 final String shortName; |
867 _SourceMock(this.shortName); | 869 _SourceMock(this.shortName); |
868 @override | 870 @override |
869 String get fullName => '/' + shortName; | 871 String get fullName => '/' + shortName; |
870 @override | 872 @override |
871 String toString() => fullName; | 873 String toString() => fullName; |
872 } | 874 } |
OLD | NEW |