| 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.analysis.reanalyze; | 5 library test.analysis.reanalyze; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/constants.dart'; | 7 import 'package:analysis_server/src/constants.dart'; |
| 8 import 'package:analysis_server/src/protocol.dart'; | 8 import 'package:analysis_server/src/protocol.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 11 | 11 |
| 12 import '../analysis_abstract.dart'; | 12 import '../analysis_abstract.dart'; |
| 13 import '../reflective_tests.dart'; | 13 import '../reflective_tests.dart'; |
| 14 | 14 |
| 15 | 15 |
| 16 main() { | 16 main() { |
| 17 groupSep = ' | '; | 17 groupSep = ' | '; |
| 18 runReflectiveTests(ReanalyzeTest); | 18 runReflectiveTests(ReanalyzeTest); |
| 19 } | 19 } |
| 20 | 20 |
| 21 | 21 |
| 22 @ReflectiveTestCase() | 22 @reflectiveTest |
| 23 class ReanalyzeTest extends AbstractAnalysisTest { | 23 class ReanalyzeTest extends AbstractAnalysisTest { |
| 24 test_reanalyze() { | 24 test_reanalyze() { |
| 25 createProject(); | 25 createProject(); |
| 26 List<AnalysisContext> contexts = server.folderMap.values.toList(); | 26 List<AnalysisContext> contexts = server.folderMap.values.toList(); |
| 27 expect(contexts, hasLength(1)); | 27 expect(contexts, hasLength(1)); |
| 28 AnalysisContext oldContext = contexts[0]; | 28 AnalysisContext oldContext = contexts[0]; |
| 29 // Reanalyze should cause a brand new context to be built. | 29 // Reanalyze should cause a brand new context to be built. |
| 30 Request request = new Request("0", ANALYSIS_REANALYZE); | 30 Request request = new Request("0", ANALYSIS_REANALYZE); |
| 31 handleSuccessfulRequest(request); | 31 handleSuccessfulRequest(request); |
| 32 contexts = server.folderMap.values.toList(); | 32 contexts = server.folderMap.values.toList(); |
| 33 expect(contexts, hasLength(1)); | 33 expect(contexts, hasLength(1)); |
| 34 AnalysisContext newContext = contexts[0]; | 34 AnalysisContext newContext = contexts[0]; |
| 35 expect(newContext, isNot(same(oldContext))); | 35 expect(newContext, isNot(same(oldContext))); |
| 36 } | 36 } |
| 37 } | 37 } |
| OLD | NEW |