Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: pkg/analysis_server/test/socket_server_test.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/socket_server_test.dart
diff --git a/pkg/analysis_server/test/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index 081d5271a68d636e3fa1e67ca1bd67bb4615d019..8b09bfc92cbf3099ec4072c1e73da56d336594a3 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -6,42 +6,30 @@ library test.socket.server;
import 'dart:async';
-import 'mocks.dart';
-
import 'package:analysis_server/src/constants.dart';
import 'package:analysis_server/src/protocol.dart';
import 'package:analysis_server/src/socket_server.dart';
import 'package:analyzer/src/generated/sdk_io.dart';
import 'package:unittest/unittest.dart';
+import 'mocks.dart';
+
main() {
group('SocketServer', () {
- test('createAnalysisServer_successful',
+ test(
+ 'createAnalysisServer_successful',
SocketServerTest.createAnalysisServer_successful);
- test('createAnalysisServer_alreadyStarted',
+ test(
+ 'createAnalysisServer_alreadyStarted',
SocketServerTest.createAnalysisServer_alreadyStarted);
test('requestHandler_exception', SocketServerTest.requestHandler_exception);
- test('requestHandler_futureException',
+ test(
+ 'requestHandler_futureException',
SocketServerTest.requestHandler_futureException);
});
}
class SocketServerTest {
- static Future createAnalysisServer_successful() {
- SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
- MockServerChannel channel = new MockServerChannel();
- server.createAnalysisServer(channel);
- channel.expectMsgCount(notificationCount: 1);
- expect(channel.notificationsReceived[0].event, SERVER_CONNECTED);
- return channel.sendRequest(
- new ServerShutdownParams().toRequest('0')
- ).then((Response response) {
- expect(response.id, equals('0'));
- expect(response.error, isNull);
- channel.expectMsgCount(responseCount: 1, notificationCount: 1);
- });
- }
-
static void createAnalysisServer_alreadyStarted() {
SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
MockServerChannel channel1 = new MockServerChannel();
@@ -53,18 +41,34 @@ class SocketServerTest {
channel2.expectMsgCount(responseCount: 1);
expect(channel2.responsesReceived[0].id, equals(''));
expect(channel2.responsesReceived[0].error, isNotNull);
- expect(channel2.responsesReceived[0].error.code, equals(
- RequestErrorCode.SERVER_ALREADY_STARTED));
- channel2.sendRequest(new ServerShutdownParams().toRequest('0')).then(
- (Response response) {
+ expect(
+ channel2.responsesReceived[0].error.code,
+ equals(RequestErrorCode.SERVER_ALREADY_STARTED));
+ channel2.sendRequest(
+ new ServerShutdownParams().toRequest('0')).then((Response response) {
expect(response.id, equals('0'));
expect(response.error, isNotNull);
- expect(response.error.code, equals(
- RequestErrorCode.SERVER_ALREADY_STARTED));
+ expect(
+ response.error.code,
+ equals(RequestErrorCode.SERVER_ALREADY_STARTED));
channel2.expectMsgCount(responseCount: 2);
});
}
+ static Future createAnalysisServer_successful() {
+ SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
+ MockServerChannel channel = new MockServerChannel();
+ server.createAnalysisServer(channel);
+ channel.expectMsgCount(notificationCount: 1);
+ expect(channel.notificationsReceived[0].event, SERVER_CONNECTED);
+ return channel.sendRequest(
+ new ServerShutdownParams().toRequest('0')).then((Response response) {
+ expect(response.id, equals('0'));
+ expect(response.error, isNull);
+ channel.expectMsgCount(responseCount: 1, notificationCount: 1);
+ });
+ }
+
static Future requestHandler_exception() {
SocketServer server = new SocketServer(DirectoryBasedDartSdk.defaultSdk);
MockServerChannel channel = new MockServerChannel();
« no previous file with comments | « pkg/analysis_server/test/services/search/search_engine_test.dart ('k') | pkg/analysis_server/test/test_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698