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 test.context.directory.manager; | 5 library test.context.directory.manager; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:io' as io; | |
9 | 8 |
10 import 'package:analysis_server/src/context_manager.dart'; | 9 import 'package:analysis_server/src/context_manager.dart'; |
11 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
12 import 'package:analyzer/file_system/file_system.dart'; | 11 import 'package:analyzer/file_system/file_system.dart'; |
13 import 'package:analyzer/file_system/memory_file_system.dart'; | 12 import 'package:analyzer/file_system/memory_file_system.dart'; |
14 import 'package:analyzer/instrumentation/instrumentation.dart'; | 13 import 'package:analyzer/instrumentation/instrumentation.dart'; |
15 import 'package:analyzer/source/error_processor.dart'; | 14 import 'package:analyzer/source/error_processor.dart'; |
16 import 'package:analyzer/src/context/builder.dart'; | 15 import 'package:analyzer/src/context/builder.dart'; |
17 import 'package:analyzer/src/error/codes.dart'; | 16 import 'package:analyzer/src/error/codes.dart'; |
18 import 'package:analyzer/src/generated/engine.dart'; | 17 import 'package:analyzer/src/generated/engine.dart'; |
19 import 'package:analyzer/src/generated/sdk.dart'; | 18 import 'package:analyzer/src/generated/sdk.dart'; |
20 import 'package:analyzer/src/generated/source.dart'; | 19 import 'package:analyzer/src/generated/source.dart'; |
21 import 'package:analyzer/src/generated/source_io.dart'; | 20 import 'package:analyzer/src/generated/source_io.dart'; |
22 import 'package:analyzer/src/services/lint.dart'; | 21 import 'package:analyzer/src/services/lint.dart'; |
23 import 'package:analyzer/src/task/options.dart' | 22 import 'package:analyzer/src/task/options.dart' |
24 show CONFIGURED_ERROR_PROCESSORS; | 23 show CONFIGURED_ERROR_PROCESSORS; |
25 import 'package:analyzer/src/util/glob.dart'; | 24 import 'package:analyzer/src/util/glob.dart'; |
26 import 'package:linter/src/plugin/linter_plugin.dart'; | 25 import 'package:linter/src/plugin/linter_plugin.dart'; |
27 import 'package:linter/src/rules/avoid_as.dart'; | 26 import 'package:linter/src/rules/avoid_as.dart'; |
28 import 'package:path/path.dart'; | 27 import 'package:path/path.dart'; |
29 import 'package:plugin/manager.dart'; | 28 import 'package:plugin/manager.dart'; |
30 import 'package:plugin/plugin.dart'; | 29 import 'package:plugin/plugin.dart'; |
| 30 import 'package:test/test.dart'; |
31 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 31 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
32 import 'package:unittest/unittest.dart'; | |
33 | 32 |
34 import 'mock_sdk.dart'; | 33 import 'mock_sdk.dart'; |
35 import 'mocks.dart'; | 34 import 'mocks.dart'; |
36 import 'utils.dart'; | 35 import 'utils.dart'; |
37 | 36 |
38 main() { | 37 main() { |
39 initializeTestEnvironment(); | 38 initializeTestEnvironment(); |
40 defineReflectiveTests(AbstractContextManagerTest); | 39 defineReflectiveSuite(() { |
41 defineReflectiveTests(ContextManagerWithNewOptionsTest); | 40 defineReflectiveTests(AbstractContextManagerTest); |
42 defineReflectiveTests(ContextManagerWithOldOptionsTest); | 41 defineReflectiveTests(ContextManagerWithNewOptionsTest); |
| 42 defineReflectiveTests(ContextManagerWithOldOptionsTest); |
| 43 }); |
43 } | 44 } |
44 | 45 |
45 @reflectiveTest | 46 @reflectiveTest |
46 class AbstractContextManagerTest extends ContextManagerTest { | 47 class AbstractContextManagerTest extends ContextManagerTest { |
47 void test_contextsInAnalysisRoot_nestedContext() { | 48 void test_contextsInAnalysisRoot_nestedContext() { |
48 String subProjPath = posix.join(projPath, 'subproj'); | 49 String subProjPath = posix.join(projPath, 'subproj'); |
49 Folder subProjFolder = resourceProvider.newFolder(subProjPath); | 50 Folder subProjFolder = resourceProvider.newFolder(subProjPath); |
50 resourceProvider.newFile( | 51 resourceProvider.newFile( |
51 posix.join(subProjPath, 'pubspec.yaml'), 'contents'); | 52 posix.join(subProjPath, 'pubspec.yaml'), 'contents'); |
52 String subProjFilePath = posix.join(subProjPath, 'file.dart'); | 53 String subProjFilePath = posix.join(subProjPath, 'file.dart'); |
(...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2757 class TestUriResolver extends UriResolver { | 2758 class TestUriResolver extends UriResolver { |
2758 Map<Uri, Source> uriMap; | 2759 Map<Uri, Source> uriMap; |
2759 | 2760 |
2760 TestUriResolver(this.uriMap); | 2761 TestUriResolver(this.uriMap); |
2761 | 2762 |
2762 @override | 2763 @override |
2763 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 2764 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
2764 return uriMap[uri]; | 2765 return uriMap[uri]; |
2765 } | 2766 } |
2766 } | 2767 } |
OLD | NEW |