| 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.integration.server.shutdown; | 5 library test.integration.server.shutdown; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:test/test.dart'; |
| 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 10 import 'package:unittest/unittest.dart'; | |
| 11 | 11 |
| 12 import '../../utils.dart'; | 12 import '../../utils.dart'; |
| 13 import '../integration_tests.dart'; | 13 import '../integration_tests.dart'; |
| 14 | 14 |
| 15 main() { | 15 main() { |
| 16 initializeTestEnvironment(); | 16 initializeTestEnvironment(); |
| 17 defineReflectiveTests(Test); | 17 defineReflectiveSuite(() { |
| 18 defineReflectiveTests(Test); |
| 19 }); |
| 18 } | 20 } |
| 19 | 21 |
| 20 @reflectiveTest | 22 @reflectiveTest |
| 21 class Test extends AbstractAnalysisServerIntegrationTest { | 23 class Test extends AbstractAnalysisServerIntegrationTest { |
| 22 test_shutdown() { | 24 test_shutdown() { |
| 23 return sendServerShutdown().then((_) { | 25 return sendServerShutdown().then((_) { |
| 24 return new Future.delayed(new Duration(seconds: 1)).then((_) { | 26 return new Future.delayed(new Duration(seconds: 1)).then((_) { |
| 25 sendServerGetVersion().then((_) { | 27 sendServerGetVersion().then((_) { |
| 26 fail('Server still alive after server.shutdown'); | 28 fail('Server still alive after server.shutdown'); |
| 27 }); | 29 }); |
| 28 // Give the server time to respond before terminating the test. | 30 // Give the server time to respond before terminating the test. |
| 29 return new Future.delayed(new Duration(seconds: 1)); | 31 return new Future.delayed(new Duration(seconds: 1)); |
| 30 }); | 32 }); |
| 31 }); | 33 }); |
| 32 } | 34 } |
| 33 } | 35 } |
| OLD | NEW |