Index: pkg/analysis_server/test/analysis_server_test.dart |
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart |
index 8bac1306e842b71cda798ed6e19272560ce160de..0260f8b4f856e63e07fe0e9cef79aaf13f00ab83 100644 |
--- a/pkg/analysis_server/test/analysis_server_test.dart |
+++ b/pkg/analysis_server/test/analysis_server_test.dart |
@@ -9,21 +9,17 @@ import 'package:analysis_server/protocol/protocol_generated.dart'; |
import 'package:analysis_server/src/analysis_server.dart'; |
import 'package:analysis_server/src/constants.dart'; |
import 'package:analysis_server/src/domain_server.dart'; |
-import 'package:analysis_server/src/operation/operation.dart'; |
import 'package:analysis_server/src/plugin/server_plugin.dart'; |
-import 'package:analyzer/exception/exception.dart'; |
import 'package:analyzer/file_system/file_system.dart'; |
import 'package:analyzer/file_system/memory_file_system.dart'; |
import 'package:analyzer/instrumentation/instrumentation.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/sdk.dart'; |
-import 'package:analyzer/src/generated/source.dart'; |
import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
import 'package:plugin/manager.dart'; |
import 'package:plugin/plugin.dart'; |
import 'package:test/test.dart'; |
import 'package:test_reflective_loader/test_reflective_loader.dart'; |
-import 'package:typed_mock/typed_mock.dart'; |
import 'mock_sdk.dart'; |
import 'mocks.dart'; |
@@ -115,8 +111,7 @@ class AnalysisServerTest { |
serverPlugin, |
new AnalysisServerOptions(), |
new DartSdkManager('/', false), |
- InstrumentationService.NULL_SERVICE, |
- rethrowExceptions: true); |
+ InstrumentationService.NULL_SERVICE); |
} |
Future test_echo() { |
@@ -128,36 +123,12 @@ class AnalysisServerTest { |
}); |
} |
- void test_rethrowExceptions() { |
- Exception exceptionToThrow = new Exception('test exception'); |
- MockServerOperation operation = |
- new MockServerOperation(ServerOperationPriority.ANALYSIS, (_) { |
- throw exceptionToThrow; |
- }); |
- server.operationQueue.add(operation); |
- server.performOperationPending = true; |
- try { |
- server.performOperation(); |
- fail('exception not rethrown'); |
- } on AnalysisException catch (exception) { |
- expect(exception.cause.exception, equals(exceptionToThrow)); |
- } |
- } |
- |
Future test_serverStatusNotifications() { |
- MockAnalysisContext context = new MockAnalysisContext('context'); |
- MockSource source = new MockSource('source'); |
- when(source.fullName).thenReturn('foo.dart'); |
- when(source.isInSystemLibrary).thenReturn(false); |
- ChangeNoticeImpl notice = new ChangeNoticeImpl(source); |
- notice.setErrors([], new LineInfo([0])); |
- AnalysisResult firstResult = new AnalysisResult([notice], 0, '', 0); |
- AnalysisResult lastResult = new AnalysisResult(null, 1, '', 1); |
- when(context.analysisOptions).thenReturn(new AnalysisOptionsImpl()); |
- when(context.performAnalysisTask) |
- .thenReturnList([firstResult, firstResult, firstResult, lastResult]); |
server.serverServices.add(ServerService.STATUS); |
- server.schedulePerformAnalysisOperation(context); |
+ resourceProvider.newFolder('/pkg'); |
+ resourceProvider.newFolder('/pkg/lib'); |
+ resourceProvider.newFile('/pkg/lib/test.dart', 'class C {}'); |
+ server.setAnalysisRoots('0', ['/pkg'], [], {}); |
// Pump the event queue to make sure the server has finished any |
// analysis. |
return pumpEventQueue().then((_) { |
@@ -167,7 +138,9 @@ class AnalysisServerTest { |
expect(notifications.any((Notification notification) { |
if (notification.event == SERVER_STATUS) { |
var params = new ServerStatusParams.fromNotification(notification); |
- return params.analysis.isAnalyzing; |
+ if (params.analysis != null) { |
+ return params.analysis.isAnalyzing; |
+ } |
} |
return false; |
}), isTrue); |