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

Unified Diff: pkg/analysis_services/test/refactoring/abstract_refactoring.dart

Issue 484733003: Import analysis_services.dart into analysis_server.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months 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_services/test/refactoring/abstract_refactoring.dart
diff --git a/pkg/analysis_services/test/refactoring/abstract_refactoring.dart b/pkg/analysis_services/test/refactoring/abstract_refactoring.dart
deleted file mode 100644
index 19490d48e2ab72d929040de445327e0f31701e02..0000000000000000000000000000000000000000
--- a/pkg/analysis_services/test/refactoring/abstract_refactoring.dart
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.services.refactoring.rename;
-
-import 'dart:async';
-
-import 'package:analysis_services/correction/change.dart';
-import 'package:analysis_services/correction/status.dart';
-import 'package:analysis_services/index/index.dart';
-import 'package:analysis_services/index/local_memory_index.dart';
-import 'package:analysis_services/refactoring/refactoring.dart';
-import 'package:analysis_services/src/search/search_engine.dart';
-import 'package:analysis_testing/abstract_single_unit.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:unittest/unittest.dart';
-
-
-int findIdentifierLength(String search) {
- int length = 0;
- while (length < search.length) {
- int c = search.codeUnitAt(length);
- if (!(c >= 'a'.codeUnitAt(0) && c <= 'z'.codeUnitAt(0) ||
- c >= 'A'.codeUnitAt(0) && c <= 'Z'.codeUnitAt(0) ||
- c >= '0'.codeUnitAt(0) && c <= '9'.codeUnitAt(0))) {
- break;
- }
- length++;
- }
- return length;
-}
-
-
-/**
- * The base class for all [Refactoring] tests.
- */
-abstract class RefactoringTest extends AbstractSingleUnitTest {
- Index index;
- SearchEngineImpl searchEngine;
-
- Change refactoringChange;
-
- Refactoring get refactoring;
-
- /**
- * Asserts that [refactoring] initial/final conditions status is OK.
- */
- Future assertRefactoringConditionsOK() {
- return refactoring.checkInitialConditions().then((status) {
- assertRefactoringStatusOK(status);
- return refactoring.checkFinalConditions().then((status) {
- assertRefactoringStatusOK(status);
- });
- });
- }
-
- /**
- * Asserts that [status] has expected severity and message.
- */
- void assertRefactoringStatus(RefactoringStatus status,
- RefactoringStatusSeverity expectedSeverity, {String expectedMessage,
- SourceRange expectedContextRange, String expectedContextSearch}) {
- expect(status.severity, expectedSeverity, reason: status.message);
- if (expectedSeverity != RefactoringStatusSeverity.OK) {
- RefactoringStatusEntry entry = status.entryWithHighestSeverity;
- expect(entry.severity, expectedSeverity);
- if (expectedMessage != null) {
- expect(entry.message, expectedMessage);
- }
- if (expectedContextRange != null) {
- expect(entry.context.range, expectedContextRange);
- }
- if (expectedContextSearch != null) {
- SourceRange contextRange = entry.context.range;
- int expectedOffset = findOffset(expectedContextSearch);
- int expectedLength = findIdentifierLength(expectedContextSearch);
- expect(contextRange.offset, expectedOffset);
- expect(contextRange.length, expectedLength);
- }
- }
- }
-
- /**
- * Asserts that [refactoring] status is OK.
- */
- void assertRefactoringStatusOK(RefactoringStatus status) {
- assertRefactoringStatus(status, RefactoringStatusSeverity.OK);
- }
-
- void indexTestUnit(String code) {
- resolveTestUnit(code);
- index.indexUnit(context, testUnit);
- }
-
- void indexUnit(String file, String code) {
- Source source = addSource(file, code);
- CompilationUnit unit = resolveLibraryUnit(source);
- index.indexUnit(context, unit);
- }
-
- void setUp() {
- super.setUp();
- index = createLocalMemoryIndex();
- searchEngine = new SearchEngineImpl(index);
- }
-}
« no previous file with comments | « pkg/analysis_services/test/index/test_all.dart ('k') | pkg/analysis_services/test/refactoring/abstract_rename.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698