| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // // BSD-style license that can be found in the LICENSE file. |
| 4 // // This code was auto-generated, is not intended to be edited, and is subject
to |
| 5 // // significant change. Please see the README file for more information. |
| 6 // library engine.engine_test; |
| 7 // import 'dart:collection'; |
| 8 // import 'package:analyzer/src/generated/ast.dart'; |
| 9 // import 'package:analyzer/src/generated/element.dart'; |
| 10 // import 'package:analyzer/src/generated/engine.dart'; |
| 11 // import 'package:analyzer/src/generated/error.dart'; |
| 12 // import 'package:analyzer/src/generated/java_core.dart'; |
| 13 // import 'package:analyzer/src/generated/java_engine.dart'; |
| 14 // import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 15 // import 'package:analyzer/src/generated/java_io.dart'; |
| 16 // import 'package:analyzer/src/generated/java_junit.dart'; |
| 17 // import 'package:analyzer/src/generated/parser.dart'; |
| 18 // import 'package:analyzer/src/generated/resolver.dart'; |
| 19 // import 'package:analyzer/src/generated/scanner.dart'; |
| 20 // import 'package:analyzer/src/generated/source_io.dart'; |
| 21 // import 'package:unittest/unittest.dart' as _ut; |
| 22 // import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 23 // import 'package:analyzer/src/generated/testing/element_factory.dart'; |
| 24 // import 'resolver_test.dart'; |
| 25 // import 'test_support.dart'; |
| 26 // class AnalysisCacheTest extends EngineTestCase { |
| 27 // void test_creation() { |
| 28 // JUnitTestCase.assertNotNull(new AnalysisCache(new List<CachePartition>(0)
)); |
| 29 // } |
| 30 // void test_get() { |
| 31 // AnalysisCache cache = new AnalysisCache(new List<CachePartition>(0)); |
| 32 // TestSource source = new TestSource(); |
| 33 // JUnitTestCase.assertNull(cache.get(source)); |
| 34 // } |
| 35 // void test_iterator() { |
| 36 // CachePartition partition = new UniversalCachePartition(8, new DefaultRete
ntionPolicy()); |
| 37 // AnalysisCache cache = new AnalysisCache(<CachePartition> [partition]); |
| 38 // TestSource source = new TestSource(); |
| 39 // DartEntryImpl entry = new DartEntryImpl(); |
| 40 // cache.put(source, entry); |
| 41 // MapIterator<Source, SourceEntry> iterator = cache.iterator(); |
| 42 // JUnitTestCase.assertTrue(iterator.moveNext()); |
| 43 // JUnitTestCase.assertSame(source, iterator.key); |
| 44 // JUnitTestCase.assertSame(entry, iterator.value); |
| 45 // JUnitTestCase.assertFalse(iterator.moveNext()); |
| 46 // } |
| 47 // void test_put_noFlush() { |
| 48 // CachePartition partition = new UniversalCachePartition(8, new DefaultRete
ntionPolicy()); |
| 49 // AnalysisCache cache = new AnalysisCache(<CachePartition> [partition]); |
| 50 // TestSource source = new TestSource(); |
| 51 // DartEntryImpl entry = new DartEntryImpl(); |
| 52 // cache.put(source, entry); |
| 53 // JUnitTestCase.assertSame(entry, cache.get(source)); |
| 54 // } |
| 55 // void test_setMaxCacheSize() { |
| 56 // CachePartition partition = new UniversalCachePartition(8, new CacheRetent
ionPolicy_AnalysisCacheTest_test_setMaxCacheSize()); |
| 57 // AnalysisCache cache = new AnalysisCache(<CachePartition> [partition]); |
| 58 // int size = 6; |
| 59 // for (int i = 0; i < size; i++) { |
| 60 // Source source = new TestSource.con1(FileUtilities2.createFile("/test${i
}.dart"), ""); |
| 61 // DartEntryImpl entry = new DartEntryImpl(); |
| 62 // entry.setValue(DartEntry.PARSED_UNIT, null); |
| 63 // cache.put(source, entry); |
| 64 // cache.accessedAst(source); |
| 65 // } |
| 66 // _assertNonFlushedCount(size, cache); |
| 67 // int newSize = size - 2; |
| 68 // partition.maxCacheSize = newSize; |
| 69 // _assertNonFlushedCount(newSize, cache); |
| 70 // } |
| 71 // void test_size() { |
| 72 // CachePartition partition = new UniversalCachePartition(8, new DefaultRete
ntionPolicy()); |
| 73 // AnalysisCache cache = new AnalysisCache(<CachePartition> [partition]); |
| 74 // int size = 4; |
| 75 // for (int i = 0; i < size; i++) { |
| 76 // Source source = new TestSource.con1(FileUtilities2.createFile("/test${i
}.dart"), ""); |
| 77 // cache.put(source, new DartEntryImpl()); |
| 78 // cache.accessedAst(source); |
| 79 // } |
| 80 // JUnitTestCase.assertEquals(size, cache.size()); |
| 81 // } |
| 82 // void _assertNonFlushedCount(int expectedCount, AnalysisCache cache) { |
| 83 // int nonFlushedCount = 0; |
| 84 // MapIterator<Source, SourceEntry> iterator = cache.iterator(); |
| 85 // while (iterator.moveNext()) { |
| 86 // if (iterator.value.getState(DartEntry.PARSED_UNIT) != CacheState.FLUSHE
D) { |
| 87 // nonFlushedCount++; |
| 88 // } |
| 89 // } |
| 90 // JUnitTestCase.assertEquals(expectedCount, nonFlushedCount); |
| 91 // } |
| 92 // static dartSuite() { |
| 93 // _ut.group('AnalysisCacheTest', () { |
| 94 // _ut.test('test_creation', () { |
| 95 // final __test = new AnalysisCacheTest(); |
| 96 // runJUnitTest(__test, __test.test_creation); |
| 97 // }); |
| 98 // _ut.test('test_get', () { |
| 99 // final __test = new AnalysisCacheTest(); |
| 100 // runJUnitTest(__test, __test.test_get); |
| 101 // }); |
| 102 // _ut.test('test_iterator', () { |
| 103 // final __test = new AnalysisCacheTest(); |
| 104 // runJUnitTest(__test, __test.test_iterator); |
| 105 // }); |
| 106 // _ut.test('test_put_noFlush', () { |
| 107 // final __test = new AnalysisCacheTest(); |
| 108 // runJUnitTest(__test, __test.test_put_noFlush); |
| 109 // }); |
| 110 // _ut.test('test_setMaxCacheSize', () { |
| 111 // final __test = new AnalysisCacheTest(); |
| 112 // runJUnitTest(__test, __test.test_setMaxCacheSize); |
| 113 // }); |
| 114 // _ut.test('test_size', () { |
| 115 // final __test = new AnalysisCacheTest(); |
| 116 // runJUnitTest(__test, __test.test_size); |
| 117 // }); |
| 118 // }); |
| 119 // } |
| 120 // } |
| 121 // class AnalysisContextImplTest extends EngineTestCase { |
| 122 // /** |
| 123 // * Returns `true` if there is an [AnalysisError] with [ErrorSeverity#ERROR]
in |
| 124 // * the given [AnalysisErrorInfo]. |
| 125 // */ |
| 126 // static bool _hasAnalysisErrorWithErrorSeverity(AnalysisErrorInfo errorInfo)
{ |
| 127 // List<AnalysisError> errors = errorInfo.errors; |
| 128 // for (AnalysisError analysisError in errors) { |
| 129 // if (analysisError.errorCode.errorSeverity == ErrorSeverity.ERROR) { |
| 130 // return true; |
| 131 // } |
| 132 // } |
| 133 // return false; |
| 134 // } |
| 135 // /** |
| 136 // * An analysis context whose source factory is [sourceFactory]. |
| 137 // */ |
| 138 // AnalysisContextImpl _context; |
| 139 // /** |
| 140 // * The source factory associated with the analysis [context]. |
| 141 // */ |
| 142 // SourceFactory _sourceFactory; |
| 143 // void fail_extractContext() { |
| 144 // JUnitTestCase.fail("Implement this"); |
| 145 // } |
| 146 // void fail_mergeContext() { |
| 147 // JUnitTestCase.fail("Implement this"); |
| 148 // } |
| 149 // void fail_performAnalysisTask_importedLibraryDelete_html() { |
| 150 // Source htmlSource = _addSource("/page.html", EngineTestCase.createSource(
[ |
| 151 // "<html><body><script type=\"application/dart\">", |
| 152 // " import 'libB.dart';", |
| 153 // " main() {print('hello dart');}", |
| 154 // "</script></body></html>"])); |
| 155 // Source libBSource = _addSource("/libB.dart", "library libB;"); |
| 156 // _analyzeAll_assertFinished(); |
| 157 // JUnitTestCase.assertNotNullMsg("htmlUnit resolved 1", _context.getResolve
dHtmlUnit(htmlSource)); |
| 158 // JUnitTestCase.assertNotNullMsg("libB resolved 1", _context.getResolvedCom
pilationUnit2(libBSource, libBSource)); |
| 159 // JUnitTestCase.assertTrueMsg("htmlSource doesn't have errors", !_hasAnalys
isErrorWithErrorSeverity(_context.getErrors(htmlSource))); |
| 160 // // remove libB.dart content and analyze |
| 161 // _context.setContents(libBSource, null); |
| 162 // _analyzeAll_assertFinished(); |
| 163 // JUnitTestCase.assertNotNullMsg("htmlUnit resolved 1", _context.getResolve
dHtmlUnit(htmlSource)); |
| 164 // AnalysisErrorInfo errors = _context.getErrors(htmlSource); |
| 165 // JUnitTestCase.assertTrueMsg("htmlSource has an error", _hasAnalysisErrorW
ithErrorSeverity(errors)); |
| 166 // } |
| 167 // void fail_recordLibraryElements() { |
| 168 // JUnitTestCase.fail("Implement this"); |
| 169 // } |
| 170 // @override |
| 171 // void setUp() { |
| 172 // _context = new AnalysisContextImpl(); |
| 173 // _sourceFactory = new SourceFactory([ |
| 174 // new DartUriResolver(DirectoryBasedDartSdk.defaultSdk), |
| 175 // new FileUriResolver()]); |
| 176 // _context.sourceFactory = _sourceFactory; |
| 177 // AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(_context.analy
sisOptions); |
| 178 // options.cacheSize = 256; |
| 179 // _context.analysisOptions = options; |
| 180 // } |
| 181 // void test_applyChanges_add() { |
| 182 // JUnitTestCase.assertTrue(_context.sourcesNeedingProcessing.isEmpty); |
| 183 // Source source = _addSource("/test.dart", "main() {}"); |
| 184 // JUnitTestCase.assertTrue(_context.sourcesNeedingProcessing.contains(sourc
e)); |
| 185 // } |
| 186 // void test_applyChanges_change_flush_element() { |
| 187 // _context = AnalysisContextFactory.contextWithCore(); |
| 188 // _sourceFactory = _context.sourceFactory; |
| 189 // Source librarySource = _addSource("/lib.dart", EngineTestCase.createSourc
e(["library lib;", "int a = 0;"])); |
| 190 // JUnitTestCase.assertNotNull(_context.computeLibraryElement(librarySource)
); |
| 191 // _context.setContents(librarySource, EngineTestCase.createSource(["library
lib;", "int aa = 0;"])); |
| 192 // JUnitTestCase.assertNull(_context.getLibraryElement(librarySource)); |
| 193 // } |
| 194 // void test_applyChanges_change_multiple() { |
| 195 // _context = AnalysisContextFactory.contextWithCore(); |
| 196 // _sourceFactory = _context.sourceFactory; |
| 197 // Source librarySource = _addSource("/lib.dart", EngineTestCase.createSourc
e(["library lib;", "part 'part.dart';", "int a = 0;"])); |
| 198 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["part of lib;", "int b = a;"])); |
| 199 // _context.computeLibraryElement(librarySource); |
| 200 // _context.setContents(librarySource, EngineTestCase.createSource(["library
lib;", "part 'part.dart';", "int aa = 0;"])); |
| 201 // _context.setContents(partSource, EngineTestCase.createSource(["part of li
b;", "int b = aa;"])); |
| 202 // _context.computeLibraryElement(librarySource); |
| 203 // CompilationUnit libraryUnit = _context.resolveCompilationUnit2(librarySou
rce, librarySource); |
| 204 // CompilationUnit partUnit = _context.resolveCompilationUnit2(partSource, l
ibrarySource); |
| 205 // TopLevelVariableDeclaration declaration = libraryUnit.declarations[0] as
TopLevelVariableDeclaration; |
| 206 // Element declarationElement = declaration.variables.variables[0].element; |
| 207 // TopLevelVariableDeclaration use = partUnit.declarations[0] as TopLevelVar
iableDeclaration; |
| 208 // Element useElement = (use.variables.variables[0].initializer as SimpleIde
ntifier).staticElement; |
| 209 // JUnitTestCase.assertSame(declarationElement, (useElement as PropertyAcces
sorElement).variable); |
| 210 // } |
| 211 // void test_applyChanges_empty() { |
| 212 // _context.applyChanges(new ChangeSet()); |
| 213 // JUnitTestCase.assertNull(_context.performAnalysisTask().changeNotices); |
| 214 // } |
| 215 // void test_applyChanges_overriddenSource() { |
| 216 // // Note: addSource adds the source to the contentCache. |
| 217 // Source source = _addSource("/test.dart", "library test;"); |
| 218 // _context.computeErrors(source); |
| 219 // while (!_context.sourcesNeedingProcessing.isEmpty) { |
| 220 // _context.performAnalysisTask(); |
| 221 // } |
| 222 // // Adding the source as a changedSource should have no effect since it is
already overridden |
| 223 // // in the content cache. |
| 224 // ChangeSet changeSet = new ChangeSet(); |
| 225 // changeSet.changedSource(source); |
| 226 // _context.applyChanges(changeSet); |
| 227 // EngineTestCase.assertSizeOfList(0, _context.sourcesNeedingProcessing); |
| 228 // } |
| 229 // void test_applyChanges_remove() { |
| 230 // _context = AnalysisContextFactory.contextWithCore(); |
| 231 // _sourceFactory = _context.sourceFactory; |
| 232 // Source libA = _addSource("/libA.dart", EngineTestCase.createSource(["libr
ary libA;", "import 'libB.dart';"])); |
| 233 // Source libB = _addSource("/libB.dart", EngineTestCase.createSource(["libr
ary libB;"])); |
| 234 // LibraryElement libAElement = _context.computeLibraryElement(libA); |
| 235 // List<LibraryElement> importedLibraries = libAElement.importedLibraries; |
| 236 // EngineTestCase.assertLength(2, importedLibraries); |
| 237 // _context.computeErrors(libA); |
| 238 // _context.computeErrors(libB); |
| 239 // EngineTestCase.assertSizeOfList(0, _context.sourcesNeedingProcessing); |
| 240 // _context.setContents(libB, null); |
| 241 // _removeSource(libB); |
| 242 // List<Source> sources = _context.sourcesNeedingProcessing; |
| 243 // EngineTestCase.assertSizeOfList(1, sources); |
| 244 // JUnitTestCase.assertSame(libA, sources[0]); |
| 245 // libAElement = _context.computeLibraryElement(libA); |
| 246 // importedLibraries = libAElement.importedLibraries; |
| 247 // EngineTestCase.assertLength(1, importedLibraries); |
| 248 // } |
| 249 // void test_applyChanges_removeContainer() { |
| 250 // _context = AnalysisContextFactory.contextWithCore(); |
| 251 // _sourceFactory = _context.sourceFactory; |
| 252 // Source libA = _addSource("/libA.dart", EngineTestCase.createSource(["libr
ary libA;", "import 'libB.dart';"])); |
| 253 // Source libB = _addSource("/libB.dart", EngineTestCase.createSource(["libr
ary libB;"])); |
| 254 // _context.computeLibraryElement(libA); |
| 255 // _context.computeErrors(libA); |
| 256 // _context.computeErrors(libB); |
| 257 // EngineTestCase.assertSizeOfList(0, _context.sourcesNeedingProcessing); |
| 258 // ChangeSet changeSet = new ChangeSet(); |
| 259 // changeSet.removedContainer(new SourceContainer_AnalysisContextImplTest_te
st_applyChanges_removeContainer(libB)); |
| 260 // _context.applyChanges(changeSet); |
| 261 // List<Source> sources = _context.sourcesNeedingProcessing; |
| 262 // EngineTestCase.assertSizeOfList(1, sources); |
| 263 // JUnitTestCase.assertSame(libA, sources[0]); |
| 264 // } |
| 265 // void test_computeDocumentationComment_block() { |
| 266 // _context = AnalysisContextFactory.contextWithCore(); |
| 267 // _sourceFactory = _context.sourceFactory; |
| 268 // String comment = "/** Comment */"; |
| 269 // Source source = _addSource("/test.dart", EngineTestCase.createSource([com
ment, "class A {}"])); |
| 270 // LibraryElement libraryElement = _context.computeLibraryElement(source); |
| 271 // JUnitTestCase.assertNotNull(libraryElement); |
| 272 // ClassElement classElement = libraryElement.definingCompilationUnit.types[
0]; |
| 273 // JUnitTestCase.assertNotNull(libraryElement); |
| 274 // JUnitTestCase.assertEquals(comment, _context.computeDocumentationComment(
classElement)); |
| 275 // } |
| 276 // void test_computeDocumentationComment_none() { |
| 277 // _context = AnalysisContextFactory.contextWithCore(); |
| 278 // _sourceFactory = _context.sourceFactory; |
| 279 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["cl
ass A {}"])); |
| 280 // LibraryElement libraryElement = _context.computeLibraryElement(source); |
| 281 // JUnitTestCase.assertNotNull(libraryElement); |
| 282 // ClassElement classElement = libraryElement.definingCompilationUnit.types[
0]; |
| 283 // JUnitTestCase.assertNotNull(libraryElement); |
| 284 // JUnitTestCase.assertNull(_context.computeDocumentationComment(classElemen
t)); |
| 285 // } |
| 286 // void test_computeDocumentationComment_null() { |
| 287 // JUnitTestCase.assertNull(_context.computeDocumentationComment(null)); |
| 288 // } |
| 289 // void test_computeDocumentationComment_singleLine_multiple_EOL_n() { |
| 290 // _context = AnalysisContextFactory.contextWithCore(); |
| 291 // _sourceFactory = _context.sourceFactory; |
| 292 // String comment = "/// line 1\n/// line 2\n/// line 3\n"; |
| 293 // Source source = _addSource("/test.dart", "${comment}class A {}"); |
| 294 // LibraryElement libraryElement = _context.computeLibraryElement(source); |
| 295 // JUnitTestCase.assertNotNull(libraryElement); |
| 296 // ClassElement classElement = libraryElement.definingCompilationUnit.types[
0]; |
| 297 // JUnitTestCase.assertNotNull(libraryElement); |
| 298 // String actual = _context.computeDocumentationComment(classElement); |
| 299 // JUnitTestCase.assertEquals("/// line 1\n/// line 2\n/// line 3", actual); |
| 300 // } |
| 301 // void test_computeDocumentationComment_singleLine_multiple_EOL_rn() { |
| 302 // _context = AnalysisContextFactory.contextWithCore(); |
| 303 // _sourceFactory = _context.sourceFactory; |
| 304 // String comment = "/// line 1\r\n/// line 2\r\n/// line 3\r\n"; |
| 305 // Source source = _addSource("/test.dart", "${comment}class A {}"); |
| 306 // LibraryElement libraryElement = _context.computeLibraryElement(source); |
| 307 // JUnitTestCase.assertNotNull(libraryElement); |
| 308 // ClassElement classElement = libraryElement.definingCompilationUnit.types[
0]; |
| 309 // JUnitTestCase.assertNotNull(libraryElement); |
| 310 // String actual = _context.computeDocumentationComment(classElement); |
| 311 // JUnitTestCase.assertEquals("/// line 1\n/// line 2\n/// line 3", actual); |
| 312 // } |
| 313 // void test_computeErrors_dart_none() { |
| 314 // Source source = _addSource("/lib.dart", "library lib;"); |
| 315 // List<AnalysisError> errors = _context.computeErrors(source); |
| 316 // EngineTestCase.assertLength(0, errors); |
| 317 // } |
| 318 // void test_computeErrors_dart_part() { |
| 319 // Source librarySource = _addSource("/lib.dart", "library lib; part 'part.d
art';"); |
| 320 // Source partSource = _addSource("/part.dart", "part of 'lib';"); |
| 321 // _context.parseCompilationUnit(librarySource); |
| 322 // List<AnalysisError> errors = _context.computeErrors(partSource); |
| 323 // JUnitTestCase.assertNotNull(errors); |
| 324 // JUnitTestCase.assertTrue(errors.length > 0); |
| 325 // } |
| 326 // void test_computeErrors_dart_some() { |
| 327 // Source source = _addSource("/lib.dart", "library 'lib';"); |
| 328 // List<AnalysisError> errors = _context.computeErrors(source); |
| 329 // JUnitTestCase.assertNotNull(errors); |
| 330 // JUnitTestCase.assertTrue(errors.length > 0); |
| 331 // } |
| 332 // void test_computeErrors_html_none() { |
| 333 // Source source = _addSource("/test.html", "<html></html>"); |
| 334 // List<AnalysisError> errors = _context.computeErrors(source); |
| 335 // EngineTestCase.assertLength(0, errors); |
| 336 // } |
| 337 // void test_computeExportedLibraries_none() { |
| 338 // Source source = _addSource("/test.dart", "library test;"); |
| 339 // EngineTestCase.assertLength(0, _context.computeExportedLibraries(source))
; |
| 340 // } |
| 341 // void test_computeExportedLibraries_some() { |
| 342 // // addSource("/lib1.dart", "library lib1;"); |
| 343 // // addSource("/lib2.dart", "library lib2;"); |
| 344 // Source source = _addSource("/test.dart", "library test; export 'lib1.dart
'; export 'lib2.dart';"); |
| 345 // EngineTestCase.assertLength(2, _context.computeExportedLibraries(source))
; |
| 346 // } |
| 347 // void test_computeHtmlElement_nonHtml() { |
| 348 // Source source = _addSource("/test.dart", "library test;"); |
| 349 // JUnitTestCase.assertNull(_context.computeHtmlElement(source)); |
| 350 // } |
| 351 // void test_computeHtmlElement_valid() { |
| 352 // Source source = _addSource("/test.html", "<html></html>"); |
| 353 // HtmlElement element = _context.computeHtmlElement(source); |
| 354 // JUnitTestCase.assertNotNull(element); |
| 355 // JUnitTestCase.assertSame(element, _context.computeHtmlElement(source)); |
| 356 // } |
| 357 // void test_computeImportedLibraries_none() { |
| 358 // Source source = _addSource("/test.dart", "library test;"); |
| 359 // EngineTestCase.assertLength(0, _context.computeImportedLibraries(source))
; |
| 360 // } |
| 361 // void test_computeImportedLibraries_some() { |
| 362 // // addSource("/lib1.dart", "library lib1;"); |
| 363 // // addSource("/lib2.dart", "library lib2;"); |
| 364 // Source source = _addSource("/test.dart", "library test; import 'lib1.dart
'; import 'lib2.dart';"); |
| 365 // EngineTestCase.assertLength(2, _context.computeImportedLibraries(source))
; |
| 366 // } |
| 367 // void test_computeKindOf_html() { |
| 368 // Source source = _addSource("/test.html", ""); |
| 369 // JUnitTestCase.assertSame(SourceKind.HTML, _context.computeKindOf(source))
; |
| 370 // } |
| 371 // void test_computeKindOf_library() { |
| 372 // Source source = _addSource("/test.dart", "library lib;"); |
| 373 // JUnitTestCase.assertSame(SourceKind.LIBRARY, _context.computeKindOf(sourc
e)); |
| 374 // } |
| 375 // void test_computeKindOf_libraryAndPart() { |
| 376 // Source source = _addSource("/test.dart", "library lib; part of lib;"); |
| 377 // JUnitTestCase.assertSame(SourceKind.LIBRARY, _context.computeKindOf(sourc
e)); |
| 378 // } |
| 379 // void test_computeKindOf_part() { |
| 380 // Source source = _addSource("/test.dart", "part of lib;"); |
| 381 // JUnitTestCase.assertSame(SourceKind.PART, _context.computeKindOf(source))
; |
| 382 // } |
| 383 // void test_computeLibraryElement() { |
| 384 // _context = AnalysisContextFactory.contextWithCore(); |
| 385 // _sourceFactory = _context.sourceFactory; |
| 386 // Source source = _addSource("/test.dart", "library lib;"); |
| 387 // LibraryElement element = _context.computeLibraryElement(source); |
| 388 // JUnitTestCase.assertNotNull(element); |
| 389 // } |
| 390 // void test_computeLineInfo_dart() { |
| 391 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["li
brary lib;", "", "main() {}"])); |
| 392 // LineInfo info = _context.computeLineInfo(source); |
| 393 // JUnitTestCase.assertNotNull(info); |
| 394 // } |
| 395 // void test_computeLineInfo_html() { |
| 396 // Source source = _addSource("/test.html", EngineTestCase.createSource([ |
| 397 // "<html>", |
| 398 // " <body>", |
| 399 // " <h1>A</h1>", |
| 400 // " </body>", |
| 401 // "</html>"])); |
| 402 // LineInfo info = _context.computeLineInfo(source); |
| 403 // JUnitTestCase.assertNotNull(info); |
| 404 // } |
| 405 // void test_computeResolvableCompilationUnit_exception() { |
| 406 // TestSource source = _addSourceWithException("/test.dart"); |
| 407 // try { |
| 408 // _context.computeResolvableCompilationUnit(source); |
| 409 // JUnitTestCase.fail("Expected AnalysisException"); |
| 410 // } on AnalysisException catch (exception) { |
| 411 // } |
| 412 // } |
| 413 // void test_computeResolvableCompilationUnit_html() { |
| 414 // Source source = _addSource("/lib.html", "<html></html>"); |
| 415 // try { |
| 416 // _context.computeResolvableCompilationUnit(source); |
| 417 // JUnitTestCase.fail("Expected AnalysisException"); |
| 418 // } on AnalysisException catch (exception) { |
| 419 // } |
| 420 // } |
| 421 // void test_computeResolvableCompilationUnit_valid() { |
| 422 // Source source = _addSource("/lib.dart", "library lib;"); |
| 423 // CompilationUnit compilationUnit = _context.parseCompilationUnit(source); |
| 424 // JUnitTestCase.assertNotNull(compilationUnit); |
| 425 // JUnitTestCase.assertNotSame(compilationUnit, _context.computeResolvableCo
mpilationUnit(source)); |
| 426 // } |
| 427 // void test_dispose() { |
| 428 // JUnitTestCase.assertFalse(_context.isDisposed); |
| 429 // _context.dispose(); |
| 430 // JUnitTestCase.assertTrue(_context.isDisposed); |
| 431 // } |
| 432 // void test_exists_false() { |
| 433 // JUnitTestCase.assertFalse(_context.exists(new TestSource())); |
| 434 // } |
| 435 // void test_exists_null() { |
| 436 // JUnitTestCase.assertFalse(_context.exists(null)); |
| 437 // } |
| 438 // void test_exists_overridden() { |
| 439 // Source source = new TestSource(); |
| 440 // _context.setContents(source, ""); |
| 441 // JUnitTestCase.assertTrue(_context.exists(source)); |
| 442 // } |
| 443 // void test_exists_true() { |
| 444 // JUnitTestCase.assertTrue(_context.exists(new TestSource_AnalysisContextIm
plTest_test_exists_true())); |
| 445 // } |
| 446 // void test_getAnalysisOptions() { |
| 447 // JUnitTestCase.assertNotNull(_context.analysisOptions); |
| 448 // } |
| 449 // void test_getContents_fromSource() { |
| 450 // String content = "library lib;"; |
| 451 // TimestampedData<String> contents = _context.getContents(new TestSource.co
n2(content)); |
| 452 // JUnitTestCase.assertEquals(content, contents.data.toString()); |
| 453 // } |
| 454 // void test_getContents_overridden() { |
| 455 // String content = "library lib;"; |
| 456 // Source source = new TestSource(); |
| 457 // _context.setContents(source, content); |
| 458 // TimestampedData<String> contents = _context.getContents(source); |
| 459 // JUnitTestCase.assertEquals(content, contents.data.toString()); |
| 460 // } |
| 461 // void test_getContents_unoverridden() { |
| 462 // String content = "library lib;"; |
| 463 // Source source = new TestSource.con2(content); |
| 464 // _context.setContents(source, "part of lib;"); |
| 465 // _context.setContents(source, null); |
| 466 // TimestampedData<String> contents = _context.getContents(source); |
| 467 // JUnitTestCase.assertEquals(content, contents.data.toString()); |
| 468 // } |
| 469 // void test_getDeclaredVariables() { |
| 470 // _context = AnalysisContextFactory.contextWithCore(); |
| 471 // JUnitTestCase.assertNotNull(_context.declaredVariables); |
| 472 // } |
| 473 // void test_getElement() { |
| 474 // _context = AnalysisContextFactory.contextWithCore(); |
| 475 // _sourceFactory = _context.sourceFactory; |
| 476 // LibraryElement core = _context.computeLibraryElement(_sourceFactory.forUr
i("dart:core")); |
| 477 // JUnitTestCase.assertNotNull(core); |
| 478 // ClassElement classObject = _findClass(core.definingCompilationUnit, "Obje
ct"); |
| 479 // JUnitTestCase.assertNotNull(classObject); |
| 480 // ElementLocation location = classObject.location; |
| 481 // Element element = _context.getElement(location); |
| 482 // JUnitTestCase.assertSame(classObject, element); |
| 483 // } |
| 484 // void test_getElement_constructor_named() { |
| 485 // Source source = _addSource("/lib.dart", EngineTestCase.createSource(["cla
ss A {", " A.named() {}", "}"])); |
| 486 // _analyzeAll_assertFinished(); |
| 487 // LibraryElement library = _context.computeLibraryElement(source); |
| 488 // ClassElement classA = _findClass(library.definingCompilationUnit, "A"); |
| 489 // ConstructorElement constructor = classA.constructors[0]; |
| 490 // ElementLocation location = constructor.location; |
| 491 // Element element = _context.getElement(location); |
| 492 // JUnitTestCase.assertSame(constructor, element); |
| 493 // } |
| 494 // void test_getElement_constructor_unnamed() { |
| 495 // Source source = _addSource("/lib.dart", EngineTestCase.createSource(["cla
ss A {", " A() {}", "}"])); |
| 496 // _analyzeAll_assertFinished(); |
| 497 // LibraryElement library = _context.computeLibraryElement(source); |
| 498 // ClassElement classA = _findClass(library.definingCompilationUnit, "A"); |
| 499 // ConstructorElement constructor = classA.constructors[0]; |
| 500 // ElementLocation location = constructor.location; |
| 501 // Element element = _context.getElement(location); |
| 502 // JUnitTestCase.assertSame(constructor, element); |
| 503 // } |
| 504 // void test_getErrors_dart_none() { |
| 505 // Source source = _addSource("/lib.dart", "library lib;"); |
| 506 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 507 // EngineTestCase.assertLength(0, errors); |
| 508 // _context.computeErrors(source); |
| 509 // errors = _context.getErrors(source).errors; |
| 510 // EngineTestCase.assertLength(0, errors); |
| 511 // } |
| 512 // void test_getErrors_dart_some() { |
| 513 // Source source = _addSource("/lib.dart", "library 'lib';"); |
| 514 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 515 // EngineTestCase.assertLength(0, errors); |
| 516 // _context.computeErrors(source); |
| 517 // errors = _context.getErrors(source).errors; |
| 518 // EngineTestCase.assertLength(1, errors); |
| 519 // } |
| 520 // void test_getErrors_html_none() { |
| 521 // Source source = _addSource("/test.html", "<html></html>"); |
| 522 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 523 // EngineTestCase.assertLength(0, errors); |
| 524 // _context.computeErrors(source); |
| 525 // errors = _context.getErrors(source).errors; |
| 526 // EngineTestCase.assertLength(0, errors); |
| 527 // } |
| 528 // void test_getErrors_html_some() { |
| 529 // Source source = _addSource("/test.html", EngineTestCase.createSource([ |
| 530 // "<html><head>", |
| 531 // "<script type='application/dart' src='test.dart'/>", |
| 532 // "</head></html>"])); |
| 533 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 534 // EngineTestCase.assertLength(0, errors); |
| 535 // _context.computeErrors(source); |
| 536 // errors = _context.getErrors(source).errors; |
| 537 // EngineTestCase.assertLength(1, errors); |
| 538 // } |
| 539 // void test_getHtmlElement_dart() { |
| 540 // Source source = _addSource("/test.dart", ""); |
| 541 // JUnitTestCase.assertNull(_context.getHtmlElement(source)); |
| 542 // JUnitTestCase.assertNull(_context.computeHtmlElement(source)); |
| 543 // JUnitTestCase.assertNull(_context.getHtmlElement(source)); |
| 544 // } |
| 545 // void test_getHtmlElement_html() { |
| 546 // Source source = _addSource("/test.html", "<html></html>"); |
| 547 // HtmlElement element = _context.getHtmlElement(source); |
| 548 // JUnitTestCase.assertNull(element); |
| 549 // _context.computeHtmlElement(source); |
| 550 // element = _context.getHtmlElement(source); |
| 551 // JUnitTestCase.assertNotNull(element); |
| 552 // } |
| 553 // void test_getHtmlFilesReferencing_html() { |
| 554 // _context = AnalysisContextFactory.contextWithCore(); |
| 555 // _sourceFactory = _context.sourceFactory; |
| 556 // Source htmlSource = _addSource("/test.html", EngineTestCase.createSource(
[ |
| 557 // "<html><head>", |
| 558 // "<script type='application/dart' src='test.dart'/>", |
| 559 // "<script type='application/dart' src='test.js'/>", |
| 560 // "</head></html>"])); |
| 561 // Source librarySource = _addSource("/test.dart", "library lib;"); |
| 562 // Source secondHtmlSource = _addSource("/test.html", "<html></html>"); |
| 563 // _context.computeLibraryElement(librarySource); |
| 564 // List<Source> result = _context.getHtmlFilesReferencing(secondHtmlSource); |
| 565 // EngineTestCase.assertLength(0, result); |
| 566 // _context.parseHtmlUnit(htmlSource); |
| 567 // result = _context.getHtmlFilesReferencing(secondHtmlSource); |
| 568 // EngineTestCase.assertLength(0, result); |
| 569 // } |
| 570 // void test_getHtmlFilesReferencing_library() { |
| 571 // Source htmlSource = _addSource("/test.html", EngineTestCase.createSource(
[ |
| 572 // "<html><head>", |
| 573 // "<script type='application/dart' src='test.dart'/>", |
| 574 // "<script type='application/dart' src='test.js'/>", |
| 575 // "</head></html>"])); |
| 576 // Source librarySource = _addSource("/test.dart", "library lib;"); |
| 577 // List<Source> result = _context.getHtmlFilesReferencing(librarySource); |
| 578 // EngineTestCase.assertLength(0, result); |
| 579 // _context.parseHtmlUnit(htmlSource); |
| 580 // result = _context.getHtmlFilesReferencing(librarySource); |
| 581 // EngineTestCase.assertLength(1, result); |
| 582 // JUnitTestCase.assertEquals(htmlSource, result[0]); |
| 583 // } |
| 584 // void test_getHtmlFilesReferencing_part() { |
| 585 // _context = AnalysisContextFactory.contextWithCore(); |
| 586 // _sourceFactory = _context.sourceFactory; |
| 587 // Source htmlSource = _addSource("/test.html", EngineTestCase.createSource(
[ |
| 588 // "<html><head>", |
| 589 // "<script type='application/dart' src='test.dart'/>", |
| 590 // "<script type='application/dart' src='test.js'/>", |
| 591 // "</head></html>"])); |
| 592 // Source librarySource = _addSource("/test.dart", "library lib; part 'part.
dart';"); |
| 593 // Source partSource = _addSource("/part.dart", "part of lib;"); |
| 594 // _context.computeLibraryElement(librarySource); |
| 595 // List<Source> result = _context.getHtmlFilesReferencing(partSource); |
| 596 // EngineTestCase.assertLength(0, result); |
| 597 // _context.parseHtmlUnit(htmlSource); |
| 598 // result = _context.getHtmlFilesReferencing(partSource); |
| 599 // EngineTestCase.assertLength(1, result); |
| 600 // JUnitTestCase.assertEquals(htmlSource, result[0]); |
| 601 // } |
| 602 // void test_getHtmlSources() { |
| 603 // List<Source> sources = _context.htmlSources; |
| 604 // EngineTestCase.assertLength(0, sources); |
| 605 // Source source = _addSource("/test.html", ""); |
| 606 // _context.computeKindOf(source); |
| 607 // sources = _context.htmlSources; |
| 608 // EngineTestCase.assertLength(1, sources); |
| 609 // JUnitTestCase.assertEquals(source, sources[0]); |
| 610 // } |
| 611 // void test_getKindOf_html() { |
| 612 // Source source = _addSource("/test.html", ""); |
| 613 // JUnitTestCase.assertSame(SourceKind.HTML, _context.getKindOf(source)); |
| 614 // } |
| 615 // void test_getKindOf_library() { |
| 616 // Source source = _addSource("/test.dart", "library lib;"); |
| 617 // JUnitTestCase.assertSame(SourceKind.UNKNOWN, _context.getKindOf(source)); |
| 618 // _context.computeKindOf(source); |
| 619 // JUnitTestCase.assertSame(SourceKind.LIBRARY, _context.getKindOf(source)); |
| 620 // } |
| 621 // void test_getKindOf_part() { |
| 622 // Source source = _addSource("/test.dart", "part of lib;"); |
| 623 // JUnitTestCase.assertSame(SourceKind.UNKNOWN, _context.getKindOf(source)); |
| 624 // _context.computeKindOf(source); |
| 625 // JUnitTestCase.assertSame(SourceKind.PART, _context.getKindOf(source)); |
| 626 // } |
| 627 // void test_getKindOf_unknown() { |
| 628 // Source source = _addSource("/test.css", ""); |
| 629 // JUnitTestCase.assertSame(SourceKind.UNKNOWN, _context.getKindOf(source)); |
| 630 // } |
| 631 // void test_getLaunchableClientLibrarySources() { |
| 632 // _context = AnalysisContextFactory.contextWithCore(); |
| 633 // _sourceFactory = _context.sourceFactory; |
| 634 // List<Source> sources = _context.launchableClientLibrarySources; |
| 635 // EngineTestCase.assertLength(0, sources); |
| 636 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["im
port 'dart:html';", "main() {}"])); |
| 637 // _context.computeLibraryElement(source); |
| 638 // sources = _context.launchableClientLibrarySources; |
| 639 // EngineTestCase.assertLength(1, sources); |
| 640 // } |
| 641 // void test_getLaunchableServerLibrarySources() { |
| 642 // _context = AnalysisContextFactory.contextWithCore(); |
| 643 // _sourceFactory = _context.sourceFactory; |
| 644 // List<Source> sources = _context.launchableServerLibrarySources; |
| 645 // EngineTestCase.assertLength(0, sources); |
| 646 // Source source = _addSource("/test.dart", "main() {}"); |
| 647 // _context.computeLibraryElement(source); |
| 648 // sources = _context.launchableServerLibrarySources; |
| 649 // EngineTestCase.assertLength(1, sources); |
| 650 // } |
| 651 // void test_getLibrariesContaining() { |
| 652 // _context = AnalysisContextFactory.contextWithCore(); |
| 653 // _sourceFactory = _context.sourceFactory; |
| 654 // Source librarySource = _addSource("/lib.dart", EngineTestCase.createSourc
e(["library lib;", "part 'part.dart';"])); |
| 655 // Source partSource = _addSource("/part.dart", "part of lib;"); |
| 656 // _context.computeLibraryElement(librarySource); |
| 657 // List<Source> result = _context.getLibrariesContaining(librarySource); |
| 658 // EngineTestCase.assertLength(1, result); |
| 659 // JUnitTestCase.assertEquals(librarySource, result[0]); |
| 660 // result = _context.getLibrariesContaining(partSource); |
| 661 // EngineTestCase.assertLength(1, result); |
| 662 // JUnitTestCase.assertEquals(librarySource, result[0]); |
| 663 // } |
| 664 // void test_getLibrariesDependingOn() { |
| 665 // _context = AnalysisContextFactory.contextWithCore(); |
| 666 // _sourceFactory = _context.sourceFactory; |
| 667 // Source libASource = _addSource("/libA.dart", "library libA;"); |
| 668 // _addSource("/libB.dart", "library libB;"); |
| 669 // Source lib1Source = _addSource("/lib1.dart", EngineTestCase.createSource(
[ |
| 670 // "library lib1;", |
| 671 // "import 'libA.dart';", |
| 672 // "export 'libB.dart';"])); |
| 673 // Source lib2Source = _addSource("/lib2.dart", EngineTestCase.createSource(
[ |
| 674 // "library lib2;", |
| 675 // "import 'libB.dart';", |
| 676 // "export 'libA.dart';"])); |
| 677 // _context.computeLibraryElement(lib1Source); |
| 678 // _context.computeLibraryElement(lib2Source); |
| 679 // List<Source> result = _context.getLibrariesDependingOn(libASource); |
| 680 // EngineTestCase.assertContains(result, [lib1Source, lib2Source]); |
| 681 // } |
| 682 // void test_getLibrariesReferencedFromHtml() { |
| 683 // _context = AnalysisContextFactory.contextWithCore(); |
| 684 // _sourceFactory = _context.sourceFactory; |
| 685 // Source htmlSource = _addSource("/test.html", EngineTestCase.createSource(
[ |
| 686 // "<html><head>", |
| 687 // "<script type='application/dart' src='test.dart'/>", |
| 688 // "<script type='application/dart' src='test.js'/>", |
| 689 // "</head></html>"])); |
| 690 // Source librarySource = _addSource("/test.dart", "library lib;"); |
| 691 // _context.computeLibraryElement(librarySource); |
| 692 // _context.parseHtmlUnit(htmlSource); |
| 693 // List<Source> result = _context.getLibrariesReferencedFromHtml(htmlSource)
; |
| 694 // EngineTestCase.assertLength(1, result); |
| 695 // JUnitTestCase.assertEquals(librarySource, result[0]); |
| 696 // } |
| 697 // void test_getLibrariesReferencedFromHtml_no() { |
| 698 // _context = AnalysisContextFactory.contextWithCore(); |
| 699 // _sourceFactory = _context.sourceFactory; |
| 700 // Source htmlSource = _addSource("/test.html", EngineTestCase.createSource(
[ |
| 701 // "<html><head>", |
| 702 // "<script type='application/dart' src='test.js'/>", |
| 703 // "</head></html>"])); |
| 704 // _addSource("/test.dart", "library lib;"); |
| 705 // _context.parseHtmlUnit(htmlSource); |
| 706 // List<Source> result = _context.getLibrariesReferencedFromHtml(htmlSource)
; |
| 707 // EngineTestCase.assertLength(0, result); |
| 708 // } |
| 709 // void test_getLibraryElement() { |
| 710 // _context = AnalysisContextFactory.contextWithCore(); |
| 711 // _sourceFactory = _context.sourceFactory; |
| 712 // Source source = _addSource("/test.dart", "library lib;"); |
| 713 // LibraryElement element = _context.getLibraryElement(source); |
| 714 // JUnitTestCase.assertNull(element); |
| 715 // _context.computeLibraryElement(source); |
| 716 // element = _context.getLibraryElement(source); |
| 717 // JUnitTestCase.assertNotNull(element); |
| 718 // } |
| 719 // void test_getLibrarySources() { |
| 720 // List<Source> sources = _context.librarySources; |
| 721 // EngineTestCase.assertLength(0, sources); |
| 722 // Source source = _addSource("/test.dart", "library lib;"); |
| 723 // _context.computeKindOf(source); |
| 724 // sources = _context.librarySources; |
| 725 // EngineTestCase.assertLength(1, sources); |
| 726 // JUnitTestCase.assertEquals(source, sources[0]); |
| 727 // } |
| 728 // void test_getLineInfo() { |
| 729 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["li
brary lib;", "", "main() {}"])); |
| 730 // LineInfo info = _context.getLineInfo(source); |
| 731 // JUnitTestCase.assertNull(info); |
| 732 // _context.parseCompilationUnit(source); |
| 733 // info = _context.getLineInfo(source); |
| 734 // JUnitTestCase.assertNotNull(info); |
| 735 // } |
| 736 // void test_getModificationStamp_fromSource() { |
| 737 // int stamp = 42; |
| 738 // JUnitTestCase.assertEquals(stamp, _context.getModificationStamp(new TestS
ource_AnalysisContextImplTest_test_getModificationStamp_fromSource(stamp))); |
| 739 // } |
| 740 // void test_getModificationStamp_overridden() { |
| 741 // int stamp = 42; |
| 742 // Source source = new TestSource_AnalysisContextImplTest_test_getModificati
onStamp_overridden(stamp); |
| 743 // _context.setContents(source, ""); |
| 744 // JUnitTestCase.assertTrue(stamp != _context.getModificationStamp(source)); |
| 745 // } |
| 746 // void test_getPublicNamespace_element() { |
| 747 // _context = AnalysisContextFactory.contextWithCore(); |
| 748 // _sourceFactory = _context.sourceFactory; |
| 749 // Source source = _addSource("/test.dart", "class A {}"); |
| 750 // LibraryElement library = _context.computeLibraryElement(source); |
| 751 // Namespace namespace = _context.getPublicNamespace(library); |
| 752 // JUnitTestCase.assertNotNull(namespace); |
| 753 // EngineTestCase.assertInstanceOf((obj) => obj is ClassElement, ClassElemen
t, namespace.get("A")); |
| 754 // } |
| 755 // void test_getRefactoringUnsafeSources() { |
| 756 // // not sources initially |
| 757 // List<Source> sources = _context.refactoringUnsafeSources; |
| 758 // EngineTestCase.assertLength(0, sources); |
| 759 // // add new source, unresolved |
| 760 // Source source = _addSource("/test.dart", "library lib;"); |
| 761 // sources = _context.refactoringUnsafeSources; |
| 762 // EngineTestCase.assertLength(1, sources); |
| 763 // JUnitTestCase.assertEquals(source, sources[0]); |
| 764 // // resolve source |
| 765 // _context.computeLibraryElement(source); |
| 766 // sources = _context.refactoringUnsafeSources; |
| 767 // EngineTestCase.assertLength(0, sources); |
| 768 // } |
| 769 // void test_getResolvedCompilationUnit_library() { |
| 770 // _context = AnalysisContextFactory.contextWithCore(); |
| 771 // _sourceFactory = _context.sourceFactory; |
| 772 // Source source = _addSource("/lib.dart", "library libb;"); |
| 773 // LibraryElement library = _context.computeLibraryElement(source); |
| 774 // JUnitTestCase.assertNotNull(_context.getResolvedCompilationUnit(source, l
ibrary)); |
| 775 // _context.setContents(source, "library lib;"); |
| 776 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit(source, libr
ary)); |
| 777 // } |
| 778 // void test_getResolvedCompilationUnit_library_null() { |
| 779 // _context = AnalysisContextFactory.contextWithCore(); |
| 780 // _sourceFactory = _context.sourceFactory; |
| 781 // Source source = _addSource("/lib.dart", "library lib;"); |
| 782 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit(source, null
as LibraryElement)); |
| 783 // } |
| 784 // void test_getResolvedCompilationUnit_source_dart() { |
| 785 // _context = AnalysisContextFactory.contextWithCore(); |
| 786 // _sourceFactory = _context.sourceFactory; |
| 787 // Source source = _addSource("/lib.dart", "library lib;"); |
| 788 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(source, sou
rce)); |
| 789 // _context.resolveCompilationUnit2(source, source); |
| 790 // JUnitTestCase.assertNotNull(_context.getResolvedCompilationUnit2(source,
source)); |
| 791 // } |
| 792 // void test_getResolvedCompilationUnit_source_html() { |
| 793 // _context = AnalysisContextFactory.contextWithCore(); |
| 794 // _sourceFactory = _context.sourceFactory; |
| 795 // Source source = _addSource("/test.html", "<html></html>"); |
| 796 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(source, sou
rce)); |
| 797 // JUnitTestCase.assertNull(_context.resolveCompilationUnit2(source, source)
); |
| 798 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(source, sou
rce)); |
| 799 // } |
| 800 // void test_getResolvedHtmlUnit() { |
| 801 // _context = AnalysisContextFactory.contextWithCore(); |
| 802 // _sourceFactory = _context.sourceFactory; |
| 803 // Source source = _addSource("/test.html", "<html></html>"); |
| 804 // JUnitTestCase.assertNull(_context.getResolvedHtmlUnit(source)); |
| 805 // _context.resolveHtmlUnit(source); |
| 806 // JUnitTestCase.assertNotNull(_context.getResolvedHtmlUnit(source)); |
| 807 // } |
| 808 // void test_getSourceFactory() { |
| 809 // JUnitTestCase.assertSame(_sourceFactory, _context.sourceFactory); |
| 810 // } |
| 811 // void test_getStatistics() { |
| 812 // AnalysisContextStatistics statistics = _context.statistics; |
| 813 // JUnitTestCase.assertNotNull(statistics); |
| 814 // EngineTestCase.assertLength(0, statistics.cacheRows); |
| 815 // EngineTestCase.assertLength(0, statistics.exceptions); |
| 816 // EngineTestCase.assertLength(0, statistics.sources); |
| 817 // } |
| 818 // void test_isClientLibrary_dart() { |
| 819 // _context = AnalysisContextFactory.contextWithCore(); |
| 820 // _sourceFactory = _context.sourceFactory; |
| 821 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["im
port 'dart:html';", "", "main() {}"])); |
| 822 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); |
| 823 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| 824 // _context.computeLibraryElement(source); |
| 825 // JUnitTestCase.assertTrue(_context.isClientLibrary(source)); |
| 826 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| 827 // } |
| 828 // void test_isClientLibrary_html() { |
| 829 // Source source = _addSource("/test.html", "<html></html>"); |
| 830 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); |
| 831 // } |
| 832 // void test_isServerLibrary_dart() { |
| 833 // _context = AnalysisContextFactory.contextWithCore(); |
| 834 // _sourceFactory = _context.sourceFactory; |
| 835 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["li
brary lib;", "", "main() {}"])); |
| 836 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); |
| 837 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| 838 // _context.computeLibraryElement(source); |
| 839 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); |
| 840 // JUnitTestCase.assertTrue(_context.isServerLibrary(source)); |
| 841 // } |
| 842 // void test_isServerLibrary_html() { |
| 843 // Source source = _addSource("/test.html", "<html></html>"); |
| 844 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| 845 // } |
| 846 // void test_parseCompilationUnit_errors() { |
| 847 // Source source = _addSource("/lib.dart", "library {"); |
| 848 // CompilationUnit compilationUnit = _context.parseCompilationUnit(source); |
| 849 // JUnitTestCase.assertNotNull(compilationUnit); |
| 850 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 851 // JUnitTestCase.assertNotNull(errors); |
| 852 // JUnitTestCase.assertTrue(errors.length > 0); |
| 853 // } |
| 854 // void test_parseCompilationUnit_exception() { |
| 855 // Source source = _addSourceWithException("/test.dart"); |
| 856 // try { |
| 857 // _context.parseCompilationUnit(source); |
| 858 // JUnitTestCase.fail("Expected AnalysisException"); |
| 859 // } on AnalysisException catch (exception) { |
| 860 // } |
| 861 // } |
| 862 // void test_parseCompilationUnit_html() { |
| 863 // Source source = _addSource("/test.html", "<html></html>"); |
| 864 // JUnitTestCase.assertNull(_context.parseCompilationUnit(source)); |
| 865 // } |
| 866 // void test_parseCompilationUnit_noErrors() { |
| 867 // Source source = _addSource("/lib.dart", "library lib;"); |
| 868 // CompilationUnit compilationUnit = _context.parseCompilationUnit(source); |
| 869 // JUnitTestCase.assertNotNull(compilationUnit); |
| 870 // EngineTestCase.assertLength(0, _context.getErrors(source).errors); |
| 871 // } |
| 872 // void test_parseCompilationUnit_nonExistentSource() { |
| 873 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 874 // try { |
| 875 // _context.parseCompilationUnit(source); |
| 876 // JUnitTestCase.fail("Expected AnalysisException because file does not ex
ist"); |
| 877 // } on AnalysisException catch (exception) { |
| 878 // } |
| 879 // } |
| 880 // void test_parseHtmlUnit_noErrors() { |
| 881 // Source source = _addSource("/lib.html", "<html></html>"); |
| 882 // HtmlUnit unit = _context.parseHtmlUnit(source); |
| 883 // JUnitTestCase.assertNotNull(unit); |
| 884 // } |
| 885 // void test_parseHtmlUnit_resolveDirectives() { |
| 886 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "class ClassA {}"])); |
| 887 // Source source = _addSource("/lib.html", EngineTestCase.createSource([ |
| 888 // "<html>", |
| 889 // "<head>", |
| 890 // " <script type='application/dart'>", |
| 891 // " import 'lib.dart';", |
| 892 // " ClassA v = null;", |
| 893 // " </script>", |
| 894 // "</head>", |
| 895 // "<body>", |
| 896 // "</body>", |
| 897 // "</html>"])); |
| 898 // HtmlUnit unit = _context.parseHtmlUnit(source); |
| 899 // // import directive should be resolved |
| 900 // XmlTagNode htmlNode = unit.tagNodes[0]; |
| 901 // XmlTagNode headNode = htmlNode.tagNodes[0]; |
| 902 // HtmlScriptTagNode scriptNode = headNode.tagNodes[0] as HtmlScriptTagNode; |
| 903 // CompilationUnit script = scriptNode.script; |
| 904 // ImportDirective importNode = script.directives[0] as ImportDirective; |
| 905 // JUnitTestCase.assertNotNull(importNode.uriContent); |
| 906 // JUnitTestCase.assertEquals(libSource, importNode.source); |
| 907 // } |
| 908 // void test_performAnalysisTask_addPart() { |
| 909 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "part 'part.dart';"])); |
| 910 // // run all tasks without part |
| 911 // _analyzeAll_assertFinished(); |
| 912 // // add part and run all tasks |
| 913 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["part of lib;", ""])); |
| 914 // _analyzeAll_assertFinished(); |
| 915 // // "libSource" should be here |
| 916 // List<Source> librariesWithPart = _context.getLibrariesContaining(partSour
ce); |
| 917 // EngineTestCase.assertContains(librariesWithPart, [libSource]); |
| 918 // } |
| 919 // void test_performAnalysisTask_changeLibraryContents() { |
| 920 // Source libSource = _addSource("/test.dart", "library lib; part 'test-part
.dart';"); |
| 921 // Source partSource = _addSource("/test-part.dart", "part of lib;"); |
| 922 // _analyzeAll_assertFinished(); |
| 923 // JUnitTestCase.assertNotNullMsg("library resolved 1", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 924 // JUnitTestCase.assertNotNullMsg("part resolved 1", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 925 // // update and analyze #1 |
| 926 // _context.setContents(libSource, "library lib;"); |
| 927 // JUnitTestCase.assertNullMsg("library changed 2", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 928 // JUnitTestCase.assertNullMsg("part changed 2", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 929 // _analyzeAll_assertFinished(); |
| 930 // JUnitTestCase.assertNotNullMsg("library resolved 2", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 931 // JUnitTestCase.assertNullMsg("part resolved 2", _context.getResolvedCompil
ationUnit2(partSource, libSource)); |
| 932 // // update and analyze #2 |
| 933 // _context.setContents(libSource, "library lib; part 'test-part.dart';"); |
| 934 // JUnitTestCase.assertNullMsg("library changed 3", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 935 // JUnitTestCase.assertNullMsg("part changed 3", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 936 // _analyzeAll_assertFinished(); |
| 937 // JUnitTestCase.assertNotNullMsg("library resolved 2", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 938 // JUnitTestCase.assertNotNullMsg("part resolved 3", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 939 // } |
| 940 // void test_performAnalysisTask_changeLibraryThenPartContents() { |
| 941 // Source libSource = _addSource("/test.dart", "library lib; part 'test-part
.dart';"); |
| 942 // Source partSource = _addSource("/test-part.dart", "part of lib;"); |
| 943 // _analyzeAll_assertFinished(); |
| 944 // JUnitTestCase.assertNotNullMsg("library resolved 1", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 945 // JUnitTestCase.assertNotNullMsg("part resolved 1", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 946 // // update and analyze #1 |
| 947 // _context.setContents(libSource, "library lib;"); |
| 948 // JUnitTestCase.assertNullMsg("library changed 2", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 949 // JUnitTestCase.assertNullMsg("part changed 2", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 950 // _analyzeAll_assertFinished(); |
| 951 // JUnitTestCase.assertNotNullMsg("library resolved 2", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 952 // JUnitTestCase.assertNullMsg("part resolved 2", _context.getResolvedCompil
ationUnit2(partSource, libSource)); |
| 953 // // update and analyze #2 |
| 954 // _context.setContents(partSource, "part of lib; // 1"); |
| 955 // // Assert that changing the part's content does not effect the library |
| 956 // // now that it is no longer part of that library |
| 957 // JUnitTestCase.assertNotNullMsg("library changed 3", _context.getResolvedC
ompilationUnit2(libSource, libSource)); |
| 958 // JUnitTestCase.assertNullMsg("part changed 3", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 959 // _analyzeAll_assertFinished(); |
| 960 // JUnitTestCase.assertNotNullMsg("library resolved 3", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 961 // JUnitTestCase.assertNullMsg("part resolved 3", _context.getResolvedCompil
ationUnit2(partSource, libSource)); |
| 962 // } |
| 963 // void test_performAnalysisTask_changePartContents_makeItAPart() { |
| 964 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "part 'part.dart';", "void f(x) {}"])); |
| 965 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["void g() { f(null); }"])); |
| 966 // _analyzeAll_assertFinished(); |
| 967 // JUnitTestCase.assertNotNullMsg("library resolved 1", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 968 // JUnitTestCase.assertNotNullMsg("part resolved 1", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 969 // // update and analyze |
| 970 // _context.setContents(partSource, EngineTestCase.createSource(["part of li
b;", "void g() { f(null); }"])); |
| 971 // JUnitTestCase.assertNullMsg("library changed 2", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 972 // JUnitTestCase.assertNullMsg("part changed 2", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 973 // _analyzeAll_assertFinished(); |
| 974 // JUnitTestCase.assertNotNullMsg("library resolved 2", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 975 // JUnitTestCase.assertNotNullMsg("part resolved 2", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 976 // EngineTestCase.assertLength(0, _context.getErrors(libSource).errors); |
| 977 // EngineTestCase.assertLength(0, _context.getErrors(partSource).errors); |
| 978 // } |
| 979 // /** |
| 980 // * https://code.google.com/p/dart/issues/detail?id=12424 |
| 981 // */ |
| 982 // void test_performAnalysisTask_changePartContents_makeItNotPart() { |
| 983 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "part 'part.dart';", "void f(x) {}"])); |
| 984 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["part of lib;", "void g() { f(null); }"])); |
| 985 // _analyzeAll_assertFinished(); |
| 986 // EngineTestCase.assertLength(0, _context.getErrors(libSource).errors); |
| 987 // EngineTestCase.assertLength(0, _context.getErrors(partSource).errors); |
| 988 // // Remove 'part' directive, which should make "f(null)" an error. |
| 989 // _context.setContents(partSource, EngineTestCase.createSource(["//part of
lib;", "void g() { f(null); }"])); |
| 990 // _analyzeAll_assertFinished(); |
| 991 // JUnitTestCase.assertTrue(_context.getErrors(libSource).errors.length != 0
); |
| 992 // } |
| 993 // void test_performAnalysisTask_changePartContents_noSemanticChanges() { |
| 994 // Source libSource = _addSource("/test.dart", "library lib; part 'test-part
.dart';"); |
| 995 // Source partSource = _addSource("/test-part.dart", "part of lib;"); |
| 996 // _analyzeAll_assertFinished(); |
| 997 // JUnitTestCase.assertNotNullMsg("library resolved 1", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 998 // JUnitTestCase.assertNotNullMsg("part resolved 1", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 999 // // update and analyze #1 |
| 1000 // _context.setContents(partSource, "part of lib; // 1"); |
| 1001 // JUnitTestCase.assertNullMsg("library changed 2", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 1002 // JUnitTestCase.assertNullMsg("part changed 2", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 1003 // _analyzeAll_assertFinished(); |
| 1004 // JUnitTestCase.assertNotNullMsg("library resolved 2", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 1005 // JUnitTestCase.assertNotNullMsg("part resolved 2", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 1006 // // update and analyze #2 |
| 1007 // _context.setContents(partSource, "part of lib; // 12"); |
| 1008 // JUnitTestCase.assertNullMsg("library changed 3", _context.getResolvedComp
ilationUnit2(libSource, libSource)); |
| 1009 // JUnitTestCase.assertNullMsg("part changed 3", _context.getResolvedCompila
tionUnit2(partSource, libSource)); |
| 1010 // _analyzeAll_assertFinished(); |
| 1011 // JUnitTestCase.assertNotNullMsg("library resolved 3", _context.getResolved
CompilationUnit2(libSource, libSource)); |
| 1012 // JUnitTestCase.assertNotNullMsg("part resolved 3", _context.getResolvedCom
pilationUnit2(partSource, libSource)); |
| 1013 // } |
| 1014 // void test_performAnalysisTask_importedLibraryAdd() { |
| 1015 // Source libASource = _addSource("/libA.dart", "library libA; import 'libB.
dart';"); |
| 1016 // _analyzeAll_assertFinished(); |
| 1017 // JUnitTestCase.assertNotNullMsg("libA resolved 1", _context.getResolvedCom
pilationUnit2(libASource, libASource)); |
| 1018 // JUnitTestCase.assertTrueMsg("libA has an error", _hasAnalysisErrorWithErr
orSeverity(_context.getErrors(libASource))); |
| 1019 // // add libB.dart and analyze |
| 1020 // Source libBSource = _addSource("/libB.dart", "library libB;"); |
| 1021 // _analyzeAll_assertFinished(); |
| 1022 // JUnitTestCase.assertNotNullMsg("libA resolved 2", _context.getResolvedCom
pilationUnit2(libASource, libASource)); |
| 1023 // JUnitTestCase.assertNotNullMsg("libB resolved 2", _context.getResolvedCom
pilationUnit2(libBSource, libBSource)); |
| 1024 // JUnitTestCase.assertTrueMsg("libA doesn't have errors", !_hasAnalysisErro
rWithErrorSeverity(_context.getErrors(libASource))); |
| 1025 // } |
| 1026 // void test_performAnalysisTask_importedLibraryAdd_html() { |
| 1027 // Source htmlSource = _addSource("/page.html", EngineTestCase.createSource(
[ |
| 1028 // "<html><body><script type=\"application/dart\">", |
| 1029 // " import '/libB.dart';", |
| 1030 // " main() {print('hello dart');}", |
| 1031 // "</script></body></html>"])); |
| 1032 // _analyzeAll_assertFinished(); |
| 1033 // JUnitTestCase.assertNotNullMsg("htmlUnit resolved 1", _context.getResolve
dHtmlUnit(htmlSource)); |
| 1034 // JUnitTestCase.assertTrueMsg("htmlSource has an error", _hasAnalysisErrorW
ithErrorSeverity(_context.getErrors(htmlSource))); |
| 1035 // // add libB.dart and analyze |
| 1036 // Source libBSource = _addSource("/libB.dart", "library libB;"); |
| 1037 // _analyzeAll_assertFinished(); |
| 1038 // JUnitTestCase.assertNotNullMsg("htmlUnit resolved 1", _context.getResolve
dHtmlUnit(htmlSource)); |
| 1039 // JUnitTestCase.assertNotNullMsg("libB resolved 2", _context.getResolvedCom
pilationUnit2(libBSource, libBSource)); |
| 1040 // AnalysisErrorInfo errors = _context.getErrors(htmlSource); |
| 1041 // JUnitTestCase.assertTrueMsg("htmlSource doesn't have errors", !_hasAnalys
isErrorWithErrorSeverity(errors)); |
| 1042 // } |
| 1043 // void test_performAnalysisTask_importedLibraryDelete() { |
| 1044 // Source libASource = _addSource("/libA.dart", "library libA; import 'libB.
dart';"); |
| 1045 // Source libBSource = _addSource("/libB.dart", "library libB;"); |
| 1046 // _analyzeAll_assertFinished(); |
| 1047 // JUnitTestCase.assertNotNullMsg("libA resolved 1", _context.getResolvedCom
pilationUnit2(libASource, libASource)); |
| 1048 // JUnitTestCase.assertNotNullMsg("libB resolved 1", _context.getResolvedCom
pilationUnit2(libBSource, libBSource)); |
| 1049 // JUnitTestCase.assertTrueMsg("libA doesn't have errors", !_hasAnalysisErro
rWithErrorSeverity(_context.getErrors(libASource))); |
| 1050 // // remove libB.dart content and analyze |
| 1051 // _context.setContents(libBSource, null); |
| 1052 // _analyzeAll_assertFinished(); |
| 1053 // JUnitTestCase.assertNotNullMsg("libA resolved 2", _context.getResolvedCom
pilationUnit2(libASource, libASource)); |
| 1054 // JUnitTestCase.assertTrueMsg("libA has an error", _hasAnalysisErrorWithErr
orSeverity(_context.getErrors(libASource))); |
| 1055 // } |
| 1056 // void test_performAnalysisTask_IOException() { |
| 1057 // TestSource source = _addSourceWithException2("/test.dart", "library test;
"); |
| 1058 // source.generateExceptionOnRead = false; |
| 1059 // _analyzeAll_assertFinished(); |
| 1060 // JUnitTestCase.assertEquals(1, source.readCount); |
| 1061 // source.generateExceptionOnRead = true; |
| 1062 // _changeSource(source, ""); |
| 1063 // _context.performAnalysisTask(); |
| 1064 // JUnitTestCase.assertNull(_context.performAnalysisTask().changeNotices); |
| 1065 // JUnitTestCase.assertEquals(2, source.readCount); |
| 1066 // } |
| 1067 // void test_performAnalysisTask_missingPart() { |
| 1068 // Source source = _addSource("/test.dart", "library lib; part 'no-such-file
.dart';"); |
| 1069 // _analyzeAll_assertFinished(); |
| 1070 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); |
| 1071 // } |
| 1072 // void test_performAnalysisTask_modifiedAfterParse() { |
| 1073 // Source source = _addSource("/test.dart", "library lib;"); |
| 1074 // int initialTime = _context.getModificationStamp(source); |
| 1075 // List<Source> sources = new List<Source>(); |
| 1076 // sources.add(source); |
| 1077 // _context.analysisPriorityOrder = sources; |
| 1078 // _context.parseCompilationUnit(source); |
| 1079 // while (initialTime == JavaSystem.currentTimeMillis()) { |
| 1080 // Thread.sleep(1); |
| 1081 // } |
| 1082 // _context.setContents(source, "library test;"); |
| 1083 // JUnitTestCase.assertTrue(initialTime != _context.getModificationStamp(sou
rce)); |
| 1084 // _analyzeAll_assertFinished(); |
| 1085 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); |
| 1086 // } |
| 1087 // void test_resolveCompilationUnit_library() { |
| 1088 // _context = AnalysisContextFactory.contextWithCore(); |
| 1089 // _sourceFactory = _context.sourceFactory; |
| 1090 // Source source = _addSource("/lib.dart", "library lib;"); |
| 1091 // LibraryElement library = _context.computeLibraryElement(source); |
| 1092 // CompilationUnit compilationUnit = _context.resolveCompilationUnit(source,
library); |
| 1093 // JUnitTestCase.assertNotNull(compilationUnit); |
| 1094 // } |
| 1095 // void test_resolveCompilationUnit_source() { |
| 1096 // _context = AnalysisContextFactory.contextWithCore(); |
| 1097 // _sourceFactory = _context.sourceFactory; |
| 1098 // Source source = _addSource("/lib.dart", "library lib;"); |
| 1099 // CompilationUnit compilationUnit = _context.resolveCompilationUnit2(source
, source); |
| 1100 // JUnitTestCase.assertNotNull(compilationUnit); |
| 1101 // } |
| 1102 // void test_resolveCompilationUnit_sourceChangeDuringResolution() { |
| 1103 // _context = new AnalysisContextImpl_AnalysisContextImplTest_test_resolveCo
mpilationUnit_sourceChangeDuringResolution(); |
| 1104 // AnalysisContextFactory.initContextWithCore(_context); |
| 1105 // _sourceFactory = _context.sourceFactory; |
| 1106 // Source source = _addSource("/lib.dart", "library lib;"); |
| 1107 // CompilationUnit compilationUnit = _context.resolveCompilationUnit2(source
, source); |
| 1108 // JUnitTestCase.assertNotNull(compilationUnit); |
| 1109 // JUnitTestCase.assertNotNull(_context.getLineInfo(source)); |
| 1110 // } |
| 1111 // void test_resolveHtmlUnit() { |
| 1112 // Source source = _addSource("/lib.html", "<html></html>"); |
| 1113 // HtmlUnit unit = _context.resolveHtmlUnit(source); |
| 1114 // JUnitTestCase.assertNotNull(unit); |
| 1115 // } |
| 1116 // void test_setAnalysisOptions() { |
| 1117 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1118 // options.cacheSize = 42; |
| 1119 // options.dart2jsHint = false; |
| 1120 // options.hint = false; |
| 1121 // _context.analysisOptions = options; |
| 1122 // AnalysisOptions result = _context.analysisOptions; |
| 1123 // JUnitTestCase.assertEquals(options.cacheSize, result.cacheSize); |
| 1124 // JUnitTestCase.assertEquals(options.dart2jsHint, result.dart2jsHint); |
| 1125 // JUnitTestCase.assertEquals(options.hint, result.hint); |
| 1126 // } |
| 1127 // void test_setAnalysisOptions_reduceAnalysisPriorityOrder() { |
| 1128 // AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(_context.analy
sisOptions); |
| 1129 // List<Source> sources = new List<Source>(); |
| 1130 // for (int index = 0; index < options.cacheSize; index++) { |
| 1131 // sources.add(_addSource("/lib.dart${index}", "")); |
| 1132 // } |
| 1133 // _context.analysisPriorityOrder = sources; |
| 1134 // int oldPriorityOrderSize = _getPriorityOrder(_context).length; |
| 1135 // options.cacheSize = options.cacheSize - 10; |
| 1136 // _context.analysisOptions = options; |
| 1137 // JUnitTestCase.assertTrue(oldPriorityOrderSize > _getPriorityOrder(_contex
t).length); |
| 1138 // } |
| 1139 // void test_setAnalysisPriorityOrder_empty() { |
| 1140 // _context.analysisPriorityOrder = new List<Source>(); |
| 1141 // } |
| 1142 // void test_setAnalysisPriorityOrder_lessThanCacheSize() { |
| 1143 // AnalysisOptions options = _context.analysisOptions; |
| 1144 // List<Source> sources = new List<Source>(); |
| 1145 // for (int index = 0; index < options.cacheSize; index++) { |
| 1146 // sources.add(_addSource("/lib.dart${index}", "")); |
| 1147 // } |
| 1148 // _context.analysisPriorityOrder = sources; |
| 1149 // JUnitTestCase.assertTrue(options.cacheSize > _getPriorityOrder(_context).
length); |
| 1150 // } |
| 1151 // void test_setAnalysisPriorityOrder_nonEmpty() { |
| 1152 // List<Source> sources = new List<Source>(); |
| 1153 // sources.add(_addSource("/lib.dart", "library lib;")); |
| 1154 // _context.analysisPriorityOrder = sources; |
| 1155 // } |
| 1156 // void test_setChangedContents_libraryWithPart() { |
| 1157 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1158 // options.incremental = true; |
| 1159 // _context = AnalysisContextFactory.contextWithCoreAndOptions(options); |
| 1160 // _sourceFactory = _context.sourceFactory; |
| 1161 // String oldCode = EngineTestCase.createSource(["library lib;", "part 'part
.dart';", "int a = 0;"]); |
| 1162 // Source librarySource = _addSource("/lib.dart", oldCode); |
| 1163 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["part of lib;", "int b = a;"])); |
| 1164 // LibraryElement element = _context.computeLibraryElement(librarySource); |
| 1165 // CompilationUnit unit = _context.getResolvedCompilationUnit(librarySource,
element); |
| 1166 // JUnitTestCase.assertNotNull(unit); |
| 1167 // int offset = oldCode.indexOf("int a") + 4; |
| 1168 // String newCode = EngineTestCase.createSource(["library lib;", "part 'part
.dart';", "int ya = 0;"]); |
| 1169 // JUnitTestCase.assertNull(_getIncrementalAnalysisCache(_context)); |
| 1170 // _context.setChangedContents(librarySource, newCode, offset, 0, 1); |
| 1171 // JUnitTestCase.assertEquals(newCode, _context.getContents(librarySource).d
ata); |
| 1172 // IncrementalAnalysisCache incrementalCache = _getIncrementalAnalysisCache(
_context); |
| 1173 // JUnitTestCase.assertEquals(librarySource, incrementalCache.librarySource)
; |
| 1174 // JUnitTestCase.assertSame(unit, incrementalCache.resolvedUnit); |
| 1175 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(partSource,
librarySource)); |
| 1176 // JUnitTestCase.assertEquals(newCode, incrementalCache.newContents); |
| 1177 // } |
| 1178 // void test_setChangedContents_notResolved() { |
| 1179 // _context = AnalysisContextFactory.contextWithCore(); |
| 1180 // AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(_context.analy
sisOptions); |
| 1181 // options.incremental = true; |
| 1182 // _context.analysisOptions = options; |
| 1183 // _sourceFactory = _context.sourceFactory; |
| 1184 // String oldCode = EngineTestCase.createSource(["library lib;", "int a = 0;
"]); |
| 1185 // Source librarySource = _addSource("/lib.dart", oldCode); |
| 1186 // int offset = oldCode.indexOf("int a") + 4; |
| 1187 // String newCode = EngineTestCase.createSource(["library lib;", "int ya = 0
;"]); |
| 1188 // _context.setChangedContents(librarySource, newCode, offset, 0, 1); |
| 1189 // JUnitTestCase.assertEquals(newCode, _context.getContents(librarySource).d
ata); |
| 1190 // JUnitTestCase.assertNull(_getIncrementalAnalysisCache(_context)); |
| 1191 // } |
| 1192 // void test_setContents_libraryWithPart() { |
| 1193 // _context = AnalysisContextFactory.contextWithCore(); |
| 1194 // _sourceFactory = _context.sourceFactory; |
| 1195 // Source librarySource = _addSource("/lib.dart", EngineTestCase.createSourc
e(["library lib;", "part 'part.dart';", "int a = 0;"])); |
| 1196 // Source partSource = _addSource("/part.dart", EngineTestCase.createSource(
["part of lib;", "int b = a;"])); |
| 1197 // _context.computeLibraryElement(librarySource); |
| 1198 // IncrementalAnalysisCache incrementalCache = new IncrementalAnalysisCache(
librarySource, librarySource, null, null, null, 0, 0, 0); |
| 1199 // _setIncrementalAnalysisCache(_context, incrementalCache); |
| 1200 // JUnitTestCase.assertSame(incrementalCache, _getIncrementalAnalysisCache(_
context)); |
| 1201 // _context.setContents(librarySource, EngineTestCase.createSource(["library
lib;", "part 'part.dart';", "int aa = 0;"])); |
| 1202 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(partSource,
librarySource)); |
| 1203 // JUnitTestCase.assertNull(_getIncrementalAnalysisCache(_context)); |
| 1204 // } |
| 1205 // void test_setContents_null() { |
| 1206 // _context = AnalysisContextFactory.contextWithCore(); |
| 1207 // _sourceFactory = _context.sourceFactory; |
| 1208 // Source librarySource = _addSource("/lib.dart", EngineTestCase.createSourc
e(["library lib;", "int a = 0;"])); |
| 1209 // _context.computeLibraryElement(librarySource); |
| 1210 // IncrementalAnalysisCache incrementalCache = new IncrementalAnalysisCache(
librarySource, librarySource, null, null, null, 0, 0, 0); |
| 1211 // _setIncrementalAnalysisCache(_context, incrementalCache); |
| 1212 // JUnitTestCase.assertSame(incrementalCache, _getIncrementalAnalysisCache(_
context)); |
| 1213 // _context.setContents(librarySource, null); |
| 1214 // JUnitTestCase.assertNull(_context.getResolvedCompilationUnit2(librarySour
ce, librarySource)); |
| 1215 // JUnitTestCase.assertNull(_getIncrementalAnalysisCache(_context)); |
| 1216 // } |
| 1217 // void test_setSourceFactory() { |
| 1218 // JUnitTestCase.assertEquals(_sourceFactory, _context.sourceFactory); |
| 1219 // SourceFactory factory = new SourceFactory([]); |
| 1220 // _context.sourceFactory = factory; |
| 1221 // JUnitTestCase.assertEquals(factory, _context.sourceFactory); |
| 1222 // } |
| 1223 // void test_unreadableSource() { |
| 1224 // _context = AnalysisContextFactory.contextWithCore(); |
| 1225 // _sourceFactory = _context.sourceFactory; |
| 1226 // Source test1 = _addSource("/test1.dart", EngineTestCase.createSource(["im
port 'test2.dart';", "library test1;"])); |
| 1227 // Source test2 = _addSource("/test2.dart", EngineTestCase.createSource([ |
| 1228 // "import 'test1.dart';", |
| 1229 // "import 'test3.dart';", |
| 1230 // "library test2;"])); |
| 1231 // Source test3 = _addSourceWithException("/test3.dart"); |
| 1232 // _analyzeAll_assertFinished(); |
| 1233 // // test1 and test2 should have been successfully analyzed despite the fac
t that |
| 1234 // // test3 couldn't be read. |
| 1235 // JUnitTestCase.assertNotNull(_context.computeLibraryElement(test1)); |
| 1236 // JUnitTestCase.assertNotNull(_context.computeLibraryElement(test2)); |
| 1237 // JUnitTestCase.assertNull(_context.computeLibraryElement(test3)); |
| 1238 // } |
| 1239 // void test_updateAnalysis() { |
| 1240 // JUnitTestCase.assertTrue(_context.sourcesNeedingProcessing.isEmpty); |
| 1241 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 1242 // AnalysisDelta delta = new AnalysisDelta(); |
| 1243 // delta.setAnalysisLevel(source, AnalysisLevel.ALL); |
| 1244 // _context.applyAnalysisDelta(delta); |
| 1245 // JUnitTestCase.assertTrue(_context.sourcesNeedingProcessing.contains(sourc
e)); |
| 1246 // delta = new AnalysisDelta(); |
| 1247 // delta.setAnalysisLevel(source, AnalysisLevel.NONE); |
| 1248 // _context.applyAnalysisDelta(delta); |
| 1249 // JUnitTestCase.assertFalse(_context.sourcesNeedingProcessing.contains(sour
ce)); |
| 1250 // } |
| 1251 // void xtest_performAnalysisTask_stress() { |
| 1252 // int maxCacheSize = 4; |
| 1253 // AnalysisOptionsImpl options = new AnalysisOptionsImpl.con1(_context.analy
sisOptions); |
| 1254 // options.cacheSize = maxCacheSize; |
| 1255 // _context.analysisOptions = options; |
| 1256 // int sourceCount = maxCacheSize + 2; |
| 1257 // List<Source> sources = new List<Source>(); |
| 1258 // ChangeSet changeSet = new ChangeSet(); |
| 1259 // for (int i = 0; i < sourceCount; i++) { |
| 1260 // Source source = _addSource("/lib${i}.dart", "library lib${i};"); |
| 1261 // sources.add(source); |
| 1262 // changeSet.addedSource(source); |
| 1263 // } |
| 1264 // _context.applyChanges(changeSet); |
| 1265 // _context.analysisPriorityOrder = sources; |
| 1266 // for (int i = 0; i < 1000; i++) { |
| 1267 // List<ChangeNotice> notice = _context.performAnalysisTask().changeNotice
s; |
| 1268 // if (notice == null) { |
| 1269 // //System.out.println("test_performAnalysisTask_stress: " + i); |
| 1270 // break; |
| 1271 // } |
| 1272 // } |
| 1273 // List<ChangeNotice> notice = _context.performAnalysisTask().changeNotices; |
| 1274 // if (notice != null) { |
| 1275 // JUnitTestCase.fail("performAnalysisTask failed to terminate after analy
zing all sources"); |
| 1276 // } |
| 1277 // } |
| 1278 // Source _addSource(String fileName, String contents) { |
| 1279 // Source source = new FileBasedSource.con1(FileUtilities2.createFile(fileNa
me)); |
| 1280 // ChangeSet changeSet = new ChangeSet(); |
| 1281 // changeSet.addedSource(source); |
| 1282 // _context.applyChanges(changeSet); |
| 1283 // _context.setContents(source, contents); |
| 1284 // return source; |
| 1285 // } |
| 1286 // TestSource _addSourceWithException(String fileName) => _addSourceWithExcept
ion2(fileName, ""); |
| 1287 // TestSource _addSourceWithException2(String fileName, String contents) { |
| 1288 // TestSource source = new TestSource.con1(FileUtilities2.createFile(fileNam
e), contents); |
| 1289 // source.generateExceptionOnRead = true; |
| 1290 // ChangeSet changeSet = new ChangeSet(); |
| 1291 // changeSet.addedSource(source); |
| 1292 // _context.applyChanges(changeSet); |
| 1293 // return source; |
| 1294 // } |
| 1295 // /** |
| 1296 // * Perform analysis tasks up to 512 times and asserts that that was enough. |
| 1297 // */ |
| 1298 // void _analyzeAll_assertFinished() { |
| 1299 // _analyzeAll_assertFinished2(512); |
| 1300 // } |
| 1301 // /** |
| 1302 // * Perform analysis tasks up to the given number of times and asserts that
that was enough. |
| 1303 // * |
| 1304 // * @param maxIterations the maximum number of tasks to perform |
| 1305 // */ |
| 1306 // void _analyzeAll_assertFinished2(int maxIterations) { |
| 1307 // for (int i = 0; i < maxIterations; i++) { |
| 1308 // List<ChangeNotice> notice = _context.performAnalysisTask().changeNotice
s; |
| 1309 // if (notice == null) { |
| 1310 // return; |
| 1311 // } |
| 1312 // } |
| 1313 // JUnitTestCase.fail("performAnalysisTask failed to terminate after analyzi
ng all sources"); |
| 1314 // } |
| 1315 // void _changeSource(TestSource source, String contents) { |
| 1316 // source.contents = contents; |
| 1317 // ChangeSet changeSet = new ChangeSet(); |
| 1318 // changeSet.changedSource(source); |
| 1319 // _context.applyChanges(changeSet); |
| 1320 // } |
| 1321 // /** |
| 1322 // * Search the given compilation unit for a class with the given name. Retur
n the class with the |
| 1323 // * given name, or `null` if the class cannot be found. |
| 1324 // * |
| 1325 // * @param unit the compilation unit being searched |
| 1326 // * @param className the name of the class being searched for |
| 1327 // * @return the class with the given name |
| 1328 // */ |
| 1329 // ClassElement _findClass(CompilationUnitElement unit, String className) { |
| 1330 // for (ClassElement classElement in unit.types) { |
| 1331 // if (classElement.displayName == className) { |
| 1332 // return classElement; |
| 1333 // } |
| 1334 // } |
| 1335 // return null; |
| 1336 // } |
| 1337 // IncrementalAnalysisCache _getIncrementalAnalysisCache(AnalysisContextImpl c
ontext2) { |
| 1338 // return context2.incrementalAnalysisCache_J2DAccessor as IncrementalAnalys
isCache; |
| 1339 // } |
| 1340 // List<Source> _getPriorityOrder(AnalysisContextImpl context2) { |
| 1341 // return context2.priorityOrder_J2DAccessor as List<Source>; |
| 1342 // } |
| 1343 // void _removeSource(Source source) { |
| 1344 // ChangeSet changeSet = new ChangeSet(); |
| 1345 // changeSet.removedSource(source); |
| 1346 // _context.applyChanges(changeSet); |
| 1347 // } |
| 1348 // void _setIncrementalAnalysisCache(AnalysisContextImpl context2, Incremental
AnalysisCache incrementalCache) { |
| 1349 // context2.incrementalAnalysisCache_J2DAccessor = incrementalCache; |
| 1350 // } |
| 1351 // static dartSuite() { |
| 1352 // _ut.group('AnalysisContextImplTest', () { |
| 1353 // _ut.test('test_applyChanges_add', () { |
| 1354 // final __test = new AnalysisContextImplTest(); |
| 1355 // runJUnitTest(__test, __test.test_applyChanges_add); |
| 1356 // }); |
| 1357 // _ut.test('test_applyChanges_change_flush_element', () { |
| 1358 // final __test = new AnalysisContextImplTest(); |
| 1359 // runJUnitTest(__test, __test.test_applyChanges_change_flush_element); |
| 1360 // }); |
| 1361 // _ut.test('test_applyChanges_change_multiple', () { |
| 1362 // final __test = new AnalysisContextImplTest(); |
| 1363 // runJUnitTest(__test, __test.test_applyChanges_change_multiple); |
| 1364 // }); |
| 1365 // _ut.test('test_applyChanges_empty', () { |
| 1366 // final __test = new AnalysisContextImplTest(); |
| 1367 // runJUnitTest(__test, __test.test_applyChanges_empty); |
| 1368 // }); |
| 1369 // _ut.test('test_applyChanges_overriddenSource', () { |
| 1370 // final __test = new AnalysisContextImplTest(); |
| 1371 // runJUnitTest(__test, __test.test_applyChanges_overriddenSource); |
| 1372 // }); |
| 1373 // _ut.test('test_applyChanges_remove', () { |
| 1374 // final __test = new AnalysisContextImplTest(); |
| 1375 // runJUnitTest(__test, __test.test_applyChanges_remove); |
| 1376 // }); |
| 1377 // _ut.test('test_applyChanges_removeContainer', () { |
| 1378 // final __test = new AnalysisContextImplTest(); |
| 1379 // runJUnitTest(__test, __test.test_applyChanges_removeContainer); |
| 1380 // }); |
| 1381 // _ut.test('test_computeDocumentationComment_block', () { |
| 1382 // final __test = new AnalysisContextImplTest(); |
| 1383 // runJUnitTest(__test, __test.test_computeDocumentationComment_block); |
| 1384 // }); |
| 1385 // _ut.test('test_computeDocumentationComment_none', () { |
| 1386 // final __test = new AnalysisContextImplTest(); |
| 1387 // runJUnitTest(__test, __test.test_computeDocumentationComment_none); |
| 1388 // }); |
| 1389 // _ut.test('test_computeDocumentationComment_null', () { |
| 1390 // final __test = new AnalysisContextImplTest(); |
| 1391 // runJUnitTest(__test, __test.test_computeDocumentationComment_null); |
| 1392 // }); |
| 1393 // _ut.test('test_computeDocumentationComment_singleLine_multiple_EOL_n',
() { |
| 1394 // final __test = new AnalysisContextImplTest(); |
| 1395 // runJUnitTest(__test, __test.test_computeDocumentationComment_singleLi
ne_multiple_EOL_n); |
| 1396 // }); |
| 1397 // _ut.test('test_computeDocumentationComment_singleLine_multiple_EOL_rn',
() { |
| 1398 // final __test = new AnalysisContextImplTest(); |
| 1399 // runJUnitTest(__test, __test.test_computeDocumentationComment_singleLi
ne_multiple_EOL_rn); |
| 1400 // }); |
| 1401 // _ut.test('test_computeErrors_dart_none', () { |
| 1402 // final __test = new AnalysisContextImplTest(); |
| 1403 // runJUnitTest(__test, __test.test_computeErrors_dart_none); |
| 1404 // }); |
| 1405 // _ut.test('test_computeErrors_dart_part', () { |
| 1406 // final __test = new AnalysisContextImplTest(); |
| 1407 // runJUnitTest(__test, __test.test_computeErrors_dart_part); |
| 1408 // }); |
| 1409 // _ut.test('test_computeErrors_dart_some', () { |
| 1410 // final __test = new AnalysisContextImplTest(); |
| 1411 // runJUnitTest(__test, __test.test_computeErrors_dart_some); |
| 1412 // }); |
| 1413 // _ut.test('test_computeErrors_html_none', () { |
| 1414 // final __test = new AnalysisContextImplTest(); |
| 1415 // runJUnitTest(__test, __test.test_computeErrors_html_none); |
| 1416 // }); |
| 1417 // _ut.test('test_computeExportedLibraries_none', () { |
| 1418 // final __test = new AnalysisContextImplTest(); |
| 1419 // runJUnitTest(__test, __test.test_computeExportedLibraries_none); |
| 1420 // }); |
| 1421 // _ut.test('test_computeExportedLibraries_some', () { |
| 1422 // final __test = new AnalysisContextImplTest(); |
| 1423 // runJUnitTest(__test, __test.test_computeExportedLibraries_some); |
| 1424 // }); |
| 1425 // _ut.test('test_computeHtmlElement_nonHtml', () { |
| 1426 // final __test = new AnalysisContextImplTest(); |
| 1427 // runJUnitTest(__test, __test.test_computeHtmlElement_nonHtml); |
| 1428 // }); |
| 1429 // _ut.test('test_computeHtmlElement_valid', () { |
| 1430 // final __test = new AnalysisContextImplTest(); |
| 1431 // runJUnitTest(__test, __test.test_computeHtmlElement_valid); |
| 1432 // }); |
| 1433 // _ut.test('test_computeImportedLibraries_none', () { |
| 1434 // final __test = new AnalysisContextImplTest(); |
| 1435 // runJUnitTest(__test, __test.test_computeImportedLibraries_none); |
| 1436 // }); |
| 1437 // _ut.test('test_computeImportedLibraries_some', () { |
| 1438 // final __test = new AnalysisContextImplTest(); |
| 1439 // runJUnitTest(__test, __test.test_computeImportedLibraries_some); |
| 1440 // }); |
| 1441 // _ut.test('test_computeKindOf_html', () { |
| 1442 // final __test = new AnalysisContextImplTest(); |
| 1443 // runJUnitTest(__test, __test.test_computeKindOf_html); |
| 1444 // }); |
| 1445 // _ut.test('test_computeKindOf_library', () { |
| 1446 // final __test = new AnalysisContextImplTest(); |
| 1447 // runJUnitTest(__test, __test.test_computeKindOf_library); |
| 1448 // }); |
| 1449 // _ut.test('test_computeKindOf_libraryAndPart', () { |
| 1450 // final __test = new AnalysisContextImplTest(); |
| 1451 // runJUnitTest(__test, __test.test_computeKindOf_libraryAndPart); |
| 1452 // }); |
| 1453 // _ut.test('test_computeKindOf_part', () { |
| 1454 // final __test = new AnalysisContextImplTest(); |
| 1455 // runJUnitTest(__test, __test.test_computeKindOf_part); |
| 1456 // }); |
| 1457 // _ut.test('test_computeLibraryElement', () { |
| 1458 // final __test = new AnalysisContextImplTest(); |
| 1459 // runJUnitTest(__test, __test.test_computeLibraryElement); |
| 1460 // }); |
| 1461 // _ut.test('test_computeLineInfo_dart', () { |
| 1462 // final __test = new AnalysisContextImplTest(); |
| 1463 // runJUnitTest(__test, __test.test_computeLineInfo_dart); |
| 1464 // }); |
| 1465 // _ut.test('test_computeLineInfo_html', () { |
| 1466 // final __test = new AnalysisContextImplTest(); |
| 1467 // runJUnitTest(__test, __test.test_computeLineInfo_html); |
| 1468 // }); |
| 1469 // _ut.test('test_computeResolvableCompilationUnit_exception', () { |
| 1470 // final __test = new AnalysisContextImplTest(); |
| 1471 // runJUnitTest(__test, __test.test_computeResolvableCompilationUnit_exc
eption); |
| 1472 // }); |
| 1473 // _ut.test('test_computeResolvableCompilationUnit_html', () { |
| 1474 // final __test = new AnalysisContextImplTest(); |
| 1475 // runJUnitTest(__test, __test.test_computeResolvableCompilationUnit_htm
l); |
| 1476 // }); |
| 1477 // _ut.test('test_computeResolvableCompilationUnit_valid', () { |
| 1478 // final __test = new AnalysisContextImplTest(); |
| 1479 // runJUnitTest(__test, __test.test_computeResolvableCompilationUnit_val
id); |
| 1480 // }); |
| 1481 // _ut.test('test_dispose', () { |
| 1482 // final __test = new AnalysisContextImplTest(); |
| 1483 // runJUnitTest(__test, __test.test_dispose); |
| 1484 // }); |
| 1485 // _ut.test('test_exists_false', () { |
| 1486 // final __test = new AnalysisContextImplTest(); |
| 1487 // runJUnitTest(__test, __test.test_exists_false); |
| 1488 // }); |
| 1489 // _ut.test('test_exists_null', () { |
| 1490 // final __test = new AnalysisContextImplTest(); |
| 1491 // runJUnitTest(__test, __test.test_exists_null); |
| 1492 // }); |
| 1493 // _ut.test('test_exists_overridden', () { |
| 1494 // final __test = new AnalysisContextImplTest(); |
| 1495 // runJUnitTest(__test, __test.test_exists_overridden); |
| 1496 // }); |
| 1497 // _ut.test('test_exists_true', () { |
| 1498 // final __test = new AnalysisContextImplTest(); |
| 1499 // runJUnitTest(__test, __test.test_exists_true); |
| 1500 // }); |
| 1501 // _ut.test('test_getAnalysisOptions', () { |
| 1502 // final __test = new AnalysisContextImplTest(); |
| 1503 // runJUnitTest(__test, __test.test_getAnalysisOptions); |
| 1504 // }); |
| 1505 // _ut.test('test_getContents_fromSource', () { |
| 1506 // final __test = new AnalysisContextImplTest(); |
| 1507 // runJUnitTest(__test, __test.test_getContents_fromSource); |
| 1508 // }); |
| 1509 // _ut.test('test_getContents_overridden', () { |
| 1510 // final __test = new AnalysisContextImplTest(); |
| 1511 // runJUnitTest(__test, __test.test_getContents_overridden); |
| 1512 // }); |
| 1513 // _ut.test('test_getContents_unoverridden', () { |
| 1514 // final __test = new AnalysisContextImplTest(); |
| 1515 // runJUnitTest(__test, __test.test_getContents_unoverridden); |
| 1516 // }); |
| 1517 // _ut.test('test_getDeclaredVariables', () { |
| 1518 // final __test = new AnalysisContextImplTest(); |
| 1519 // runJUnitTest(__test, __test.test_getDeclaredVariables); |
| 1520 // }); |
| 1521 // _ut.test('test_getElement', () { |
| 1522 // final __test = new AnalysisContextImplTest(); |
| 1523 // runJUnitTest(__test, __test.test_getElement); |
| 1524 // }); |
| 1525 // _ut.test('test_getElement_constructor_named', () { |
| 1526 // final __test = new AnalysisContextImplTest(); |
| 1527 // runJUnitTest(__test, __test.test_getElement_constructor_named); |
| 1528 // }); |
| 1529 // _ut.test('test_getElement_constructor_unnamed', () { |
| 1530 // final __test = new AnalysisContextImplTest(); |
| 1531 // runJUnitTest(__test, __test.test_getElement_constructor_unnamed); |
| 1532 // }); |
| 1533 // _ut.test('test_getErrors_dart_none', () { |
| 1534 // final __test = new AnalysisContextImplTest(); |
| 1535 // runJUnitTest(__test, __test.test_getErrors_dart_none); |
| 1536 // }); |
| 1537 // _ut.test('test_getErrors_dart_some', () { |
| 1538 // final __test = new AnalysisContextImplTest(); |
| 1539 // runJUnitTest(__test, __test.test_getErrors_dart_some); |
| 1540 // }); |
| 1541 // _ut.test('test_getErrors_html_none', () { |
| 1542 // final __test = new AnalysisContextImplTest(); |
| 1543 // runJUnitTest(__test, __test.test_getErrors_html_none); |
| 1544 // }); |
| 1545 // _ut.test('test_getErrors_html_some', () { |
| 1546 // final __test = new AnalysisContextImplTest(); |
| 1547 // runJUnitTest(__test, __test.test_getErrors_html_some); |
| 1548 // }); |
| 1549 // _ut.test('test_getHtmlElement_dart', () { |
| 1550 // final __test = new AnalysisContextImplTest(); |
| 1551 // runJUnitTest(__test, __test.test_getHtmlElement_dart); |
| 1552 // }); |
| 1553 // _ut.test('test_getHtmlElement_html', () { |
| 1554 // final __test = new AnalysisContextImplTest(); |
| 1555 // runJUnitTest(__test, __test.test_getHtmlElement_html); |
| 1556 // }); |
| 1557 // _ut.test('test_getHtmlFilesReferencing_html', () { |
| 1558 // final __test = new AnalysisContextImplTest(); |
| 1559 // runJUnitTest(__test, __test.test_getHtmlFilesReferencing_html); |
| 1560 // }); |
| 1561 // _ut.test('test_getHtmlFilesReferencing_library', () { |
| 1562 // final __test = new AnalysisContextImplTest(); |
| 1563 // runJUnitTest(__test, __test.test_getHtmlFilesReferencing_library); |
| 1564 // }); |
| 1565 // _ut.test('test_getHtmlFilesReferencing_part', () { |
| 1566 // final __test = new AnalysisContextImplTest(); |
| 1567 // runJUnitTest(__test, __test.test_getHtmlFilesReferencing_part); |
| 1568 // }); |
| 1569 // _ut.test('test_getHtmlSources', () { |
| 1570 // final __test = new AnalysisContextImplTest(); |
| 1571 // runJUnitTest(__test, __test.test_getHtmlSources); |
| 1572 // }); |
| 1573 // _ut.test('test_getKindOf_html', () { |
| 1574 // final __test = new AnalysisContextImplTest(); |
| 1575 // runJUnitTest(__test, __test.test_getKindOf_html); |
| 1576 // }); |
| 1577 // _ut.test('test_getKindOf_library', () { |
| 1578 // final __test = new AnalysisContextImplTest(); |
| 1579 // runJUnitTest(__test, __test.test_getKindOf_library); |
| 1580 // }); |
| 1581 // _ut.test('test_getKindOf_part', () { |
| 1582 // final __test = new AnalysisContextImplTest(); |
| 1583 // runJUnitTest(__test, __test.test_getKindOf_part); |
| 1584 // }); |
| 1585 // _ut.test('test_getKindOf_unknown', () { |
| 1586 // final __test = new AnalysisContextImplTest(); |
| 1587 // runJUnitTest(__test, __test.test_getKindOf_unknown); |
| 1588 // }); |
| 1589 // _ut.test('test_getLaunchableClientLibrarySources', () { |
| 1590 // final __test = new AnalysisContextImplTest(); |
| 1591 // runJUnitTest(__test, __test.test_getLaunchableClientLibrarySources); |
| 1592 // }); |
| 1593 // _ut.test('test_getLaunchableServerLibrarySources', () { |
| 1594 // final __test = new AnalysisContextImplTest(); |
| 1595 // runJUnitTest(__test, __test.test_getLaunchableServerLibrarySources); |
| 1596 // }); |
| 1597 // _ut.test('test_getLibrariesContaining', () { |
| 1598 // final __test = new AnalysisContextImplTest(); |
| 1599 // runJUnitTest(__test, __test.test_getLibrariesContaining); |
| 1600 // }); |
| 1601 // _ut.test('test_getLibrariesDependingOn', () { |
| 1602 // final __test = new AnalysisContextImplTest(); |
| 1603 // runJUnitTest(__test, __test.test_getLibrariesDependingOn); |
| 1604 // }); |
| 1605 // _ut.test('test_getLibrariesReferencedFromHtml', () { |
| 1606 // final __test = new AnalysisContextImplTest(); |
| 1607 // runJUnitTest(__test, __test.test_getLibrariesReferencedFromHtml); |
| 1608 // }); |
| 1609 // _ut.test('test_getLibrariesReferencedFromHtml_no', () { |
| 1610 // final __test = new AnalysisContextImplTest(); |
| 1611 // runJUnitTest(__test, __test.test_getLibrariesReferencedFromHtml_no); |
| 1612 // }); |
| 1613 // _ut.test('test_getLibraryElement', () { |
| 1614 // final __test = new AnalysisContextImplTest(); |
| 1615 // runJUnitTest(__test, __test.test_getLibraryElement); |
| 1616 // }); |
| 1617 // _ut.test('test_getLibrarySources', () { |
| 1618 // final __test = new AnalysisContextImplTest(); |
| 1619 // runJUnitTest(__test, __test.test_getLibrarySources); |
| 1620 // }); |
| 1621 // _ut.test('test_getLineInfo', () { |
| 1622 // final __test = new AnalysisContextImplTest(); |
| 1623 // runJUnitTest(__test, __test.test_getLineInfo); |
| 1624 // }); |
| 1625 // _ut.test('test_getModificationStamp_fromSource', () { |
| 1626 // final __test = new AnalysisContextImplTest(); |
| 1627 // runJUnitTest(__test, __test.test_getModificationStamp_fromSource); |
| 1628 // }); |
| 1629 // _ut.test('test_getModificationStamp_overridden', () { |
| 1630 // final __test = new AnalysisContextImplTest(); |
| 1631 // runJUnitTest(__test, __test.test_getModificationStamp_overridden); |
| 1632 // }); |
| 1633 // _ut.test('test_getPublicNamespace_element', () { |
| 1634 // final __test = new AnalysisContextImplTest(); |
| 1635 // runJUnitTest(__test, __test.test_getPublicNamespace_element); |
| 1636 // }); |
| 1637 // _ut.test('test_getRefactoringUnsafeSources', () { |
| 1638 // final __test = new AnalysisContextImplTest(); |
| 1639 // runJUnitTest(__test, __test.test_getRefactoringUnsafeSources); |
| 1640 // }); |
| 1641 // _ut.test('test_getResolvedCompilationUnit_library', () { |
| 1642 // final __test = new AnalysisContextImplTest(); |
| 1643 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_library); |
| 1644 // }); |
| 1645 // _ut.test('test_getResolvedCompilationUnit_library_null', () { |
| 1646 // final __test = new AnalysisContextImplTest(); |
| 1647 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_library_n
ull); |
| 1648 // }); |
| 1649 // _ut.test('test_getResolvedCompilationUnit_source_dart', () { |
| 1650 // final __test = new AnalysisContextImplTest(); |
| 1651 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_source_da
rt); |
| 1652 // }); |
| 1653 // _ut.test('test_getResolvedCompilationUnit_source_html', () { |
| 1654 // final __test = new AnalysisContextImplTest(); |
| 1655 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_source_ht
ml); |
| 1656 // }); |
| 1657 // _ut.test('test_getResolvedHtmlUnit', () { |
| 1658 // final __test = new AnalysisContextImplTest(); |
| 1659 // runJUnitTest(__test, __test.test_getResolvedHtmlUnit); |
| 1660 // }); |
| 1661 // _ut.test('test_getSourceFactory', () { |
| 1662 // final __test = new AnalysisContextImplTest(); |
| 1663 // runJUnitTest(__test, __test.test_getSourceFactory); |
| 1664 // }); |
| 1665 // _ut.test('test_getStatistics', () { |
| 1666 // final __test = new AnalysisContextImplTest(); |
| 1667 // runJUnitTest(__test, __test.test_getStatistics); |
| 1668 // }); |
| 1669 // _ut.test('test_isClientLibrary_dart', () { |
| 1670 // final __test = new AnalysisContextImplTest(); |
| 1671 // runJUnitTest(__test, __test.test_isClientLibrary_dart); |
| 1672 // }); |
| 1673 // _ut.test('test_isClientLibrary_html', () { |
| 1674 // final __test = new AnalysisContextImplTest(); |
| 1675 // runJUnitTest(__test, __test.test_isClientLibrary_html); |
| 1676 // }); |
| 1677 // _ut.test('test_isServerLibrary_dart', () { |
| 1678 // final __test = new AnalysisContextImplTest(); |
| 1679 // runJUnitTest(__test, __test.test_isServerLibrary_dart); |
| 1680 // }); |
| 1681 // _ut.test('test_isServerLibrary_html', () { |
| 1682 // final __test = new AnalysisContextImplTest(); |
| 1683 // runJUnitTest(__test, __test.test_isServerLibrary_html); |
| 1684 // }); |
| 1685 // _ut.test('test_parseCompilationUnit_errors', () { |
| 1686 // final __test = new AnalysisContextImplTest(); |
| 1687 // runJUnitTest(__test, __test.test_parseCompilationUnit_errors); |
| 1688 // }); |
| 1689 // _ut.test('test_parseCompilationUnit_exception', () { |
| 1690 // final __test = new AnalysisContextImplTest(); |
| 1691 // runJUnitTest(__test, __test.test_parseCompilationUnit_exception); |
| 1692 // }); |
| 1693 // _ut.test('test_parseCompilationUnit_html', () { |
| 1694 // final __test = new AnalysisContextImplTest(); |
| 1695 // runJUnitTest(__test, __test.test_parseCompilationUnit_html); |
| 1696 // }); |
| 1697 // _ut.test('test_parseCompilationUnit_noErrors', () { |
| 1698 // final __test = new AnalysisContextImplTest(); |
| 1699 // runJUnitTest(__test, __test.test_parseCompilationUnit_noErrors); |
| 1700 // }); |
| 1701 // _ut.test('test_parseCompilationUnit_nonExistentSource', () { |
| 1702 // final __test = new AnalysisContextImplTest(); |
| 1703 // runJUnitTest(__test, __test.test_parseCompilationUnit_nonExistentSour
ce); |
| 1704 // }); |
| 1705 // _ut.test('test_parseHtmlUnit_noErrors', () { |
| 1706 // final __test = new AnalysisContextImplTest(); |
| 1707 // runJUnitTest(__test, __test.test_parseHtmlUnit_noErrors); |
| 1708 // }); |
| 1709 // _ut.test('test_parseHtmlUnit_resolveDirectives', () { |
| 1710 // final __test = new AnalysisContextImplTest(); |
| 1711 // runJUnitTest(__test, __test.test_parseHtmlUnit_resolveDirectives); |
| 1712 // }); |
| 1713 // _ut.test('test_performAnalysisTask_IOException', () { |
| 1714 // final __test = new AnalysisContextImplTest(); |
| 1715 // runJUnitTest(__test, __test.test_performAnalysisTask_IOException); |
| 1716 // }); |
| 1717 // _ut.test('test_performAnalysisTask_addPart', () { |
| 1718 // final __test = new AnalysisContextImplTest(); |
| 1719 // runJUnitTest(__test, __test.test_performAnalysisTask_addPart); |
| 1720 // }); |
| 1721 // _ut.test('test_performAnalysisTask_changeLibraryContents', () { |
| 1722 // final __test = new AnalysisContextImplTest(); |
| 1723 // runJUnitTest(__test, __test.test_performAnalysisTask_changeLibraryCon
tents); |
| 1724 // }); |
| 1725 // _ut.test('test_performAnalysisTask_changeLibraryThenPartContents', () { |
| 1726 // final __test = new AnalysisContextImplTest(); |
| 1727 // runJUnitTest(__test, __test.test_performAnalysisTask_changeLibraryThe
nPartContents); |
| 1728 // }); |
| 1729 // _ut.test('test_performAnalysisTask_changePartContents_makeItAPart', ()
{ |
| 1730 // final __test = new AnalysisContextImplTest(); |
| 1731 // runJUnitTest(__test, __test.test_performAnalysisTask_changePartConten
ts_makeItAPart); |
| 1732 // }); |
| 1733 // _ut.test('test_performAnalysisTask_changePartContents_makeItNotPart', (
) { |
| 1734 // final __test = new AnalysisContextImplTest(); |
| 1735 // runJUnitTest(__test, __test.test_performAnalysisTask_changePartConten
ts_makeItNotPart); |
| 1736 // }); |
| 1737 // _ut.test('test_performAnalysisTask_changePartContents_noSemanticChanges
', () { |
| 1738 // final __test = new AnalysisContextImplTest(); |
| 1739 // runJUnitTest(__test, __test.test_performAnalysisTask_changePartConten
ts_noSemanticChanges); |
| 1740 // }); |
| 1741 // _ut.test('test_performAnalysisTask_importedLibraryAdd', () { |
| 1742 // final __test = new AnalysisContextImplTest(); |
| 1743 // runJUnitTest(__test, __test.test_performAnalysisTask_importedLibraryA
dd); |
| 1744 // }); |
| 1745 // _ut.test('test_performAnalysisTask_importedLibraryAdd_html', () { |
| 1746 // final __test = new AnalysisContextImplTest(); |
| 1747 // runJUnitTest(__test, __test.test_performAnalysisTask_importedLibraryA
dd_html); |
| 1748 // }); |
| 1749 // _ut.test('test_performAnalysisTask_importedLibraryDelete', () { |
| 1750 // final __test = new AnalysisContextImplTest(); |
| 1751 // runJUnitTest(__test, __test.test_performAnalysisTask_importedLibraryD
elete); |
| 1752 // }); |
| 1753 // _ut.test('test_performAnalysisTask_missingPart', () { |
| 1754 // final __test = new AnalysisContextImplTest(); |
| 1755 // runJUnitTest(__test, __test.test_performAnalysisTask_missingPart); |
| 1756 // }); |
| 1757 // _ut.test('test_performAnalysisTask_modifiedAfterParse', () { |
| 1758 // final __test = new AnalysisContextImplTest(); |
| 1759 // runJUnitTest(__test, __test.test_performAnalysisTask_modifiedAfterPar
se); |
| 1760 // }); |
| 1761 // _ut.test('test_resolveCompilationUnit_library', () { |
| 1762 // final __test = new AnalysisContextImplTest(); |
| 1763 // runJUnitTest(__test, __test.test_resolveCompilationUnit_library); |
| 1764 // }); |
| 1765 // _ut.test('test_resolveCompilationUnit_source', () { |
| 1766 // final __test = new AnalysisContextImplTest(); |
| 1767 // runJUnitTest(__test, __test.test_resolveCompilationUnit_source); |
| 1768 // }); |
| 1769 // _ut.test('test_resolveCompilationUnit_sourceChangeDuringResolution', ()
{ |
| 1770 // final __test = new AnalysisContextImplTest(); |
| 1771 // runJUnitTest(__test, __test.test_resolveCompilationUnit_sourceChangeD
uringResolution); |
| 1772 // }); |
| 1773 // _ut.test('test_resolveHtmlUnit', () { |
| 1774 // final __test = new AnalysisContextImplTest(); |
| 1775 // runJUnitTest(__test, __test.test_resolveHtmlUnit); |
| 1776 // }); |
| 1777 // _ut.test('test_setAnalysisOptions', () { |
| 1778 // final __test = new AnalysisContextImplTest(); |
| 1779 // runJUnitTest(__test, __test.test_setAnalysisOptions); |
| 1780 // }); |
| 1781 // _ut.test('test_setAnalysisOptions_reduceAnalysisPriorityOrder', () { |
| 1782 // final __test = new AnalysisContextImplTest(); |
| 1783 // runJUnitTest(__test, __test.test_setAnalysisOptions_reduceAnalysisPri
orityOrder); |
| 1784 // }); |
| 1785 // _ut.test('test_setAnalysisPriorityOrder_empty', () { |
| 1786 // final __test = new AnalysisContextImplTest(); |
| 1787 // runJUnitTest(__test, __test.test_setAnalysisPriorityOrder_empty); |
| 1788 // }); |
| 1789 // _ut.test('test_setAnalysisPriorityOrder_lessThanCacheSize', () { |
| 1790 // final __test = new AnalysisContextImplTest(); |
| 1791 // runJUnitTest(__test, __test.test_setAnalysisPriorityOrder_lessThanCac
heSize); |
| 1792 // }); |
| 1793 // _ut.test('test_setAnalysisPriorityOrder_nonEmpty', () { |
| 1794 // final __test = new AnalysisContextImplTest(); |
| 1795 // runJUnitTest(__test, __test.test_setAnalysisPriorityOrder_nonEmpty); |
| 1796 // }); |
| 1797 // _ut.test('test_setChangedContents_libraryWithPart', () { |
| 1798 // final __test = new AnalysisContextImplTest(); |
| 1799 // runJUnitTest(__test, __test.test_setChangedContents_libraryWithPart); |
| 1800 // }); |
| 1801 // _ut.test('test_setChangedContents_notResolved', () { |
| 1802 // final __test = new AnalysisContextImplTest(); |
| 1803 // runJUnitTest(__test, __test.test_setChangedContents_notResolved); |
| 1804 // }); |
| 1805 // _ut.test('test_setContents_libraryWithPart', () { |
| 1806 // final __test = new AnalysisContextImplTest(); |
| 1807 // runJUnitTest(__test, __test.test_setContents_libraryWithPart); |
| 1808 // }); |
| 1809 // _ut.test('test_setContents_null', () { |
| 1810 // final __test = new AnalysisContextImplTest(); |
| 1811 // runJUnitTest(__test, __test.test_setContents_null); |
| 1812 // }); |
| 1813 // _ut.test('test_setSourceFactory', () { |
| 1814 // final __test = new AnalysisContextImplTest(); |
| 1815 // runJUnitTest(__test, __test.test_setSourceFactory); |
| 1816 // }); |
| 1817 // _ut.test('test_unreadableSource', () { |
| 1818 // final __test = new AnalysisContextImplTest(); |
| 1819 // runJUnitTest(__test, __test.test_unreadableSource); |
| 1820 // }); |
| 1821 // _ut.test('test_updateAnalysis', () { |
| 1822 // final __test = new AnalysisContextImplTest(); |
| 1823 // runJUnitTest(__test, __test.test_updateAnalysis); |
| 1824 // }); |
| 1825 // }); |
| 1826 // } |
| 1827 // } |
| 1828 // class AnalysisContextImpl_AnalysisContextImplTest_test_resolveCompilationUnit
_sourceChangeDuringResolution extends AnalysisContextImpl { |
| 1829 // @override |
| 1830 // DartEntry recordResolveDartLibraryTaskResults(ResolveDartLibraryTask task)
{ |
| 1831 // ChangeSet changeSet = new ChangeSet(); |
| 1832 // changeSet.changedSource(task.librarySource); |
| 1833 // applyChanges(changeSet); |
| 1834 // return super.recordResolveDartLibraryTaskResults(task); |
| 1835 // } |
| 1836 // } |
| 1837 // class AnalysisOptionsImplTest extends EngineTestCase { |
| 1838 // void test_AnalysisOptionsImpl_copy() { |
| 1839 // bool booleanValue = true; |
| 1840 // for (int i = 0; i < 2; i++, booleanValue = !booleanValue) { |
| 1841 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1842 // options.analyzeAngular = booleanValue; |
| 1843 // options.analyzeFunctionBodies = booleanValue; |
| 1844 // options.analyzePolymer = booleanValue; |
| 1845 // options.cacheSize = i; |
| 1846 // options.dart2jsHint = booleanValue; |
| 1847 // options.enableDeferredLoading = booleanValue; |
| 1848 // options.generateSdkErrors = booleanValue; |
| 1849 // options.hint = booleanValue; |
| 1850 // options.incremental = booleanValue; |
| 1851 // options.preserveComments = booleanValue; |
| 1852 // AnalysisOptionsImpl copy = new AnalysisOptionsImpl.con1(options); |
| 1853 // JUnitTestCase.assertEquals(options.analyzeAngular, copy.analyzeAngular)
; |
| 1854 // JUnitTestCase.assertEquals(options.analyzeFunctionBodies, copy.analyzeF
unctionBodies); |
| 1855 // JUnitTestCase.assertEquals(options.analyzePolymer, copy.analyzePolymer)
; |
| 1856 // JUnitTestCase.assertEquals(options.cacheSize, copy.cacheSize); |
| 1857 // JUnitTestCase.assertEquals(options.dart2jsHint, copy.dart2jsHint); |
| 1858 // JUnitTestCase.assertEquals(options.enableAsync, copy.enableAsync); |
| 1859 // JUnitTestCase.assertEquals(options.enableDeferredLoading, copy.enableDe
ferredLoading); |
| 1860 // JUnitTestCase.assertEquals(options.enableEnum, copy.enableEnum); |
| 1861 // JUnitTestCase.assertEquals(options.generateSdkErrors, copy.generateSdkE
rrors); |
| 1862 // JUnitTestCase.assertEquals(options.hint, copy.hint); |
| 1863 // JUnitTestCase.assertEquals(options.incremental, copy.incremental); |
| 1864 // JUnitTestCase.assertEquals(options.preserveComments, copy.preserveComme
nts); |
| 1865 // } |
| 1866 // } |
| 1867 // void test_getAnalyzeAngular() { |
| 1868 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1869 // bool value = !options.analyzeAngular; |
| 1870 // options.analyzeAngular = value; |
| 1871 // JUnitTestCase.assertEquals(value, options.analyzeAngular); |
| 1872 // } |
| 1873 // void test_getAnalyzeFunctionBodies() { |
| 1874 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1875 // bool value = !options.analyzeFunctionBodies; |
| 1876 // options.analyzeFunctionBodies = value; |
| 1877 // JUnitTestCase.assertEquals(value, options.analyzeFunctionBodies); |
| 1878 // } |
| 1879 // void test_getAnalyzePolymer() { |
| 1880 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1881 // bool value = !options.analyzePolymer; |
| 1882 // options.analyzePolymer = value; |
| 1883 // JUnitTestCase.assertEquals(value, options.analyzePolymer); |
| 1884 // } |
| 1885 // void test_getCacheSize() { |
| 1886 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1887 // JUnitTestCase.assertEquals(AnalysisOptionsImpl.DEFAULT_CACHE_SIZE, option
s.cacheSize); |
| 1888 // int value = options.cacheSize + 1; |
| 1889 // options.cacheSize = value; |
| 1890 // JUnitTestCase.assertEquals(value, options.cacheSize); |
| 1891 // } |
| 1892 // void test_getDart2jsHint() { |
| 1893 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1894 // bool value = !options.dart2jsHint; |
| 1895 // options.dart2jsHint = value; |
| 1896 // JUnitTestCase.assertEquals(value, options.dart2jsHint); |
| 1897 // } |
| 1898 // void test_getEnableAsync() { |
| 1899 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1900 // JUnitTestCase.assertEquals(AnalysisOptionsImpl.DEFAULT_ENABLE_ASYNC, opti
ons.enableAsync); |
| 1901 // bool value = !options.enableAsync; |
| 1902 // options.enableAsync = value; |
| 1903 // JUnitTestCase.assertEquals(value, options.enableAsync); |
| 1904 // } |
| 1905 // void test_getEnableDeferredLoading() { |
| 1906 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1907 // JUnitTestCase.assertEquals(AnalysisOptionsImpl.DEFAULT_ENABLE_DEFERRED_LO
ADING, options.enableDeferredLoading); |
| 1908 // bool value = !options.enableDeferredLoading; |
| 1909 // options.enableDeferredLoading = value; |
| 1910 // JUnitTestCase.assertEquals(value, options.enableDeferredLoading); |
| 1911 // } |
| 1912 // void test_getEnableEnum() { |
| 1913 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1914 // JUnitTestCase.assertEquals(AnalysisOptionsImpl.DEFAULT_ENABLE_ENUM, optio
ns.enableEnum); |
| 1915 // bool value = !options.enableEnum; |
| 1916 // options.enableEnum = value; |
| 1917 // JUnitTestCase.assertEquals(value, options.enableEnum); |
| 1918 // } |
| 1919 // void test_getGenerateSdkErrors() { |
| 1920 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1921 // bool value = !options.generateSdkErrors; |
| 1922 // options.generateSdkErrors = value; |
| 1923 // JUnitTestCase.assertEquals(value, options.generateSdkErrors); |
| 1924 // } |
| 1925 // void test_getHint() { |
| 1926 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1927 // bool value = !options.hint; |
| 1928 // options.hint = value; |
| 1929 // JUnitTestCase.assertEquals(value, options.hint); |
| 1930 // } |
| 1931 // void test_getIncremental() { |
| 1932 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1933 // bool value = !options.incremental; |
| 1934 // options.incremental = value; |
| 1935 // JUnitTestCase.assertEquals(value, options.incremental); |
| 1936 // } |
| 1937 // void test_getPreserveComments() { |
| 1938 // AnalysisOptionsImpl options = new AnalysisOptionsImpl(); |
| 1939 // bool value = !options.preserveComments; |
| 1940 // options.preserveComments = value; |
| 1941 // JUnitTestCase.assertEquals(value, options.preserveComments); |
| 1942 // } |
| 1943 // static dartSuite() { |
| 1944 // _ut.group('AnalysisOptionsImplTest', () { |
| 1945 // _ut.test('test_AnalysisOptionsImpl_copy', () { |
| 1946 // final __test = new AnalysisOptionsImplTest(); |
| 1947 // runJUnitTest(__test, __test.test_AnalysisOptionsImpl_copy); |
| 1948 // }); |
| 1949 // _ut.test('test_getAnalyzeAngular', () { |
| 1950 // final __test = new AnalysisOptionsImplTest(); |
| 1951 // runJUnitTest(__test, __test.test_getAnalyzeAngular); |
| 1952 // }); |
| 1953 // _ut.test('test_getAnalyzeFunctionBodies', () { |
| 1954 // final __test = new AnalysisOptionsImplTest(); |
| 1955 // runJUnitTest(__test, __test.test_getAnalyzeFunctionBodies); |
| 1956 // }); |
| 1957 // _ut.test('test_getAnalyzePolymer', () { |
| 1958 // final __test = new AnalysisOptionsImplTest(); |
| 1959 // runJUnitTest(__test, __test.test_getAnalyzePolymer); |
| 1960 // }); |
| 1961 // _ut.test('test_getCacheSize', () { |
| 1962 // final __test = new AnalysisOptionsImplTest(); |
| 1963 // runJUnitTest(__test, __test.test_getCacheSize); |
| 1964 // }); |
| 1965 // _ut.test('test_getDart2jsHint', () { |
| 1966 // final __test = new AnalysisOptionsImplTest(); |
| 1967 // runJUnitTest(__test, __test.test_getDart2jsHint); |
| 1968 // }); |
| 1969 // _ut.test('test_getEnableAsync', () { |
| 1970 // final __test = new AnalysisOptionsImplTest(); |
| 1971 // runJUnitTest(__test, __test.test_getEnableAsync); |
| 1972 // }); |
| 1973 // _ut.test('test_getEnableDeferredLoading', () { |
| 1974 // final __test = new AnalysisOptionsImplTest(); |
| 1975 // runJUnitTest(__test, __test.test_getEnableDeferredLoading); |
| 1976 // }); |
| 1977 // _ut.test('test_getEnableEnum', () { |
| 1978 // final __test = new AnalysisOptionsImplTest(); |
| 1979 // runJUnitTest(__test, __test.test_getEnableEnum); |
| 1980 // }); |
| 1981 // _ut.test('test_getGenerateSdkErrors', () { |
| 1982 // final __test = new AnalysisOptionsImplTest(); |
| 1983 // runJUnitTest(__test, __test.test_getGenerateSdkErrors); |
| 1984 // }); |
| 1985 // _ut.test('test_getHint', () { |
| 1986 // final __test = new AnalysisOptionsImplTest(); |
| 1987 // runJUnitTest(__test, __test.test_getHint); |
| 1988 // }); |
| 1989 // _ut.test('test_getIncremental', () { |
| 1990 // final __test = new AnalysisOptionsImplTest(); |
| 1991 // runJUnitTest(__test, __test.test_getIncremental); |
| 1992 // }); |
| 1993 // _ut.test('test_getPreserveComments', () { |
| 1994 // final __test = new AnalysisOptionsImplTest(); |
| 1995 // runJUnitTest(__test, __test.test_getPreserveComments); |
| 1996 // }); |
| 1997 // }); |
| 1998 // } |
| 1999 // } |
| 2000 // class AnalysisTaskTest extends EngineTestCase { |
| 2001 // void test_perform_exception() { |
| 2002 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 2003 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 2004 // AnalysisTask task = new AnalysisTask_AnalysisTaskTest_test_perform_except
ion(context); |
| 2005 // task.perform(new TestTaskVisitor<Object>()); |
| 2006 // } |
| 2007 // static dartSuite() { |
| 2008 // _ut.group('AnalysisTaskTest', () { |
| 2009 // _ut.test('test_perform_exception', () { |
| 2010 // final __test = new AnalysisTaskTest(); |
| 2011 // runJUnitTest(__test, __test.test_perform_exception); |
| 2012 // }); |
| 2013 // }); |
| 2014 // } |
| 2015 // } |
| 2016 // class AnalysisTask_AnalysisTaskTest_test_perform_exception extends AnalysisTa
sk { |
| 2017 // AnalysisTask_AnalysisTaskTest_test_perform_exception(InternalAnalysisContex
t arg0) : super(arg0); |
| 2018 // @override |
| 2019 // accept(AnalysisTaskVisitor visitor) { |
| 2020 // JUnitTestCase.assertNotNull(exception); |
| 2021 // return null; |
| 2022 // } |
| 2023 // @override |
| 2024 // String get taskDescription => null; |
| 2025 // @override |
| 2026 // void internalPerform() { |
| 2027 // throw new AnalysisException("Forced exception"); |
| 2028 // } |
| 2029 // } |
| 2030 // class BuildDartElementModelTaskTest extends EngineTestCase { |
| 2031 // void test_accept() { |
| 2032 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2033 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, new List<ResolvableLibrary>()); |
| 2034 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_BuildDartElement
ModelTaskTest_test_accept())); |
| 2035 // } |
| 2036 // void test_getErrors() { |
| 2037 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2038 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, new List<ResolvableLibrary>()); |
| 2039 // EngineTestCase.assertLength(0, task.errorListener.errors); |
| 2040 // } |
| 2041 // void test_getLibrariesInCycle() { |
| 2042 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2043 // List<ResolvableLibrary> librariesInCycle = new List<ResolvableLibrary>(); |
| 2044 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, librariesInCycle); |
| 2045 // JUnitTestCase.assertSame(librariesInCycle, task.librariesInCycle); |
| 2046 // } |
| 2047 // void test_perform_multiple() { |
| 2048 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2049 // ResolvableLibrary lib3 = _createLibrary(<ResolvableCompilationUnit> [_cre
ateUnit(context, "/lib3.dart", EngineTestCase.createSource([ |
| 2050 // "library lib3;", |
| 2051 // "import 'lib1.dart';", |
| 2052 // "class C { A a; }"]))], null); |
| 2053 // ResolvableLibrary lib2 = _createLibrary(<ResolvableCompilationUnit> [_cre
ateUnit(context, "/lib2.dart", EngineTestCase.createSource([ |
| 2054 // "library lib2;", |
| 2055 // "import 'lib3.dart';", |
| 2056 // "class B { C c; }"]))], <ResolvableLibrary> [_createCoreLibrary(conte
xt), lib3]); |
| 2057 // ResolvableLibrary lib1 = _createLibrary(<ResolvableCompilationUnit> [_cre
ateUnit(context, "/lib1.dart", EngineTestCase.createSource([ |
| 2058 // "library lib1;", |
| 2059 // "import 'lib2.dart';", |
| 2060 // "class A { B b; }"]))], <ResolvableLibrary> [_createCoreLibrary(conte
xt), lib2]); |
| 2061 // lib3.importedLibraries = <ResolvableLibrary> [_createCoreLibrary(context)
, lib1]; |
| 2062 // List<ResolvableLibrary> librariesInCycle = new List<ResolvableLibrary>(); |
| 2063 // librariesInCycle.add(lib1); |
| 2064 // librariesInCycle.add(lib2); |
| 2065 // librariesInCycle.add(lib3); |
| 2066 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, librariesInCycle); |
| 2067 // task.perform(new TestTaskVisitor_BuildDartElementModelTaskTest_test_perfo
rm_multiple()); |
| 2068 // } |
| 2069 // void test_perform_single_noParts() { |
| 2070 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2071 // ResolvableLibrary lib1 = _createLibrary(<ResolvableCompilationUnit> [_cre
ateUnit(context, "/lib1.dart", EngineTestCase.createSource(["library lib1;", "cl
ass A {}", "class B extends A {}"]))], <ResolvableLibrary> [_createCoreLibrary(c
ontext)]); |
| 2072 // List<ResolvableLibrary> librariesInCycle = new List<ResolvableLibrary>(); |
| 2073 // librariesInCycle.add(lib1); |
| 2074 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, librariesInCycle); |
| 2075 // task.perform(new TestTaskVisitor_BuildDartElementModelTaskTest_test_perfo
rm_single_noParts()); |
| 2076 // } |
| 2077 // void test_perform_single_parts() { |
| 2078 // AnalysisContextImpl context = AnalysisContextFactory.contextWithCore(); |
| 2079 // ResolvableLibrary lib1 = _createLibrary(<ResolvableCompilationUnit> [ |
| 2080 // _createUnit(context, "/lib1.dart", EngineTestCase.createSource([ |
| 2081 // "library lib1;", |
| 2082 // "part 'part1-1.dart';", |
| 2083 // "part 'part1-2.dart';", |
| 2084 // "class A {}", |
| 2085 // "class B extends A {}"])), |
| 2086 // _createUnit(context, "/part1-1.dart", EngineTestCase.createSource(["p
art of lib1;", "class C extends B {}"])), |
| 2087 // _createUnit(context, "/part1-2.dart", EngineTestCase.createSource(["p
art of lib1;", "class D implements A {}"]))], <ResolvableLibrary> [_createCoreLi
brary(context)]); |
| 2088 // List<ResolvableLibrary> librariesInCycle = new List<ResolvableLibrary>(); |
| 2089 // librariesInCycle.add(lib1); |
| 2090 // BuildDartElementModelTask task = new BuildDartElementModelTask(context, n
ull, librariesInCycle); |
| 2091 // task.perform(new TestTaskVisitor_BuildDartElementModelTaskTest_test_perfo
rm_single_parts()); |
| 2092 // } |
| 2093 // /** |
| 2094 // * Create a resolvable library representing the core library. |
| 2095 // * |
| 2096 // * @param context the context used to build the library |
| 2097 // * @return the resolvable library representing the core library |
| 2098 // * @throws AnalysisException if the core library has not been resolved |
| 2099 // */ |
| 2100 // ResolvableLibrary _createCoreLibrary(AnalysisContextImpl context) { |
| 2101 // Source coreSource = context.sourceFactory.forUri(DartSdk.DART_CORE); |
| 2102 // ResolvableLibrary coreLibrary = new ResolvableLibrary(coreSource); |
| 2103 // coreLibrary.libraryElement = context.computeLibraryElement(coreSource) as
LibraryElementImpl; |
| 2104 // return coreLibrary; |
| 2105 // } |
| 2106 // /** |
| 2107 // * Create a resolvable library with the given compilation units and imports
. |
| 2108 // * |
| 2109 // * @param units the compilation units in the library, with the defining com
pilation unit first |
| 2110 // * @param imports the libraries imported by the library (including the core
library) |
| 2111 // * @return the resolvable library that was created |
| 2112 // */ |
| 2113 // ResolvableLibrary _createLibrary(List<ResolvableCompilationUnit> units, Lis
t<ResolvableLibrary> imports) { |
| 2114 // ResolvableLibrary library = new ResolvableLibrary(units[0].source); |
| 2115 // library.importedLibraries = imports; |
| 2116 // library.resolvableCompilationUnits = units; |
| 2117 // return library; |
| 2118 // } |
| 2119 // /** |
| 2120 // * Return a resolvable compilation unit representing the file with the give
n name and contents. |
| 2121 // * |
| 2122 // * @param fileName the name of the file being represented |
| 2123 // * @param contents the contents of the file being represented |
| 2124 // * @return a resolvable compilation unit representing the file |
| 2125 // */ |
| 2126 // ResolvableCompilationUnit _createUnit(AnalysisContextImpl context, String f
ileName, String contents) { |
| 2127 // Source source = new FileBasedSource.con1(FileUtilities2.createFile(fileNa
me)); |
| 2128 // context.setContents(source, contents); |
| 2129 // return new ResolvableCompilationUnit.con2(source.modificationStamp, _pars
e(context, source, contents), source); |
| 2130 // } |
| 2131 // /** |
| 2132 // * Return the result of parsing the given source. |
| 2133 // * |
| 2134 // * @param source the source being parsed |
| 2135 // * @param contents the contents of the source |
| 2136 // * @return the result of parsing the given source |
| 2137 // */ |
| 2138 // CompilationUnit _parse(AnalysisContextImpl context, Source source, String c
ontents) { |
| 2139 // GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 2140 // Scanner scanner = new Scanner(source, new CharSequenceReader(contents), e
rrorListener); |
| 2141 // Parser parser = new Parser(source, errorListener); |
| 2142 // CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); |
| 2143 // for (Directive directive in unit.directives) { |
| 2144 // if (directive is UriBasedDirective) { |
| 2145 // UriBasedDirective uriDirective = directive as UriBasedDirective; |
| 2146 // ParseDartTask.resolveDirective(context, source, uriDirective, errorLi
stener); |
| 2147 // } |
| 2148 // } |
| 2149 // return unit; |
| 2150 // } |
| 2151 // static dartSuite() { |
| 2152 // _ut.group('BuildDartElementModelTaskTest', () { |
| 2153 // _ut.test('test_accept', () { |
| 2154 // final __test = new BuildDartElementModelTaskTest(); |
| 2155 // runJUnitTest(__test, __test.test_accept); |
| 2156 // }); |
| 2157 // _ut.test('test_getErrors', () { |
| 2158 // final __test = new BuildDartElementModelTaskTest(); |
| 2159 // runJUnitTest(__test, __test.test_getErrors); |
| 2160 // }); |
| 2161 // _ut.test('test_getLibrariesInCycle', () { |
| 2162 // final __test = new BuildDartElementModelTaskTest(); |
| 2163 // runJUnitTest(__test, __test.test_getLibrariesInCycle); |
| 2164 // }); |
| 2165 // _ut.test('test_perform_multiple', () { |
| 2166 // final __test = new BuildDartElementModelTaskTest(); |
| 2167 // runJUnitTest(__test, __test.test_perform_multiple); |
| 2168 // }); |
| 2169 // _ut.test('test_perform_single_noParts', () { |
| 2170 // final __test = new BuildDartElementModelTaskTest(); |
| 2171 // runJUnitTest(__test, __test.test_perform_single_noParts); |
| 2172 // }); |
| 2173 // _ut.test('test_perform_single_parts', () { |
| 2174 // final __test = new BuildDartElementModelTaskTest(); |
| 2175 // runJUnitTest(__test, __test.test_perform_single_parts); |
| 2176 // }); |
| 2177 // }); |
| 2178 // } |
| 2179 // } |
| 2180 // class CacheRetentionPolicy_AnalysisCacheTest_test_setMaxCacheSize implements
CacheRetentionPolicy { |
| 2181 // @override |
| 2182 // RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) =>
RetentionPriority.LOW; |
| 2183 // } |
| 2184 // class CacheRetentionPolicy_UniversalCachePartitionTest_test_setMaxCacheSize i
mplements CacheRetentionPolicy { |
| 2185 // @override |
| 2186 // RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) =>
RetentionPriority.LOW; |
| 2187 // } |
| 2188 // class DartEntryImplTest extends EngineTestCase { |
| 2189 // void test_creation() { |
| 2190 // Source librarySource = new TestSource(); |
| 2191 // DartEntryImpl entry = new DartEntryImpl(); |
| 2192 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2193 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2194 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2195 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2196 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2197 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2198 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2199 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2200 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2201 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2202 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2203 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2204 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2205 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2206 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILD_ELEMENT_ERRORS, librarySource)); |
| 2207 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILT_UNIT, librarySource)); |
| 2208 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.HINTS, librarySource)); |
| 2209 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLUTION_ERRORS, librarySource)); |
| 2210 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLVED_UNIT, librarySource)); |
| 2211 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.VERIFICATION_ERRORS, librarySource)); |
| 2212 // } |
| 2213 // void test_getAllErrors() { |
| 2214 // Source source = new TestSource(); |
| 2215 // DartEntryImpl entry = new DartEntryImpl(); |
| 2216 // EngineTestCase.assertLength(0, entry.allErrors); |
| 2217 // entry.setValue(DartEntry.SCAN_ERRORS, <AnalysisError> [new AnalysisError.
con1(source, ScannerErrorCode.UNTERMINATED_STRING_LITERAL, [])]); |
| 2218 // entry.setValue(DartEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError
.con1(source, ParserErrorCode.ABSTRACT_CLASS_MEMBER, [])]); |
| 2219 // entry.setValueInLibrary(DartEntry.BUILD_ELEMENT_ERRORS, source, <Analysis
Error> [new AnalysisError.con1(source, CompileTimeErrorCode.MIXIN_OF_NON_CLASS,
[])]); |
| 2220 // entry.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, source, <AnalysisErr
or> [new AnalysisError.con1(source, CompileTimeErrorCode.CONST_CONSTRUCTOR_THROW
S_EXCEPTION, [])]); |
| 2221 // entry.setValueInLibrary(DartEntry.VERIFICATION_ERRORS, source, <AnalysisE
rror> [new AnalysisError.con1(source, StaticWarningCode.CASE_BLOCK_NOT_TERMINATE
D, [])]); |
| 2222 // entry.setValueInLibrary(DartEntry.HINTS, source, <AnalysisError> [new Ana
lysisError.con1(source, HintCode.DEAD_CODE, [])]); |
| 2223 // EngineTestCase.assertLength(6, entry.allErrors); |
| 2224 // } |
| 2225 // void test_getResolvableCompilationUnit_none() { |
| 2226 // DartEntryImpl entry = new DartEntryImpl(); |
| 2227 // JUnitTestCase.assertNull(entry.resolvableCompilationUnit); |
| 2228 // } |
| 2229 // void test_getResolvableCompilationUnit_parsed_accessed() { |
| 2230 // String importUri = "f1.dart"; |
| 2231 // Source importSource = new TestSource.con1(FileUtilities2.createFile(impor
tUri), ""); |
| 2232 // ImportDirective importDirective = AstFactory.importDirective3(importUri,
null, []); |
| 2233 // importDirective.source = importSource; |
| 2234 // importDirective.uriContent = importUri; |
| 2235 // String exportUri = "f2.dart"; |
| 2236 // Source exportSource = new TestSource.con1(FileUtilities2.createFile(expor
tUri), ""); |
| 2237 // ExportDirective exportDirective = AstFactory.exportDirective2(exportUri,
[]); |
| 2238 // exportDirective.source = exportSource; |
| 2239 // exportDirective.uriContent = exportUri; |
| 2240 // String partUri = "f3.dart"; |
| 2241 // Source partSource = new TestSource.con1(FileUtilities2.createFile(partUri
), ""); |
| 2242 // PartDirective partDirective = AstFactory.partDirective2(partUri); |
| 2243 // partDirective.source = partSource; |
| 2244 // partDirective.uriContent = partUri; |
| 2245 // CompilationUnit unit = AstFactory.compilationUnit3([importDirective, expo
rtDirective, partDirective]); |
| 2246 // DartEntryImpl entry = new DartEntryImpl(); |
| 2247 // entry.setValue(DartEntry.PARSED_UNIT, unit); |
| 2248 // entry.getValue(DartEntry.PARSED_UNIT); |
| 2249 // CompilationUnit result = entry.resolvableCompilationUnit; |
| 2250 // JUnitTestCase.assertNotSame(unit, result); |
| 2251 // NodeList<Directive> directives = result.directives; |
| 2252 // ImportDirective resultImportDirective = directives[0] as ImportDirective; |
| 2253 // JUnitTestCase.assertEquals(importUri, resultImportDirective.uriContent); |
| 2254 // JUnitTestCase.assertSame(importSource, resultImportDirective.source); |
| 2255 // ExportDirective resultExportDirective = directives[1] as ExportDirective; |
| 2256 // JUnitTestCase.assertEquals(exportUri, resultExportDirective.uriContent); |
| 2257 // JUnitTestCase.assertSame(exportSource, resultExportDirective.source); |
| 2258 // PartDirective resultPartDirective = directives[2] as PartDirective; |
| 2259 // JUnitTestCase.assertEquals(partUri, resultPartDirective.uriContent); |
| 2260 // JUnitTestCase.assertSame(partSource, resultPartDirective.source); |
| 2261 // } |
| 2262 // void test_getResolvableCompilationUnit_parsed_notAccessed() { |
| 2263 // CompilationUnit unit = AstFactory.compilationUnit(); |
| 2264 // DartEntryImpl entry = new DartEntryImpl(); |
| 2265 // entry.setValue(DartEntry.PARSED_UNIT, unit); |
| 2266 // JUnitTestCase.assertSame(unit, entry.resolvableCompilationUnit); |
| 2267 // } |
| 2268 // void test_getResolvableCompilationUnit_resolved() { |
| 2269 // String importUri = "f1.dart"; |
| 2270 // Source importSource = new TestSource.con1(FileUtilities2.createFile(impor
tUri), ""); |
| 2271 // ImportDirective importDirective = AstFactory.importDirective3(importUri,
null, []); |
| 2272 // importDirective.source = importSource; |
| 2273 // importDirective.uriContent = importUri; |
| 2274 // String exportUri = "f2.dart"; |
| 2275 // Source exportSource = new TestSource.con1(FileUtilities2.createFile(expor
tUri), ""); |
| 2276 // ExportDirective exportDirective = AstFactory.exportDirective2(exportUri,
[]); |
| 2277 // exportDirective.source = exportSource; |
| 2278 // exportDirective.uriContent = exportUri; |
| 2279 // String partUri = "f3.dart"; |
| 2280 // Source partSource = new TestSource.con1(FileUtilities2.createFile(partUri
), ""); |
| 2281 // PartDirective partDirective = AstFactory.partDirective2(partUri); |
| 2282 // partDirective.source = partSource; |
| 2283 // partDirective.uriContent = partUri; |
| 2284 // CompilationUnit unit = AstFactory.compilationUnit3([importDirective, expo
rtDirective, partDirective]); |
| 2285 // DartEntryImpl entry = new DartEntryImpl(); |
| 2286 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, new TestSource.con1(File
Utilities2.createFile("lib.dart"), ""), unit); |
| 2287 // CompilationUnit result = entry.resolvableCompilationUnit; |
| 2288 // JUnitTestCase.assertNotSame(unit, result); |
| 2289 // NodeList<Directive> directives = result.directives; |
| 2290 // ImportDirective resultImportDirective = directives[0] as ImportDirective; |
| 2291 // JUnitTestCase.assertEquals(importUri, resultImportDirective.uriContent); |
| 2292 // JUnitTestCase.assertSame(importSource, resultImportDirective.source); |
| 2293 // ExportDirective resultExportDirective = directives[1] as ExportDirective; |
| 2294 // JUnitTestCase.assertEquals(exportUri, resultExportDirective.uriContent); |
| 2295 // JUnitTestCase.assertSame(exportSource, resultExportDirective.source); |
| 2296 // PartDirective resultPartDirective = directives[2] as PartDirective; |
| 2297 // JUnitTestCase.assertEquals(partUri, resultPartDirective.uriContent); |
| 2298 // JUnitTestCase.assertSame(partSource, resultPartDirective.source); |
| 2299 // } |
| 2300 // void test_getState_invalid_buildElementErrors() { |
| 2301 // DartEntryImpl entry = new DartEntryImpl(); |
| 2302 // try { |
| 2303 // entry.getState(DartEntry.BUILD_ELEMENT_ERRORS); |
| 2304 // JUnitTestCase.fail("Expected IllegalArgumentException for BUILD_ELEMENT
_ERRORS"); |
| 2305 // } on IllegalArgumentException catch (exception) { |
| 2306 // } |
| 2307 // } |
| 2308 // void test_getState_invalid_resolutionErrors() { |
| 2309 // DartEntryImpl entry = new DartEntryImpl(); |
| 2310 // try { |
| 2311 // entry.getState(DartEntry.RESOLUTION_ERRORS); |
| 2312 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2313 // } on IllegalArgumentException catch (exception) { |
| 2314 // } |
| 2315 // } |
| 2316 // void test_getState_invalid_verificationErrors() { |
| 2317 // DartEntryImpl entry = new DartEntryImpl(); |
| 2318 // try { |
| 2319 // entry.getState(DartEntry.VERIFICATION_ERRORS); |
| 2320 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2321 // } on IllegalArgumentException catch (exception) { |
| 2322 // } |
| 2323 // } |
| 2324 // void test_getStateInLibrary_invalid_element() { |
| 2325 // DartEntryImpl entry = new DartEntryImpl(); |
| 2326 // try { |
| 2327 // entry.getStateInLibrary(DartEntry.ELEMENT, new TestSource()); |
| 2328 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2329 // } on IllegalArgumentException catch (exception) { |
| 2330 // } |
| 2331 // } |
| 2332 // void test_getValue_containingLibraries() { |
| 2333 // Source testSource = new TestSource(); |
| 2334 // DartEntryImpl entry = new DartEntryImpl(); |
| 2335 // List<Source> value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2336 // EngineTestCase.assertLength(0, value); |
| 2337 // entry.addContainingLibrary(testSource); |
| 2338 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2339 // EngineTestCase.assertLength(1, value); |
| 2340 // JUnitTestCase.assertEquals(testSource, value[0]); |
| 2341 // entry.removeContainingLibrary(testSource); |
| 2342 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2343 // EngineTestCase.assertLength(0, value); |
| 2344 // } |
| 2345 // void test_getValue_invalid_buildElementErrors() { |
| 2346 // DartEntryImpl entry = new DartEntryImpl(); |
| 2347 // try { |
| 2348 // entry.getValue(DartEntry.BUILD_ELEMENT_ERRORS); |
| 2349 // JUnitTestCase.fail("Expected IllegalArgumentException for BUILD_ELEMENT
_ERRORS"); |
| 2350 // } on IllegalArgumentException catch (exception) { |
| 2351 // } |
| 2352 // } |
| 2353 // void test_getValue_invalid_resolutionErrors() { |
| 2354 // DartEntryImpl entry = new DartEntryImpl(); |
| 2355 // try { |
| 2356 // entry.getValue(DartEntry.RESOLUTION_ERRORS); |
| 2357 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2358 // } on IllegalArgumentException catch (exception) { |
| 2359 // } |
| 2360 // } |
| 2361 // void test_getValue_invalid_verificationErrors() { |
| 2362 // DartEntryImpl entry = new DartEntryImpl(); |
| 2363 // try { |
| 2364 // entry.getValue(DartEntry.VERIFICATION_ERRORS); |
| 2365 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2366 // } on IllegalArgumentException catch (exception) { |
| 2367 // } |
| 2368 // } |
| 2369 // void test_getValueInLibrary_invalid_element() { |
| 2370 // DartEntryImpl entry = new DartEntryImpl(); |
| 2371 // try { |
| 2372 // entry.getValueInLibrary(DartEntry.ELEMENT, new TestSource()); |
| 2373 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2374 // } on IllegalArgumentException catch (exception) { |
| 2375 // } |
| 2376 // } |
| 2377 // void test_getValueInLibrary_invalid_resolutionErrors_multiple() { |
| 2378 // Source source1 = new TestSource(); |
| 2379 // Source source2 = new TestSource(); |
| 2380 // Source source3 = new TestSource(); |
| 2381 // DartEntryImpl entry = new DartEntryImpl(); |
| 2382 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2383 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); |
| 2384 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); |
| 2385 // try { |
| 2386 // entry.getValueInLibrary(DartEntry.ELEMENT, source3); |
| 2387 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2388 // } on IllegalArgumentException catch (exception) { |
| 2389 // } |
| 2390 // } |
| 2391 // void test_getWritableCopy() { |
| 2392 // DartEntryImpl entry = new DartEntryImpl(); |
| 2393 // DartEntryImpl copy = entry.writableCopy; |
| 2394 // JUnitTestCase.assertNotNull(copy); |
| 2395 // JUnitTestCase.assertNotSame(entry, copy); |
| 2396 // } |
| 2397 // void test_hasInvalidData_false() { |
| 2398 // DartEntryImpl entry = new DartEntryImpl(); |
| 2399 // entry.recordScanError(new CaughtException(new AnalysisException(), null))
; |
| 2400 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.ELEMENT)); |
| 2401 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.EXPORTED_LIBRARI
ES)); |
| 2402 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.HINTS)); |
| 2403 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.IMPORTED_LIBRARI
ES)); |
| 2404 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.INCLUDED_PARTS))
; |
| 2405 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.IS_CLIENT)); |
| 2406 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.IS_LAUNCHABLE)); |
| 2407 // JUnitTestCase.assertFalse(entry.hasInvalidData(SourceEntry.LINE_INFO)); |
| 2408 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.PARSE_ERRORS)); |
| 2409 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.PARSED_UNIT)); |
| 2410 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.PUBLIC_NAMESPACE
)); |
| 2411 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.SOURCE_KIND)); |
| 2412 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.BUILD_ELEMENT_ER
RORS)); |
| 2413 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.RESOLUTION_ERROR
S)); |
| 2414 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.RESOLVED_UNIT)); |
| 2415 // JUnitTestCase.assertFalse(entry.hasInvalidData(DartEntry.VERIFICATION_ERR
ORS)); |
| 2416 // } |
| 2417 // void test_hasInvalidData_true() { |
| 2418 // DartEntryImpl entry = new DartEntryImpl(); |
| 2419 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.ELEMENT)); |
| 2420 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.EXPORTED_LIBRARIE
S)); |
| 2421 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.HINTS)); |
| 2422 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.IMPORTED_LIBRARIE
S)); |
| 2423 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.INCLUDED_PARTS)); |
| 2424 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.IS_CLIENT)); |
| 2425 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.IS_LAUNCHABLE)); |
| 2426 // JUnitTestCase.assertTrue(entry.hasInvalidData(SourceEntry.LINE_INFO)); |
| 2427 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.PARSE_ERRORS)); |
| 2428 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.PARSED_UNIT)); |
| 2429 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.PUBLIC_NAMESPACE)
); |
| 2430 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.SOURCE_KIND)); |
| 2431 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.BUILD_ELEMENT_ERR
ORS)); |
| 2432 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.RESOLUTION_ERRORS
)); |
| 2433 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.RESOLVED_UNIT)); |
| 2434 // JUnitTestCase.assertTrue(entry.hasInvalidData(DartEntry.VERIFICATION_ERRO
RS)); |
| 2435 // } |
| 2436 // void test_invalidateAllInformation() { |
| 2437 // DartEntryImpl entry = _entryWithValidState(); |
| 2438 // entry.invalidateAllInformation(); |
| 2439 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2440 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2441 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2442 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2443 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2444 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2445 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2446 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2447 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2448 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2449 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2450 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2451 // } |
| 2452 // void test_invalidateAllResolutionInformation() { |
| 2453 // DartEntryImpl entry = _entryWithValidState(); |
| 2454 // entry.invalidateAllResolutionInformation(false); |
| 2455 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2456 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2457 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2458 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2459 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2460 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2461 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2462 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.EXPOR
TED_LIBRARIES)); |
| 2463 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IMPOR
TED_LIBRARIES)); |
| 2464 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2465 // } |
| 2466 // void test_invalidateAllResolutionInformation_includingUris() { |
| 2467 // DartEntryImpl entry = _entryWithValidState(); |
| 2468 // entry.invalidateAllResolutionInformation(true); |
| 2469 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2470 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2471 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2472 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2473 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2474 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2475 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2476 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2477 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2478 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2479 // } |
| 2480 // void test_isClient() { |
| 2481 // DartEntryImpl entry = new DartEntryImpl(); |
| 2482 // // true |
| 2483 // entry.setValue(DartEntry.IS_CLIENT, true); |
| 2484 // JUnitTestCase.assertTrue(entry.getValue(DartEntry.IS_CLIENT)); |
| 2485 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_CL
IENT)); |
| 2486 // // invalidate |
| 2487 // entry.setState(DartEntry.IS_CLIENT, CacheState.INVALID); |
| 2488 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2489 // // false |
| 2490 // entry.setValue(DartEntry.IS_CLIENT, false); |
| 2491 // JUnitTestCase.assertFalse(entry.getValue(DartEntry.IS_CLIENT)); |
| 2492 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_CL
IENT)); |
| 2493 // } |
| 2494 // void test_isLaunchable() { |
| 2495 // DartEntryImpl entry = new DartEntryImpl(); |
| 2496 // // true |
| 2497 // entry.setValue(DartEntry.IS_LAUNCHABLE, true); |
| 2498 // JUnitTestCase.assertTrue(entry.getValue(DartEntry.IS_LAUNCHABLE)); |
| 2499 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2500 // // invalidate |
| 2501 // entry.setState(DartEntry.IS_LAUNCHABLE, CacheState.INVALID); |
| 2502 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2503 // // false |
| 2504 // entry.setValue(DartEntry.IS_LAUNCHABLE, false); |
| 2505 // JUnitTestCase.assertFalse(entry.getValue(DartEntry.IS_LAUNCHABLE)); |
| 2506 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2507 // } |
| 2508 // void test_recordBuildElementErrorInLibrary() { |
| 2509 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2510 // // library, then verify that the data for the other library is still vali
d. |
| 2511 // Source source = new TestSource(); |
| 2512 // DartEntryImpl entry = new DartEntryImpl(); |
| 2513 // entry.recordBuildElementErrorInLibrary(source, new CaughtException(new An
alysisException(), null)); |
| 2514 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2515 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2516 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2517 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2518 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2519 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2520 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2521 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2522 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2523 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2524 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2525 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2526 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2527 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2528 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.BUILD_ELEMENT_ERRORS, source)); |
| 2529 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.BUILT_UNIT, source)); |
| 2530 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.HINTS, source)); |
| 2531 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.RESOLUTION_ERRORS, source)); |
| 2532 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.RESOLVED_UNIT, source)); |
| 2533 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.VERIFICATION_ERRORS, source)); |
| 2534 // } |
| 2535 // void test_recordContentError() { |
| 2536 // // Source source = new TestSource(); |
| 2537 // DartEntryImpl entry = new DartEntryImpl(); |
| 2538 // entry.recordContentError(new CaughtException(new AnalysisException(), nul
l)); |
| 2539 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.CON
TENT)); |
| 2540 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2541 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.EXPOR
TED_LIBRARIES)); |
| 2542 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IMPOR
TED_LIBRARIES)); |
| 2543 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2544 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2545 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2546 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2547 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2548 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2549 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2550 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); |
| 2551 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2552 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); |
| 2553 // } |
| 2554 // void test_recordHintErrorInLibrary() { |
| 2555 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2556 // // library, then verify that the data for the other library is still vali
d. |
| 2557 // Source source = new TestSource(); |
| 2558 // DartEntryImpl entry = new DartEntryImpl(); |
| 2559 // entry.recordHintErrorInLibrary(source, new CaughtException(new AnalysisEx
ception(), null)); |
| 2560 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2561 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2562 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2563 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2564 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2565 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2566 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2567 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2568 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2569 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2570 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2571 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2572 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2573 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2574 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILD_ELEMENT_ERRORS, source)); |
| 2575 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILT_UNIT, source)); |
| 2576 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.HINTS, source)); |
| 2577 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLUTION_ERRORS, source)); |
| 2578 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLVED_UNIT, source)); |
| 2579 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.VERIFICATION_ERRORS, source)); |
| 2580 // } |
| 2581 // void test_recordParseError() { |
| 2582 // // Source source = new TestSource(); |
| 2583 // DartEntryImpl entry = new DartEntryImpl(); |
| 2584 // entry.recordParseError(new CaughtException(new AnalysisException(), null)
); |
| 2585 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2586 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2587 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.EXPOR
TED_LIBRARIES)); |
| 2588 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IMPOR
TED_LIBRARIES)); |
| 2589 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2590 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2591 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2592 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2593 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2594 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2595 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2596 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2597 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2598 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2599 // } |
| 2600 // void test_recordParseInProcess() { |
| 2601 // DartEntryImpl entry = new DartEntryImpl(); |
| 2602 // entry.recordParseInProcess(); |
| 2603 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSE_ERRORS)); |
| 2604 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSED_UNIT)); |
| 2605 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SOURCE_KIND)); |
| 2606 // } |
| 2607 // void test_recordResolutionError() { |
| 2608 // // Source source = new TestSource(); |
| 2609 // DartEntryImpl entry = new DartEntryImpl(); |
| 2610 // entry.recordResolutionError(new CaughtException(new AnalysisException(),
null)); |
| 2611 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2612 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2613 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2614 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2615 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2616 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2617 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2618 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2619 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2620 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2621 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2622 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2623 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2624 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2625 // } |
| 2626 // void test_recordResolutionErrorInLibrary() { |
| 2627 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2628 // // library, then verify that the data for the other library is still vali
d. |
| 2629 // Source source = new TestSource(); |
| 2630 // DartEntryImpl entry = new DartEntryImpl(); |
| 2631 // entry.recordResolutionErrorInLibrary(source, new CaughtException(new Anal
ysisException(), null)); |
| 2632 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2633 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2634 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2635 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2636 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2637 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2638 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2639 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2640 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2641 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2642 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2643 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2644 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2645 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2646 // // The following lines are commented out because we don't currently have
any way of setting the |
| 2647 // // state for data associated with a library we don't know anything about. |
| 2648 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILD_ELEMENT_ERRORS, source)); |
| 2649 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILT_UNIT, source)); |
| 2650 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.HINTS, source)); |
| 2651 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.RESOLUTION_ERRORS, source)); |
| 2652 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.RESOLVED_UNIT, source)); |
| 2653 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.VERIFICATION_ERRORS, source)); |
| 2654 // } |
| 2655 // void test_recordScanError() { |
| 2656 // // Source source = new TestSource(); |
| 2657 // DartEntryImpl entry = new DartEntryImpl(); |
| 2658 // entry.recordScanError(new CaughtException(new AnalysisException(), null))
; |
| 2659 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2660 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2661 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.EXPOR
TED_LIBRARIES)); |
| 2662 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IMPOR
TED_LIBRARIES)); |
| 2663 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2664 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2665 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2666 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2667 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2668 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2669 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2670 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); |
| 2671 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2672 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); |
| 2673 // } |
| 2674 // void test_recordScanInProcess() { |
| 2675 // DartEntryImpl entry = new DartEntryImpl(); |
| 2676 // entry.recordScanInProcess(); |
| 2677 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(SourceEntr
y.LINE_INFO)); |
| 2678 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SCAN_ERRORS)); |
| 2679 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
TOKEN_STREAM)); |
| 2680 // } |
| 2681 // void test_recordVerificationErrorInLibrary() { |
| 2682 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2683 // // library, then verify that the data for the other library is still vali
d. |
| 2684 // Source source = new TestSource(); |
| 2685 // DartEntryImpl entry = new DartEntryImpl(); |
| 2686 // entry.recordVerificationErrorInLibrary(source, new CaughtException(new An
alysisException(), null)); |
| 2687 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2688 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2689 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2690 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2691 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2692 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
CLIENT)); |
| 2693 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IS_
LAUNCHABLE)); |
| 2694 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2695 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2696 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2697 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PUB
LIC_NAMESPACE)); |
| 2698 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2699 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2700 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2701 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILD_ELEMENT_ERRORS, source)); |
| 2702 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.BUILT_UNIT, source)); |
| 2703 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.HINTS, source)); |
| 2704 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLUTION_ERRORS, source)); |
| 2705 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getStateInLibrary(Dart
Entry.RESOLVED_UNIT, source)); |
| 2706 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEn
try.VERIFICATION_ERRORS, source)); |
| 2707 // } |
| 2708 // void test_removeResolution_multiple_first() { |
| 2709 // Source source1 = new TestSource(); |
| 2710 // Source source2 = new TestSource(); |
| 2711 // Source source3 = new TestSource(); |
| 2712 // DartEntryImpl entry = new DartEntryImpl(); |
| 2713 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2714 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); |
| 2715 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); |
| 2716 // entry.removeResolution(source1); |
| 2717 // } |
| 2718 // void test_removeResolution_multiple_last() { |
| 2719 // Source source1 = new TestSource(); |
| 2720 // Source source2 = new TestSource(); |
| 2721 // Source source3 = new TestSource(); |
| 2722 // DartEntryImpl entry = new DartEntryImpl(); |
| 2723 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2724 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); |
| 2725 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); |
| 2726 // entry.removeResolution(source3); |
| 2727 // } |
| 2728 // void test_removeResolution_multiple_middle() { |
| 2729 // Source source1 = new TestSource(); |
| 2730 // Source source2 = new TestSource(); |
| 2731 // Source source3 = new TestSource(); |
| 2732 // DartEntryImpl entry = new DartEntryImpl(); |
| 2733 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2734 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); |
| 2735 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); |
| 2736 // entry.removeResolution(source2); |
| 2737 // } |
| 2738 // void test_removeResolution_single() { |
| 2739 // Source source1 = new TestSource(); |
| 2740 // DartEntryImpl entry = new DartEntryImpl(); |
| 2741 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2742 // entry.removeResolution(source1); |
| 2743 // } |
| 2744 // void test_resolutionState() { |
| 2745 // DartEntryImpl entry1 = new DartEntryImpl(); |
| 2746 // Source libSrc1 = new TestSource.con1(FileUtilities2.createFile("/test1.da
rt"), ""); |
| 2747 // Source libSrc2 = new TestSource.con1(FileUtilities2.createFile("/test2.da
rt"), ""); |
| 2748 // ParserErrorCode errCode = ParserErrorCode.DIRECTIVE_AFTER_DECLARATION; |
| 2749 // List<AnalysisError> errors1 = <AnalysisError> [new AnalysisError.con2(lib
Src1, 0, 10, errCode, [])]; |
| 2750 // List<AnalysisError> errors2 = <AnalysisError> [new AnalysisError.con2(lib
Src2, 0, 20, errCode, [])]; |
| 2751 // entry1.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, libSrc1, errors1); |
| 2752 // entry1.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, libSrc2, errors2); |
| 2753 // TestDartEntryImpl entry2 = new TestDartEntryImpl(); |
| 2754 // entry2.copyFrom(entry1); |
| 2755 // EngineTestCase.assertExactElementsInArray(entry2.allErrors, [errors1[0],
errors2[0]]); |
| 2756 // entry1.removeResolution(libSrc2); |
| 2757 // EngineTestCase.assertExactElementsInArray(entry1.allErrors, [errors1[0]])
; |
| 2758 // entry2.removeResolution(libSrc1); |
| 2759 // EngineTestCase.assertExactElementsInArray(entry2.allErrors, [errors2[0]])
; |
| 2760 // entry2.removeResolution(libSrc2); |
| 2761 // EngineTestCase.assertExactElementsInArray(entry2.allErrors, []); |
| 2762 // } |
| 2763 // void test_setState_buildElementErrors() { |
| 2764 // state3 = DartEntry.BUILD_ELEMENT_ERRORS; |
| 2765 // } |
| 2766 // void test_setState_element() { |
| 2767 // state2 = DartEntry.ELEMENT; |
| 2768 // } |
| 2769 // void test_setState_exportedLibraries() { |
| 2770 // state2 = DartEntry.EXPORTED_LIBRARIES; |
| 2771 // } |
| 2772 // void test_setState_hints() { |
| 2773 // state3 = DartEntry.HINTS; |
| 2774 // } |
| 2775 // void test_setState_importedLibraries() { |
| 2776 // state2 = DartEntry.IMPORTED_LIBRARIES; |
| 2777 // } |
| 2778 // void test_setState_includedParts() { |
| 2779 // state2 = DartEntry.INCLUDED_PARTS; |
| 2780 // } |
| 2781 // void test_setState_invalid_buildElementErrors() { |
| 2782 // DartEntryImpl entry = new DartEntryImpl(); |
| 2783 // try { |
| 2784 // entry.setState(DartEntry.BUILD_ELEMENT_ERRORS, CacheState.FLUSHED); |
| 2785 // JUnitTestCase.fail("Expected IllegalArgumentException for BUILD_ELEMENT
_ERRORS"); |
| 2786 // } on IllegalArgumentException catch (exception) { |
| 2787 // } |
| 2788 // } |
| 2789 // void test_setState_invalid_element() { |
| 2790 // DartEntryImpl entry = new DartEntryImpl(); |
| 2791 // try { |
| 2792 // entry.setStateInLibrary(DartEntry.ELEMENT, null, CacheState.FLUSHED); |
| 2793 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2794 // } on IllegalArgumentException catch (exception) { |
| 2795 // } |
| 2796 // } |
| 2797 // void test_setState_invalid_resolutionErrors() { |
| 2798 // DartEntryImpl entry = new DartEntryImpl(); |
| 2799 // try { |
| 2800 // entry.setState(DartEntry.RESOLUTION_ERRORS, CacheState.FLUSHED); |
| 2801 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2802 // } on IllegalArgumentException catch (exception) { |
| 2803 // } |
| 2804 // } |
| 2805 // void test_setState_invalid_validState() { |
| 2806 // DartEntryImpl entry = new DartEntryImpl(); |
| 2807 // try { |
| 2808 // entry.setState(DartEntry.LINE_INFO, CacheState.VALID); |
| 2809 // JUnitTestCase.fail("Expected IllegalArgumentException for a state of VA
LID"); |
| 2810 // } on IllegalArgumentException catch (exception) { |
| 2811 // } |
| 2812 // } |
| 2813 // void test_setState_invalid_verificationErrors() { |
| 2814 // DartEntryImpl entry = new DartEntryImpl(); |
| 2815 // try { |
| 2816 // entry.setState(DartEntry.VERIFICATION_ERRORS, CacheState.FLUSHED); |
| 2817 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2818 // } on IllegalArgumentException catch (exception) { |
| 2819 // } |
| 2820 // } |
| 2821 // void test_setState_isClient() { |
| 2822 // state2 = DartEntry.IS_CLIENT; |
| 2823 // } |
| 2824 // void test_setState_isLaunchable() { |
| 2825 // state2 = DartEntry.IS_LAUNCHABLE; |
| 2826 // } |
| 2827 // void test_setState_lineInfo() { |
| 2828 // state2 = SourceEntry.LINE_INFO; |
| 2829 // } |
| 2830 // void test_setState_parsedUnit() { |
| 2831 // state2 = DartEntry.PARSED_UNIT; |
| 2832 // } |
| 2833 // void test_setState_parseErrors() { |
| 2834 // state2 = DartEntry.PARSE_ERRORS; |
| 2835 // } |
| 2836 // void test_setState_publicNamespace() { |
| 2837 // state2 = DartEntry.PUBLIC_NAMESPACE; |
| 2838 // } |
| 2839 // void test_setState_resolutionErrors() { |
| 2840 // state3 = DartEntry.RESOLUTION_ERRORS; |
| 2841 // } |
| 2842 // void test_setState_resolvedUnit() { |
| 2843 // state3 = DartEntry.RESOLVED_UNIT; |
| 2844 // } |
| 2845 // void test_setState_scanErrors() { |
| 2846 // state2 = DartEntry.SCAN_ERRORS; |
| 2847 // } |
| 2848 // void test_setState_sourceKind() { |
| 2849 // state2 = DartEntry.SOURCE_KIND; |
| 2850 // } |
| 2851 // void test_setState_tokenStream() { |
| 2852 // state2 = DartEntry.TOKEN_STREAM; |
| 2853 // } |
| 2854 // void test_setState_verificationErrors() { |
| 2855 // state3 = DartEntry.VERIFICATION_ERRORS; |
| 2856 // } |
| 2857 // void test_setValue_buildElementErrors() { |
| 2858 // _setValue3(DartEntry.BUILD_ELEMENT_ERRORS, <AnalysisError> [new AnalysisE
rror.con1(null, CompileTimeErrorCode.MIXIN_OF_NON_CLASS, [])]); |
| 2859 // } |
| 2860 // void test_setValue_element() { |
| 2861 // _setValue2(DartEntry.ELEMENT, new LibraryElementImpl.forNode(null, AstFac
tory.libraryIdentifier2(["lib"]))); |
| 2862 // } |
| 2863 // void test_setValue_exportedLibraries() { |
| 2864 // _setValue2(DartEntry.EXPORTED_LIBRARIES, <Source> [new TestSource()]); |
| 2865 // } |
| 2866 // void test_setValue_hints() { |
| 2867 // _setValue3(DartEntry.HINTS, <AnalysisError> [new AnalysisError.con1(null,
HintCode.DEAD_CODE, [])]); |
| 2868 // } |
| 2869 // void test_setValue_importedLibraries() { |
| 2870 // _setValue2(DartEntry.IMPORTED_LIBRARIES, <Source> [new TestSource()]); |
| 2871 // } |
| 2872 // void test_setValue_includedParts() { |
| 2873 // _setValue2(DartEntry.INCLUDED_PARTS, <Source> [new TestSource()]); |
| 2874 // } |
| 2875 // void test_setValue_isClient() { |
| 2876 // _setValue2(DartEntry.IS_CLIENT, true); |
| 2877 // } |
| 2878 // void test_setValue_isLaunchable() { |
| 2879 // _setValue2(DartEntry.IS_LAUNCHABLE, true); |
| 2880 // } |
| 2881 // void test_setValue_lineInfo() { |
| 2882 // _setValue2(SourceEntry.LINE_INFO, new LineInfo(<int> [0])); |
| 2883 // } |
| 2884 // void test_setValue_parsedUnit() { |
| 2885 // _setValue2(DartEntry.PARSED_UNIT, AstFactory.compilationUnit()); |
| 2886 // } |
| 2887 // void test_setValue_parseErrors() { |
| 2888 // _setValue2(DartEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError.con
1(null, ParserErrorCode.ABSTRACT_CLASS_MEMBER, [])]); |
| 2889 // } |
| 2890 // void test_setValue_publicNamespace() { |
| 2891 // _setValue2(DartEntry.PUBLIC_NAMESPACE, new Namespace(new HashMap<String,
Element>())); |
| 2892 // } |
| 2893 // void test_setValue_resolutionErrors() { |
| 2894 // _setValue3(DartEntry.RESOLUTION_ERRORS, <AnalysisError> [new AnalysisErro
r.con1(null, CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION, [])]); |
| 2895 // } |
| 2896 // void test_setValue_resolvedUnit() { |
| 2897 // _setValue3(DartEntry.RESOLVED_UNIT, AstFactory.compilationUnit()); |
| 2898 // } |
| 2899 // void test_setValue_scanErrors() { |
| 2900 // _setValue2(DartEntry.SCAN_ERRORS, <AnalysisError> [new AnalysisError.con1
(null, ScannerErrorCode.UNTERMINATED_MULTI_LINE_COMMENT, [])]); |
| 2901 // } |
| 2902 // void test_setValue_sourceKind() { |
| 2903 // _setValue2(DartEntry.SOURCE_KIND, SourceKind.LIBRARY); |
| 2904 // } |
| 2905 // void test_setValue_tokenStream() { |
| 2906 // _setValue2(DartEntry.TOKEN_STREAM, new Token(TokenType.LT, 5)); |
| 2907 // } |
| 2908 // void test_setValue_verificationErrors() { |
| 2909 // _setValue3(DartEntry.VERIFICATION_ERRORS, <AnalysisError> [new AnalysisEr
ror.con1(null, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, [])]); |
| 2910 // } |
| 2911 // DartEntryImpl _entryWithValidState() { |
| 2912 // DartEntryImpl entry = new DartEntryImpl(); |
| 2913 // entry.setValue(DartEntry.ELEMENT, null); |
| 2914 // entry.setValue(DartEntry.EXPORTED_LIBRARIES, null); |
| 2915 // entry.setValue(DartEntry.IMPORTED_LIBRARIES, null); |
| 2916 // entry.setValue(DartEntry.INCLUDED_PARTS, null); |
| 2917 // entry.setValue(DartEntry.IS_CLIENT, true); |
| 2918 // entry.setValue(DartEntry.IS_LAUNCHABLE, true); |
| 2919 // entry.setValue(SourceEntry.LINE_INFO, null); |
| 2920 // entry.setValue(DartEntry.PARSE_ERRORS, null); |
| 2921 // entry.setValue(DartEntry.PARSED_UNIT, null); |
| 2922 // entry.setValue(DartEntry.PUBLIC_NAMESPACE, null); |
| 2923 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.ELEME
NT)); |
| 2924 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.EXPOR
TED_LIBRARIES)); |
| 2925 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IMPOR
TED_LIBRARIES)); |
| 2926 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2927 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_CL
IENT)); |
| 2928 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2929 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2930 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2931 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2932 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2933 // return entry; |
| 2934 // } |
| 2935 // void set state2(DataDescriptor descriptor) { |
| 2936 // DartEntryImpl entry = new DartEntryImpl(); |
| 2937 // JUnitTestCase.assertNotSame(CacheState.FLUSHED, entry.getState(descriptor
)); |
| 2938 // entry.setState(descriptor, CacheState.FLUSHED); |
| 2939 // JUnitTestCase.assertSame(CacheState.FLUSHED, entry.getState(descriptor)); |
| 2940 // } |
| 2941 // void set state3(DataDescriptor descriptor) { |
| 2942 // Source source = new TestSource(); |
| 2943 // DartEntryImpl entry = new DartEntryImpl(); |
| 2944 // JUnitTestCase.assertNotSame(CacheState.FLUSHED, entry.getStateInLibrary(d
escriptor, source)); |
| 2945 // entry.setStateInLibrary(descriptor, source, CacheState.FLUSHED); |
| 2946 // JUnitTestCase.assertSame(CacheState.FLUSHED, entry.getStateInLibrary(desc
riptor, source)); |
| 2947 // } |
| 2948 // void _setValue2(DataDescriptor descriptor, Object newValue) { |
| 2949 // DartEntryImpl entry = new DartEntryImpl(); |
| 2950 // Object value = entry.getValue(descriptor); |
| 2951 // JUnitTestCase.assertNotSame(value, newValue); |
| 2952 // entry.setValue(descriptor, newValue); |
| 2953 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(descriptor)); |
| 2954 // JUnitTestCase.assertSame(newValue, entry.getValue(descriptor)); |
| 2955 // } |
| 2956 // void _setValue3(DataDescriptor descriptor, Object newValue) { |
| 2957 // Source source = new TestSource(); |
| 2958 // DartEntryImpl entry = new DartEntryImpl(); |
| 2959 // Object value = entry.getValueInLibrary(descriptor, source); |
| 2960 // JUnitTestCase.assertNotSame(value, newValue); |
| 2961 // entry.setValueInLibrary(descriptor, source, newValue); |
| 2962 // JUnitTestCase.assertSame(CacheState.VALID, entry.getStateInLibrary(descri
ptor, source)); |
| 2963 // JUnitTestCase.assertSame(newValue, entry.getValueInLibrary(descriptor, so
urce)); |
| 2964 // } |
| 2965 // static dartSuite() { |
| 2966 // _ut.group('DartEntryImplTest', () { |
| 2967 // _ut.test('test_creation', () { |
| 2968 // final __test = new DartEntryImplTest(); |
| 2969 // runJUnitTest(__test, __test.test_creation); |
| 2970 // }); |
| 2971 // _ut.test('test_getAllErrors', () { |
| 2972 // final __test = new DartEntryImplTest(); |
| 2973 // runJUnitTest(__test, __test.test_getAllErrors); |
| 2974 // }); |
| 2975 // _ut.test('test_getResolvableCompilationUnit_none', () { |
| 2976 // final __test = new DartEntryImplTest(); |
| 2977 // runJUnitTest(__test, __test.test_getResolvableCompilationUnit_none); |
| 2978 // }); |
| 2979 // _ut.test('test_getResolvableCompilationUnit_parsed_accessed', () { |
| 2980 // final __test = new DartEntryImplTest(); |
| 2981 // runJUnitTest(__test, __test.test_getResolvableCompilationUnit_parsed_
accessed); |
| 2982 // }); |
| 2983 // _ut.test('test_getResolvableCompilationUnit_parsed_notAccessed', () { |
| 2984 // final __test = new DartEntryImplTest(); |
| 2985 // runJUnitTest(__test, __test.test_getResolvableCompilationUnit_parsed_
notAccessed); |
| 2986 // }); |
| 2987 // _ut.test('test_getResolvableCompilationUnit_resolved', () { |
| 2988 // final __test = new DartEntryImplTest(); |
| 2989 // runJUnitTest(__test, __test.test_getResolvableCompilationUnit_resolve
d); |
| 2990 // }); |
| 2991 // _ut.test('test_getStateInLibrary_invalid_element', () { |
| 2992 // final __test = new DartEntryImplTest(); |
| 2993 // runJUnitTest(__test, __test.test_getStateInLibrary_invalid_element); |
| 2994 // }); |
| 2995 // _ut.test('test_getState_invalid_buildElementErrors', () { |
| 2996 // final __test = new DartEntryImplTest(); |
| 2997 // runJUnitTest(__test, __test.test_getState_invalid_buildElementErrors)
; |
| 2998 // }); |
| 2999 // _ut.test('test_getState_invalid_resolutionErrors', () { |
| 3000 // final __test = new DartEntryImplTest(); |
| 3001 // runJUnitTest(__test, __test.test_getState_invalid_resolutionErrors); |
| 3002 // }); |
| 3003 // _ut.test('test_getState_invalid_verificationErrors', () { |
| 3004 // final __test = new DartEntryImplTest(); |
| 3005 // runJUnitTest(__test, __test.test_getState_invalid_verificationErrors)
; |
| 3006 // }); |
| 3007 // _ut.test('test_getValueInLibrary_invalid_element', () { |
| 3008 // final __test = new DartEntryImplTest(); |
| 3009 // runJUnitTest(__test, __test.test_getValueInLibrary_invalid_element); |
| 3010 // }); |
| 3011 // _ut.test('test_getValueInLibrary_invalid_resolutionErrors_multiple', ()
{ |
| 3012 // final __test = new DartEntryImplTest(); |
| 3013 // runJUnitTest(__test, __test.test_getValueInLibrary_invalid_resolution
Errors_multiple); |
| 3014 // }); |
| 3015 // _ut.test('test_getValue_containingLibraries', () { |
| 3016 // final __test = new DartEntryImplTest(); |
| 3017 // runJUnitTest(__test, __test.test_getValue_containingLibraries); |
| 3018 // }); |
| 3019 // _ut.test('test_getValue_invalid_buildElementErrors', () { |
| 3020 // final __test = new DartEntryImplTest(); |
| 3021 // runJUnitTest(__test, __test.test_getValue_invalid_buildElementErrors)
; |
| 3022 // }); |
| 3023 // _ut.test('test_getValue_invalid_resolutionErrors', () { |
| 3024 // final __test = new DartEntryImplTest(); |
| 3025 // runJUnitTest(__test, __test.test_getValue_invalid_resolutionErrors); |
| 3026 // }); |
| 3027 // _ut.test('test_getValue_invalid_verificationErrors', () { |
| 3028 // final __test = new DartEntryImplTest(); |
| 3029 // runJUnitTest(__test, __test.test_getValue_invalid_verificationErrors)
; |
| 3030 // }); |
| 3031 // _ut.test('test_getWritableCopy', () { |
| 3032 // final __test = new DartEntryImplTest(); |
| 3033 // runJUnitTest(__test, __test.test_getWritableCopy); |
| 3034 // }); |
| 3035 // _ut.test('test_hasInvalidData_false', () { |
| 3036 // final __test = new DartEntryImplTest(); |
| 3037 // runJUnitTest(__test, __test.test_hasInvalidData_false); |
| 3038 // }); |
| 3039 // _ut.test('test_hasInvalidData_true', () { |
| 3040 // final __test = new DartEntryImplTest(); |
| 3041 // runJUnitTest(__test, __test.test_hasInvalidData_true); |
| 3042 // }); |
| 3043 // _ut.test('test_invalidateAllInformation', () { |
| 3044 // final __test = new DartEntryImplTest(); |
| 3045 // runJUnitTest(__test, __test.test_invalidateAllInformation); |
| 3046 // }); |
| 3047 // _ut.test('test_invalidateAllResolutionInformation', () { |
| 3048 // final __test = new DartEntryImplTest(); |
| 3049 // runJUnitTest(__test, __test.test_invalidateAllResolutionInformation); |
| 3050 // }); |
| 3051 // _ut.test('test_invalidateAllResolutionInformation_includingUris', () { |
| 3052 // final __test = new DartEntryImplTest(); |
| 3053 // runJUnitTest(__test, __test.test_invalidateAllResolutionInformation_i
ncludingUris); |
| 3054 // }); |
| 3055 // _ut.test('test_isClient', () { |
| 3056 // final __test = new DartEntryImplTest(); |
| 3057 // runJUnitTest(__test, __test.test_isClient); |
| 3058 // }); |
| 3059 // _ut.test('test_isLaunchable', () { |
| 3060 // final __test = new DartEntryImplTest(); |
| 3061 // runJUnitTest(__test, __test.test_isLaunchable); |
| 3062 // }); |
| 3063 // _ut.test('test_recordBuildElementErrorInLibrary', () { |
| 3064 // final __test = new DartEntryImplTest(); |
| 3065 // runJUnitTest(__test, __test.test_recordBuildElementErrorInLibrary); |
| 3066 // }); |
| 3067 // _ut.test('test_recordContentError', () { |
| 3068 // final __test = new DartEntryImplTest(); |
| 3069 // runJUnitTest(__test, __test.test_recordContentError); |
| 3070 // }); |
| 3071 // _ut.test('test_recordHintErrorInLibrary', () { |
| 3072 // final __test = new DartEntryImplTest(); |
| 3073 // runJUnitTest(__test, __test.test_recordHintErrorInLibrary); |
| 3074 // }); |
| 3075 // _ut.test('test_recordParseError', () { |
| 3076 // final __test = new DartEntryImplTest(); |
| 3077 // runJUnitTest(__test, __test.test_recordParseError); |
| 3078 // }); |
| 3079 // _ut.test('test_recordParseInProcess', () { |
| 3080 // final __test = new DartEntryImplTest(); |
| 3081 // runJUnitTest(__test, __test.test_recordParseInProcess); |
| 3082 // }); |
| 3083 // _ut.test('test_recordResolutionError', () { |
| 3084 // final __test = new DartEntryImplTest(); |
| 3085 // runJUnitTest(__test, __test.test_recordResolutionError); |
| 3086 // }); |
| 3087 // _ut.test('test_recordResolutionErrorInLibrary', () { |
| 3088 // final __test = new DartEntryImplTest(); |
| 3089 // runJUnitTest(__test, __test.test_recordResolutionErrorInLibrary); |
| 3090 // }); |
| 3091 // _ut.test('test_recordScanError', () { |
| 3092 // final __test = new DartEntryImplTest(); |
| 3093 // runJUnitTest(__test, __test.test_recordScanError); |
| 3094 // }); |
| 3095 // _ut.test('test_recordScanInProcess', () { |
| 3096 // final __test = new DartEntryImplTest(); |
| 3097 // runJUnitTest(__test, __test.test_recordScanInProcess); |
| 3098 // }); |
| 3099 // _ut.test('test_recordVerificationErrorInLibrary', () { |
| 3100 // final __test = new DartEntryImplTest(); |
| 3101 // runJUnitTest(__test, __test.test_recordVerificationErrorInLibrary); |
| 3102 // }); |
| 3103 // _ut.test('test_removeResolution_multiple_first', () { |
| 3104 // final __test = new DartEntryImplTest(); |
| 3105 // runJUnitTest(__test, __test.test_removeResolution_multiple_first); |
| 3106 // }); |
| 3107 // _ut.test('test_removeResolution_multiple_last', () { |
| 3108 // final __test = new DartEntryImplTest(); |
| 3109 // runJUnitTest(__test, __test.test_removeResolution_multiple_last); |
| 3110 // }); |
| 3111 // _ut.test('test_removeResolution_multiple_middle', () { |
| 3112 // final __test = new DartEntryImplTest(); |
| 3113 // runJUnitTest(__test, __test.test_removeResolution_multiple_middle); |
| 3114 // }); |
| 3115 // _ut.test('test_removeResolution_single', () { |
| 3116 // final __test = new DartEntryImplTest(); |
| 3117 // runJUnitTest(__test, __test.test_removeResolution_single); |
| 3118 // }); |
| 3119 // _ut.test('test_resolutionState', () { |
| 3120 // final __test = new DartEntryImplTest(); |
| 3121 // runJUnitTest(__test, __test.test_resolutionState); |
| 3122 // }); |
| 3123 // _ut.test('test_setState_buildElementErrors', () { |
| 3124 // final __test = new DartEntryImplTest(); |
| 3125 // runJUnitTest(__test, __test.test_setState_buildElementErrors); |
| 3126 // }); |
| 3127 // _ut.test('test_setState_element', () { |
| 3128 // final __test = new DartEntryImplTest(); |
| 3129 // runJUnitTest(__test, __test.test_setState_element); |
| 3130 // }); |
| 3131 // _ut.test('test_setState_exportedLibraries', () { |
| 3132 // final __test = new DartEntryImplTest(); |
| 3133 // runJUnitTest(__test, __test.test_setState_exportedLibraries); |
| 3134 // }); |
| 3135 // _ut.test('test_setState_hints', () { |
| 3136 // final __test = new DartEntryImplTest(); |
| 3137 // runJUnitTest(__test, __test.test_setState_hints); |
| 3138 // }); |
| 3139 // _ut.test('test_setState_importedLibraries', () { |
| 3140 // final __test = new DartEntryImplTest(); |
| 3141 // runJUnitTest(__test, __test.test_setState_importedLibraries); |
| 3142 // }); |
| 3143 // _ut.test('test_setState_includedParts', () { |
| 3144 // final __test = new DartEntryImplTest(); |
| 3145 // runJUnitTest(__test, __test.test_setState_includedParts); |
| 3146 // }); |
| 3147 // _ut.test('test_setState_invalid_buildElementErrors', () { |
| 3148 // final __test = new DartEntryImplTest(); |
| 3149 // runJUnitTest(__test, __test.test_setState_invalid_buildElementErrors)
; |
| 3150 // }); |
| 3151 // _ut.test('test_setState_invalid_element', () { |
| 3152 // final __test = new DartEntryImplTest(); |
| 3153 // runJUnitTest(__test, __test.test_setState_invalid_element); |
| 3154 // }); |
| 3155 // _ut.test('test_setState_invalid_resolutionErrors', () { |
| 3156 // final __test = new DartEntryImplTest(); |
| 3157 // runJUnitTest(__test, __test.test_setState_invalid_resolutionErrors); |
| 3158 // }); |
| 3159 // _ut.test('test_setState_invalid_validState', () { |
| 3160 // final __test = new DartEntryImplTest(); |
| 3161 // runJUnitTest(__test, __test.test_setState_invalid_validState); |
| 3162 // }); |
| 3163 // _ut.test('test_setState_invalid_verificationErrors', () { |
| 3164 // final __test = new DartEntryImplTest(); |
| 3165 // runJUnitTest(__test, __test.test_setState_invalid_verificationErrors)
; |
| 3166 // }); |
| 3167 // _ut.test('test_setState_isClient', () { |
| 3168 // final __test = new DartEntryImplTest(); |
| 3169 // runJUnitTest(__test, __test.test_setState_isClient); |
| 3170 // }); |
| 3171 // _ut.test('test_setState_isLaunchable', () { |
| 3172 // final __test = new DartEntryImplTest(); |
| 3173 // runJUnitTest(__test, __test.test_setState_isLaunchable); |
| 3174 // }); |
| 3175 // _ut.test('test_setState_lineInfo', () { |
| 3176 // final __test = new DartEntryImplTest(); |
| 3177 // runJUnitTest(__test, __test.test_setState_lineInfo); |
| 3178 // }); |
| 3179 // _ut.test('test_setState_parseErrors', () { |
| 3180 // final __test = new DartEntryImplTest(); |
| 3181 // runJUnitTest(__test, __test.test_setState_parseErrors); |
| 3182 // }); |
| 3183 // _ut.test('test_setState_parsedUnit', () { |
| 3184 // final __test = new DartEntryImplTest(); |
| 3185 // runJUnitTest(__test, __test.test_setState_parsedUnit); |
| 3186 // }); |
| 3187 // _ut.test('test_setState_publicNamespace', () { |
| 3188 // final __test = new DartEntryImplTest(); |
| 3189 // runJUnitTest(__test, __test.test_setState_publicNamespace); |
| 3190 // }); |
| 3191 // _ut.test('test_setState_resolutionErrors', () { |
| 3192 // final __test = new DartEntryImplTest(); |
| 3193 // runJUnitTest(__test, __test.test_setState_resolutionErrors); |
| 3194 // }); |
| 3195 // _ut.test('test_setState_resolvedUnit', () { |
| 3196 // final __test = new DartEntryImplTest(); |
| 3197 // runJUnitTest(__test, __test.test_setState_resolvedUnit); |
| 3198 // }); |
| 3199 // _ut.test('test_setState_scanErrors', () { |
| 3200 // final __test = new DartEntryImplTest(); |
| 3201 // runJUnitTest(__test, __test.test_setState_scanErrors); |
| 3202 // }); |
| 3203 // _ut.test('test_setState_sourceKind', () { |
| 3204 // final __test = new DartEntryImplTest(); |
| 3205 // runJUnitTest(__test, __test.test_setState_sourceKind); |
| 3206 // }); |
| 3207 // _ut.test('test_setState_tokenStream', () { |
| 3208 // final __test = new DartEntryImplTest(); |
| 3209 // runJUnitTest(__test, __test.test_setState_tokenStream); |
| 3210 // }); |
| 3211 // _ut.test('test_setState_verificationErrors', () { |
| 3212 // final __test = new DartEntryImplTest(); |
| 3213 // runJUnitTest(__test, __test.test_setState_verificationErrors); |
| 3214 // }); |
| 3215 // _ut.test('test_setValue_buildElementErrors', () { |
| 3216 // final __test = new DartEntryImplTest(); |
| 3217 // runJUnitTest(__test, __test.test_setValue_buildElementErrors); |
| 3218 // }); |
| 3219 // _ut.test('test_setValue_element', () { |
| 3220 // final __test = new DartEntryImplTest(); |
| 3221 // runJUnitTest(__test, __test.test_setValue_element); |
| 3222 // }); |
| 3223 // _ut.test('test_setValue_exportedLibraries', () { |
| 3224 // final __test = new DartEntryImplTest(); |
| 3225 // runJUnitTest(__test, __test.test_setValue_exportedLibraries); |
| 3226 // }); |
| 3227 // _ut.test('test_setValue_hints', () { |
| 3228 // final __test = new DartEntryImplTest(); |
| 3229 // runJUnitTest(__test, __test.test_setValue_hints); |
| 3230 // }); |
| 3231 // _ut.test('test_setValue_importedLibraries', () { |
| 3232 // final __test = new DartEntryImplTest(); |
| 3233 // runJUnitTest(__test, __test.test_setValue_importedLibraries); |
| 3234 // }); |
| 3235 // _ut.test('test_setValue_includedParts', () { |
| 3236 // final __test = new DartEntryImplTest(); |
| 3237 // runJUnitTest(__test, __test.test_setValue_includedParts); |
| 3238 // }); |
| 3239 // _ut.test('test_setValue_isClient', () { |
| 3240 // final __test = new DartEntryImplTest(); |
| 3241 // runJUnitTest(__test, __test.test_setValue_isClient); |
| 3242 // }); |
| 3243 // _ut.test('test_setValue_isLaunchable', () { |
| 3244 // final __test = new DartEntryImplTest(); |
| 3245 // runJUnitTest(__test, __test.test_setValue_isLaunchable); |
| 3246 // }); |
| 3247 // _ut.test('test_setValue_lineInfo', () { |
| 3248 // final __test = new DartEntryImplTest(); |
| 3249 // runJUnitTest(__test, __test.test_setValue_lineInfo); |
| 3250 // }); |
| 3251 // _ut.test('test_setValue_parseErrors', () { |
| 3252 // final __test = new DartEntryImplTest(); |
| 3253 // runJUnitTest(__test, __test.test_setValue_parseErrors); |
| 3254 // }); |
| 3255 // _ut.test('test_setValue_parsedUnit', () { |
| 3256 // final __test = new DartEntryImplTest(); |
| 3257 // runJUnitTest(__test, __test.test_setValue_parsedUnit); |
| 3258 // }); |
| 3259 // _ut.test('test_setValue_publicNamespace', () { |
| 3260 // final __test = new DartEntryImplTest(); |
| 3261 // runJUnitTest(__test, __test.test_setValue_publicNamespace); |
| 3262 // }); |
| 3263 // _ut.test('test_setValue_resolutionErrors', () { |
| 3264 // final __test = new DartEntryImplTest(); |
| 3265 // runJUnitTest(__test, __test.test_setValue_resolutionErrors); |
| 3266 // }); |
| 3267 // _ut.test('test_setValue_resolvedUnit', () { |
| 3268 // final __test = new DartEntryImplTest(); |
| 3269 // runJUnitTest(__test, __test.test_setValue_resolvedUnit); |
| 3270 // }); |
| 3271 // _ut.test('test_setValue_scanErrors', () { |
| 3272 // final __test = new DartEntryImplTest(); |
| 3273 // runJUnitTest(__test, __test.test_setValue_scanErrors); |
| 3274 // }); |
| 3275 // _ut.test('test_setValue_sourceKind', () { |
| 3276 // final __test = new DartEntryImplTest(); |
| 3277 // runJUnitTest(__test, __test.test_setValue_sourceKind); |
| 3278 // }); |
| 3279 // _ut.test('test_setValue_tokenStream', () { |
| 3280 // final __test = new DartEntryImplTest(); |
| 3281 // runJUnitTest(__test, __test.test_setValue_tokenStream); |
| 3282 // }); |
| 3283 // _ut.test('test_setValue_verificationErrors', () { |
| 3284 // final __test = new DartEntryImplTest(); |
| 3285 // runJUnitTest(__test, __test.test_setValue_verificationErrors); |
| 3286 // }); |
| 3287 // }); |
| 3288 // } |
| 3289 // } |
| 3290 // class GenerateDartErrorsTaskTest extends EngineTestCase { |
| 3291 // void test_accept() { |
| 3292 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(null, null, 0, n
ull, null); |
| 3293 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_GenerateDartErro
rsTaskTest_test_accept())); |
| 3294 // } |
| 3295 // void test_getException() { |
| 3296 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(null, null, 0, n
ull, null); |
| 3297 // JUnitTestCase.assertNull(task.exception); |
| 3298 // } |
| 3299 // void test_getLibraryElement() { |
| 3300 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 3301 // LibraryElement element = ElementFactory.library(context, "lib"); |
| 3302 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(context, null, 0
, null, element); |
| 3303 // JUnitTestCase.assertSame(element, task.libraryElement); |
| 3304 // } |
| 3305 // void test_getSource() { |
| 3306 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 3307 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(null, source, 0,
null, null); |
| 3308 // JUnitTestCase.assertSame(source, task.source); |
| 3309 // } |
| 3310 // void test_perform() { |
| 3311 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 3312 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 3313 // ChangeSet changeSet = new ChangeSet(); |
| 3314 // changeSet.addedSource(source); |
| 3315 // context.applyChanges(changeSet); |
| 3316 // context.setContents(source, EngineTestCase.createSource(["library lib;",
"class A {", " int f = new A();", "}"])); |
| 3317 // LibraryElement libraryElement = context.computeLibraryElement(source); |
| 3318 // CompilationUnit unit = context.getResolvedCompilationUnit(source, library
Element); |
| 3319 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(context, source,
context.getModificationStamp(source), unit, libraryElement); |
| 3320 // task.perform(new TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform(
libraryElement, source)); |
| 3321 // } |
| 3322 // void test_perform_validateDirectives() { |
| 3323 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 3324 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 3325 // ChangeSet changeSet = new ChangeSet(); |
| 3326 // changeSet.addedSource(source); |
| 3327 // context.applyChanges(changeSet); |
| 3328 // context.setContents(source, EngineTestCase.createSource([ |
| 3329 // "library lib;", |
| 3330 // "import 'invaliduri^.dart';", |
| 3331 // "export '\${a}lib3.dart';", |
| 3332 // "part '/does/not/exist.dart';", |
| 3333 // "class A {}"])); |
| 3334 // LibraryElement libraryElement = context.computeLibraryElement(source); |
| 3335 // CompilationUnit unit = context.getResolvedCompilationUnit(source, library
Element); |
| 3336 // GenerateDartErrorsTask task = new GenerateDartErrorsTask(context, source,
context.getModificationStamp(source), unit, libraryElement); |
| 3337 // task.perform(new TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform_
validateDirectives(libraryElement, source)); |
| 3338 // } |
| 3339 // static dartSuite() { |
| 3340 // _ut.group('GenerateDartErrorsTaskTest', () { |
| 3341 // _ut.test('test_accept', () { |
| 3342 // final __test = new GenerateDartErrorsTaskTest(); |
| 3343 // runJUnitTest(__test, __test.test_accept); |
| 3344 // }); |
| 3345 // _ut.test('test_getException', () { |
| 3346 // final __test = new GenerateDartErrorsTaskTest(); |
| 3347 // runJUnitTest(__test, __test.test_getException); |
| 3348 // }); |
| 3349 // _ut.test('test_getLibraryElement', () { |
| 3350 // final __test = new GenerateDartErrorsTaskTest(); |
| 3351 // runJUnitTest(__test, __test.test_getLibraryElement); |
| 3352 // }); |
| 3353 // _ut.test('test_getSource', () { |
| 3354 // final __test = new GenerateDartErrorsTaskTest(); |
| 3355 // runJUnitTest(__test, __test.test_getSource); |
| 3356 // }); |
| 3357 // _ut.test('test_perform', () { |
| 3358 // final __test = new GenerateDartErrorsTaskTest(); |
| 3359 // runJUnitTest(__test, __test.test_perform); |
| 3360 // }); |
| 3361 // _ut.test('test_perform_validateDirectives', () { |
| 3362 // final __test = new GenerateDartErrorsTaskTest(); |
| 3363 // runJUnitTest(__test, __test.test_perform_validateDirectives); |
| 3364 // }); |
| 3365 // }); |
| 3366 // } |
| 3367 // } |
| 3368 // class GenerateDartHintsTaskTest extends EngineTestCase { |
| 3369 // void test_accept() { |
| 3370 // GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null); |
| 3371 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_GenerateDartHint
sTaskTest_test_accept())); |
| 3372 // } |
| 3373 // void test_getException() { |
| 3374 // GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null); |
| 3375 // JUnitTestCase.assertNull(task.exception); |
| 3376 // } |
| 3377 // void test_getHintMap() { |
| 3378 // GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null); |
| 3379 // JUnitTestCase.assertNull(task.hintMap); |
| 3380 // } |
| 3381 // void test_getLibraryElement() { |
| 3382 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 3383 // LibraryElement element = ElementFactory.library(context, "lib"); |
| 3384 // GenerateDartHintsTask task = new GenerateDartHintsTask(context, null, ele
ment); |
| 3385 // JUnitTestCase.assertSame(element, task.libraryElement); |
| 3386 // } |
| 3387 // void test_perform() { |
| 3388 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 3389 // ChangeSet changeSet = new ChangeSet(); |
| 3390 // Source librarySource = new FileBasedSource.con1(FileUtilities2.createFile
("/test.dart")); |
| 3391 // changeSet.addedSource(librarySource); |
| 3392 // Source unusedSource = new FileBasedSource.con1(FileUtilities2.createFile(
"/unused.dart")); |
| 3393 // changeSet.addedSource(unusedSource); |
| 3394 // Source partSource = new FileBasedSource.con1(FileUtilities2.createFile("/
part.dart")); |
| 3395 // changeSet.addedSource(partSource); |
| 3396 // context.applyChanges(changeSet); |
| 3397 // context.setContents(librarySource, EngineTestCase.createSource([ |
| 3398 // "library lib;", |
| 3399 // "import 'unused.dart';", |
| 3400 // "part 'part.dart';"])); |
| 3401 // context.setContents(unusedSource, EngineTestCase.createSource(["library u
nused;"])); |
| 3402 // context.setContents(partSource, EngineTestCase.createSource(["part of lib
;"])); |
| 3403 // List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(
2); |
| 3404 // units[0] = new TimestampedData<CompilationUnit>(context.getModificationSt
amp(librarySource), context.resolveCompilationUnit2(librarySource, librarySource
)); |
| 3405 // units[1] = new TimestampedData<CompilationUnit>(context.getModificationSt
amp(partSource), context.resolveCompilationUnit2(partSource, librarySource)); |
| 3406 // GenerateDartHintsTask task = new GenerateDartHintsTask(context, units, co
ntext.computeLibraryElement(librarySource)); |
| 3407 // task.perform(new TestTaskVisitor_GenerateDartHintsTaskTest_test_perform(l
ibrarySource, partSource)); |
| 3408 // } |
| 3409 // static dartSuite() { |
| 3410 // _ut.group('GenerateDartHintsTaskTest', () { |
| 3411 // _ut.test('test_accept', () { |
| 3412 // final __test = new GenerateDartHintsTaskTest(); |
| 3413 // runJUnitTest(__test, __test.test_accept); |
| 3414 // }); |
| 3415 // _ut.test('test_getException', () { |
| 3416 // final __test = new GenerateDartHintsTaskTest(); |
| 3417 // runJUnitTest(__test, __test.test_getException); |
| 3418 // }); |
| 3419 // _ut.test('test_getHintMap', () { |
| 3420 // final __test = new GenerateDartHintsTaskTest(); |
| 3421 // runJUnitTest(__test, __test.test_getHintMap); |
| 3422 // }); |
| 3423 // _ut.test('test_getLibraryElement', () { |
| 3424 // final __test = new GenerateDartHintsTaskTest(); |
| 3425 // runJUnitTest(__test, __test.test_getLibraryElement); |
| 3426 // }); |
| 3427 // _ut.test('test_perform', () { |
| 3428 // final __test = new GenerateDartHintsTaskTest(); |
| 3429 // runJUnitTest(__test, __test.test_perform); |
| 3430 // }); |
| 3431 // }); |
| 3432 // } |
| 3433 // } |
| 3434 // class GetContentTaskTest extends EngineTestCase { |
| 3435 // void test_accept() { |
| 3436 // Source source = new TestSource.con2(""); |
| 3437 // GetContentTask task = new GetContentTask(null, source); |
| 3438 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_GetContentTaskTe
st_test_accept())); |
| 3439 // } |
| 3440 // void test_getException() { |
| 3441 // Source source = new TestSource.con2(""); |
| 3442 // GetContentTask task = new GetContentTask(null, source); |
| 3443 // JUnitTestCase.assertNull(task.exception); |
| 3444 // } |
| 3445 // void test_getModificationTime() { |
| 3446 // Source source = new TestSource.con2(""); |
| 3447 // GetContentTask task = new GetContentTask(null, source); |
| 3448 // JUnitTestCase.assertEquals(-1, task.modificationTime); |
| 3449 // } |
| 3450 // void test_getSource() { |
| 3451 // Source source = new TestSource.con2(""); |
| 3452 // GetContentTask task = new GetContentTask(null, source); |
| 3453 // JUnitTestCase.assertSame(source, task.source); |
| 3454 // } |
| 3455 // void test_perform_exception() { |
| 3456 // TestSource source = new TestSource(); |
| 3457 // source.generateExceptionOnRead = true; |
| 3458 // // final InternalAnalysisContext context = new AnalysisContextImpl(); |
| 3459 // // context.setSourceFactory(new SourceFactory(new FileUriResolver())); |
| 3460 // GetContentTask task = new GetContentTask(null, source); |
| 3461 // task.perform(new TestTaskVisitor_GetContentTaskTest_test_perform_exceptio
n()); |
| 3462 // } |
| 3463 // void test_perform_valid() { |
| 3464 // String content = EngineTestCase.createSource(["class A {}"]); |
| 3465 // Source source = new TestSource.con2(content); |
| 3466 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 3467 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 3468 // GetContentTask task = new GetContentTask(context, source); |
| 3469 // task.perform(new TestTaskVisitor_GetContentTaskTest_test_perform_valid(co
ntext, source)); |
| 3470 // } |
| 3471 // static dartSuite() { |
| 3472 // _ut.group('GetContentTaskTest', () { |
| 3473 // _ut.test('test_accept', () { |
| 3474 // final __test = new GetContentTaskTest(); |
| 3475 // runJUnitTest(__test, __test.test_accept); |
| 3476 // }); |
| 3477 // _ut.test('test_getException', () { |
| 3478 // final __test = new GetContentTaskTest(); |
| 3479 // runJUnitTest(__test, __test.test_getException); |
| 3480 // }); |
| 3481 // _ut.test('test_getModificationTime', () { |
| 3482 // final __test = new GetContentTaskTest(); |
| 3483 // runJUnitTest(__test, __test.test_getModificationTime); |
| 3484 // }); |
| 3485 // _ut.test('test_getSource', () { |
| 3486 // final __test = new GetContentTaskTest(); |
| 3487 // runJUnitTest(__test, __test.test_getSource); |
| 3488 // }); |
| 3489 // _ut.test('test_perform_exception', () { |
| 3490 // final __test = new GetContentTaskTest(); |
| 3491 // runJUnitTest(__test, __test.test_perform_exception); |
| 3492 // }); |
| 3493 // _ut.test('test_perform_valid', () { |
| 3494 // final __test = new GetContentTaskTest(); |
| 3495 // runJUnitTest(__test, __test.test_perform_valid); |
| 3496 // }); |
| 3497 // }); |
| 3498 // } |
| 3499 // } |
| 3500 // class HtmlEntryImplTest extends EngineTestCase { |
| 3501 // void test_creation() { |
| 3502 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3503 // JUnitTestCase.assertNotNull(entry); |
| 3504 // } |
| 3505 // void test_getAllErrors() { |
| 3506 // Source source = new TestSource(); |
| 3507 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3508 // EngineTestCase.assertLength(0, entry.allErrors); |
| 3509 // entry.setValue(HtmlEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError
.con1(source, ParserErrorCode.EXPECTED_TOKEN, [";"])]); |
| 3510 // entry.setValue(HtmlEntry.RESOLUTION_ERRORS, <AnalysisError> [new Analysis
Error.con1(source, HtmlWarningCode.INVALID_URI, ["-"])]); |
| 3511 // entry.setValue(HtmlEntry.ANGULAR_ERRORS, <AnalysisError> [new AnalysisErr
or.con1(source, AngularCode.INVALID_REPEAT_SYNTAX, ["-"])]); |
| 3512 // entry.setValue(HtmlEntry.POLYMER_BUILD_ERRORS, <AnalysisError> [new Analy
sisError.con1(source, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]); |
| 3513 // entry.setValue(HtmlEntry.POLYMER_RESOLUTION_ERRORS, <AnalysisError> [new
AnalysisError.con1(source, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]); |
| 3514 // entry.setValue(HtmlEntry.HINTS, <AnalysisError> [new AnalysisError.con1(s
ource, HintCode.DEAD_CODE, [])]); |
| 3515 // EngineTestCase.assertLength(6, entry.allErrors); |
| 3516 // } |
| 3517 // void test_getWritableCopy() { |
| 3518 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3519 // HtmlEntryImpl copy = entry.writableCopy; |
| 3520 // JUnitTestCase.assertNotNull(copy); |
| 3521 // JUnitTestCase.assertNotSame(entry, copy); |
| 3522 // } |
| 3523 // void test_invalidateAllResolutionInformation() { |
| 3524 // HtmlEntryImpl entry = _entryWithValidState(); |
| 3525 // entry.invalidateAllResolutionInformation(false); |
| 3526 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ANGUL
AR_APPLICATION)); |
| 3527 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ANGUL
AR_COMPONENT)); |
| 3528 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ANG
ULAR_ENTRY)); |
| 3529 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ANG
ULAR_ERRORS)); |
| 3530 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.POL
YMER_BUILD_ERRORS)); |
| 3531 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.POL
YMER_RESOLUTION_ERRORS)); |
| 3532 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ELE
MENT)); |
| 3533 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.HIN
TS)); |
| 3534 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 3535 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
_ERRORS)); |
| 3536 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
D_UNIT)); |
| 3537 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.REFER
ENCED_LIBRARIES)); |
| 3538 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.RES
OLUTION_ERRORS)); |
| 3539 // } |
| 3540 // void test_invalidateAllResolutionInformation_includingUris() { |
| 3541 // HtmlEntryImpl entry = _entryWithValidState(); |
| 3542 // entry.invalidateAllResolutionInformation(true); |
| 3543 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ANGUL
AR_APPLICATION)); |
| 3544 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ANGUL
AR_COMPONENT)); |
| 3545 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ANG
ULAR_ENTRY)); |
| 3546 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ANG
ULAR_ERRORS)); |
| 3547 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.POL
YMER_BUILD_ERRORS)); |
| 3548 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.POL
YMER_RESOLUTION_ERRORS)); |
| 3549 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.ELE
MENT)); |
| 3550 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.HIN
TS)); |
| 3551 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 3552 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
_ERRORS)); |
| 3553 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
D_UNIT)); |
| 3554 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.REF
ERENCED_LIBRARIES)); |
| 3555 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(HtmlEntry.RES
OLUTION_ERRORS)); |
| 3556 // } |
| 3557 // void test_setState_angularErrors() { |
| 3558 // state = HtmlEntry.ANGULAR_ERRORS; |
| 3559 // } |
| 3560 // void test_setState_element() { |
| 3561 // state = HtmlEntry.ELEMENT; |
| 3562 // } |
| 3563 // void test_setState_hints() { |
| 3564 // state = HtmlEntry.HINTS; |
| 3565 // } |
| 3566 // void test_setState_lineInfo() { |
| 3567 // state = SourceEntry.LINE_INFO; |
| 3568 // } |
| 3569 // void test_setState_parsedUnit() { |
| 3570 // state = HtmlEntry.PARSED_UNIT; |
| 3571 // } |
| 3572 // void test_setState_parseErrors() { |
| 3573 // state = HtmlEntry.PARSE_ERRORS; |
| 3574 // } |
| 3575 // void test_setState_polymerBuildErrors() { |
| 3576 // state = HtmlEntry.POLYMER_BUILD_ERRORS; |
| 3577 // } |
| 3578 // void test_setState_polymerResolutionErrors() { |
| 3579 // state = HtmlEntry.POLYMER_RESOLUTION_ERRORS; |
| 3580 // } |
| 3581 // void test_setState_referencedLibraries() { |
| 3582 // state = HtmlEntry.REFERENCED_LIBRARIES; |
| 3583 // } |
| 3584 // void test_setState_resolutionErrors() { |
| 3585 // state = HtmlEntry.RESOLUTION_ERRORS; |
| 3586 // } |
| 3587 // void test_setValue_angularErrors() { |
| 3588 // _setValue(HtmlEntry.ANGULAR_ERRORS, <AnalysisError> [new AnalysisError.co
n1(null, AngularCode.INVALID_REPEAT_SYNTAX, ["-"])]); |
| 3589 // } |
| 3590 // void test_setValue_element() { |
| 3591 // _setValue(HtmlEntry.ELEMENT, new HtmlElementImpl(null, "test.html")); |
| 3592 // } |
| 3593 // void test_setValue_hints() { |
| 3594 // _setValue(HtmlEntry.HINTS, <AnalysisError> [new AnalysisError.con1(null,
HintCode.DEAD_CODE, [])]); |
| 3595 // } |
| 3596 // void test_setValue_illegal() { |
| 3597 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3598 // try { |
| 3599 // entry.setValue(DartEntry.ELEMENT, null); |
| 3600 // JUnitTestCase.fail("Expected IllegalArgumentException for DartEntry.ELE
MENT"); |
| 3601 // } on IllegalArgumentException catch (exception) { |
| 3602 // } |
| 3603 // } |
| 3604 // void test_setValue_lineInfo() { |
| 3605 // _setValue(SourceEntry.LINE_INFO, new LineInfo(<int> [0])); |
| 3606 // } |
| 3607 // void test_setValue_parsedUnit() { |
| 3608 // _setValue(HtmlEntry.PARSED_UNIT, new HtmlUnit(null, null, null)); |
| 3609 // } |
| 3610 // void test_setValue_parseErrors() { |
| 3611 // _setValue(HtmlEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError.con1
(null, HtmlWarningCode.INVALID_URI, ["-"])]); |
| 3612 // } |
| 3613 // void test_setValue_polymerBuildErrors() { |
| 3614 // _setValue(HtmlEntry.POLYMER_BUILD_ERRORS, <AnalysisError> [new AnalysisEr
ror.con1(null, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]); |
| 3615 // } |
| 3616 // void test_setValue_polymerResolutionErrors() { |
| 3617 // _setValue(HtmlEntry.POLYMER_RESOLUTION_ERRORS, <AnalysisError> [new Analy
sisError.con1(null, PolymerCode.INVALID_ATTRIBUTE_NAME, ["-"])]); |
| 3618 // } |
| 3619 // void test_setValue_referencedLibraries() { |
| 3620 // _setValue(HtmlEntry.REFERENCED_LIBRARIES, <Source> [new TestSource()]); |
| 3621 // } |
| 3622 // void test_setValue_resolutionErrors() { |
| 3623 // _setValue(HtmlEntry.RESOLUTION_ERRORS, <AnalysisError> [new AnalysisError
.con1(null, HtmlWarningCode.INVALID_URI, ["-"])]); |
| 3624 // } |
| 3625 // HtmlEntryImpl _entryWithValidState() { |
| 3626 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3627 // entry.setValue(HtmlEntry.ANGULAR_ERRORS, null); |
| 3628 // entry.setValue(HtmlEntry.ELEMENT, null); |
| 3629 // entry.setValue(HtmlEntry.HINTS, null); |
| 3630 // entry.setValue(SourceEntry.LINE_INFO, null); |
| 3631 // entry.setValue(HtmlEntry.PARSE_ERRORS, null); |
| 3632 // entry.setValue(HtmlEntry.PARSED_UNIT, null); |
| 3633 // entry.setValue(HtmlEntry.POLYMER_BUILD_ERRORS, null); |
| 3634 // entry.setValue(HtmlEntry.POLYMER_RESOLUTION_ERRORS, null); |
| 3635 // entry.setValue(HtmlEntry.REFERENCED_LIBRARIES, null); |
| 3636 // entry.setValue(HtmlEntry.RESOLUTION_ERRORS, null); |
| 3637 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ANGUL
AR_ERRORS)); |
| 3638 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.ELEME
NT)); |
| 3639 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.HINTS
)); |
| 3640 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(SourceEntry.LIN
E_INFO)); |
| 3641 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
_ERRORS)); |
| 3642 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.PARSE
D_UNIT)); |
| 3643 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.POLYM
ER_BUILD_ERRORS)); |
| 3644 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.POLYM
ER_RESOLUTION_ERRORS)); |
| 3645 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.REFER
ENCED_LIBRARIES)); |
| 3646 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(HtmlEntry.RESOL
UTION_ERRORS)); |
| 3647 // return entry; |
| 3648 // } |
| 3649 // void set state(DataDescriptor descriptor) { |
| 3650 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3651 // JUnitTestCase.assertNotSame(CacheState.FLUSHED, entry.getState(descriptor
)); |
| 3652 // entry.setState(descriptor, CacheState.FLUSHED); |
| 3653 // JUnitTestCase.assertSame(CacheState.FLUSHED, entry.getState(descriptor)); |
| 3654 // } |
| 3655 // void _setValue(DataDescriptor descriptor, Object newValue) { |
| 3656 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3657 // Object value = entry.getValue(descriptor); |
| 3658 // JUnitTestCase.assertNotSame(value, newValue); |
| 3659 // entry.setValue(descriptor, newValue); |
| 3660 // JUnitTestCase.assertSame(CacheState.VALID, entry.getState(descriptor)); |
| 3661 // JUnitTestCase.assertSame(newValue, entry.getValue(descriptor)); |
| 3662 // } |
| 3663 // static dartSuite() { |
| 3664 // _ut.group('HtmlEntryImplTest', () { |
| 3665 // _ut.test('test_creation', () { |
| 3666 // final __test = new HtmlEntryImplTest(); |
| 3667 // runJUnitTest(__test, __test.test_creation); |
| 3668 // }); |
| 3669 // _ut.test('test_getAllErrors', () { |
| 3670 // final __test = new HtmlEntryImplTest(); |
| 3671 // runJUnitTest(__test, __test.test_getAllErrors); |
| 3672 // }); |
| 3673 // _ut.test('test_getWritableCopy', () { |
| 3674 // final __test = new HtmlEntryImplTest(); |
| 3675 // runJUnitTest(__test, __test.test_getWritableCopy); |
| 3676 // }); |
| 3677 // _ut.test('test_invalidateAllResolutionInformation', () { |
| 3678 // final __test = new HtmlEntryImplTest(); |
| 3679 // runJUnitTest(__test, __test.test_invalidateAllResolutionInformation); |
| 3680 // }); |
| 3681 // _ut.test('test_invalidateAllResolutionInformation_includingUris', () { |
| 3682 // final __test = new HtmlEntryImplTest(); |
| 3683 // runJUnitTest(__test, __test.test_invalidateAllResolutionInformation_i
ncludingUris); |
| 3684 // }); |
| 3685 // _ut.test('test_setState_angularErrors', () { |
| 3686 // final __test = new HtmlEntryImplTest(); |
| 3687 // runJUnitTest(__test, __test.test_setState_angularErrors); |
| 3688 // }); |
| 3689 // _ut.test('test_setState_element', () { |
| 3690 // final __test = new HtmlEntryImplTest(); |
| 3691 // runJUnitTest(__test, __test.test_setState_element); |
| 3692 // }); |
| 3693 // _ut.test('test_setState_hints', () { |
| 3694 // final __test = new HtmlEntryImplTest(); |
| 3695 // runJUnitTest(__test, __test.test_setState_hints); |
| 3696 // }); |
| 3697 // _ut.test('test_setState_lineInfo', () { |
| 3698 // final __test = new HtmlEntryImplTest(); |
| 3699 // runJUnitTest(__test, __test.test_setState_lineInfo); |
| 3700 // }); |
| 3701 // _ut.test('test_setState_parseErrors', () { |
| 3702 // final __test = new HtmlEntryImplTest(); |
| 3703 // runJUnitTest(__test, __test.test_setState_parseErrors); |
| 3704 // }); |
| 3705 // _ut.test('test_setState_parsedUnit', () { |
| 3706 // final __test = new HtmlEntryImplTest(); |
| 3707 // runJUnitTest(__test, __test.test_setState_parsedUnit); |
| 3708 // }); |
| 3709 // _ut.test('test_setState_polymerBuildErrors', () { |
| 3710 // final __test = new HtmlEntryImplTest(); |
| 3711 // runJUnitTest(__test, __test.test_setState_polymerBuildErrors); |
| 3712 // }); |
| 3713 // _ut.test('test_setState_polymerResolutionErrors', () { |
| 3714 // final __test = new HtmlEntryImplTest(); |
| 3715 // runJUnitTest(__test, __test.test_setState_polymerResolutionErrors); |
| 3716 // }); |
| 3717 // _ut.test('test_setState_referencedLibraries', () { |
| 3718 // final __test = new HtmlEntryImplTest(); |
| 3719 // runJUnitTest(__test, __test.test_setState_referencedLibraries); |
| 3720 // }); |
| 3721 // _ut.test('test_setState_resolutionErrors', () { |
| 3722 // final __test = new HtmlEntryImplTest(); |
| 3723 // runJUnitTest(__test, __test.test_setState_resolutionErrors); |
| 3724 // }); |
| 3725 // _ut.test('test_setValue_angularErrors', () { |
| 3726 // final __test = new HtmlEntryImplTest(); |
| 3727 // runJUnitTest(__test, __test.test_setValue_angularErrors); |
| 3728 // }); |
| 3729 // _ut.test('test_setValue_element', () { |
| 3730 // final __test = new HtmlEntryImplTest(); |
| 3731 // runJUnitTest(__test, __test.test_setValue_element); |
| 3732 // }); |
| 3733 // _ut.test('test_setValue_hints', () { |
| 3734 // final __test = new HtmlEntryImplTest(); |
| 3735 // runJUnitTest(__test, __test.test_setValue_hints); |
| 3736 // }); |
| 3737 // _ut.test('test_setValue_illegal', () { |
| 3738 // final __test = new HtmlEntryImplTest(); |
| 3739 // runJUnitTest(__test, __test.test_setValue_illegal); |
| 3740 // }); |
| 3741 // _ut.test('test_setValue_lineInfo', () { |
| 3742 // final __test = new HtmlEntryImplTest(); |
| 3743 // runJUnitTest(__test, __test.test_setValue_lineInfo); |
| 3744 // }); |
| 3745 // _ut.test('test_setValue_parseErrors', () { |
| 3746 // final __test = new HtmlEntryImplTest(); |
| 3747 // runJUnitTest(__test, __test.test_setValue_parseErrors); |
| 3748 // }); |
| 3749 // _ut.test('test_setValue_parsedUnit', () { |
| 3750 // final __test = new HtmlEntryImplTest(); |
| 3751 // runJUnitTest(__test, __test.test_setValue_parsedUnit); |
| 3752 // }); |
| 3753 // _ut.test('test_setValue_polymerBuildErrors', () { |
| 3754 // final __test = new HtmlEntryImplTest(); |
| 3755 // runJUnitTest(__test, __test.test_setValue_polymerBuildErrors); |
| 3756 // }); |
| 3757 // _ut.test('test_setValue_polymerResolutionErrors', () { |
| 3758 // final __test = new HtmlEntryImplTest(); |
| 3759 // runJUnitTest(__test, __test.test_setValue_polymerResolutionErrors); |
| 3760 // }); |
| 3761 // _ut.test('test_setValue_referencedLibraries', () { |
| 3762 // final __test = new HtmlEntryImplTest(); |
| 3763 // runJUnitTest(__test, __test.test_setValue_referencedLibraries); |
| 3764 // }); |
| 3765 // _ut.test('test_setValue_resolutionErrors', () { |
| 3766 // final __test = new HtmlEntryImplTest(); |
| 3767 // runJUnitTest(__test, __test.test_setValue_resolutionErrors); |
| 3768 // }); |
| 3769 // }); |
| 3770 // } |
| 3771 // } |
| 3772 // class IncrementalAnalysisCacheTest extends JUnitTestCase { |
| 3773 // Source _source = new TestSource(); |
| 3774 // DartEntryImpl _entry = new DartEntryImpl(); |
| 3775 // CompilationUnit _unit = mock(CompilationUnit); |
| 3776 // IncrementalAnalysisCache _result; |
| 3777 // void test_cacheResult() { |
| 3778 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3779 // CompilationUnit newUnit = mock(CompilationUnit); |
| 3780 // _result = IncrementalAnalysisCache.cacheResult(cache, newUnit); |
| 3781 // JUnitTestCase.assertNotNull(_result); |
| 3782 // JUnitTestCase.assertSame(_source, _result.source); |
| 3783 // JUnitTestCase.assertSame(newUnit, _result.resolvedUnit); |
| 3784 // JUnitTestCase.assertEquals("hbazlo", _result.oldContents); |
| 3785 // JUnitTestCase.assertEquals("hbazlo", _result.newContents); |
| 3786 // JUnitTestCase.assertEquals(0, _result.offset); |
| 3787 // JUnitTestCase.assertEquals(0, _result.oldLength); |
| 3788 // JUnitTestCase.assertEquals(0, _result.newLength); |
| 3789 // } |
| 3790 // void test_cacheResult_noCache() { |
| 3791 // IncrementalAnalysisCache cache = null; |
| 3792 // CompilationUnit newUnit = mock(CompilationUnit); |
| 3793 // _result = IncrementalAnalysisCache.cacheResult(cache, newUnit); |
| 3794 // JUnitTestCase.assertNull(_result); |
| 3795 // } |
| 3796 // void test_cacheResult_noCacheNoResult() { |
| 3797 // IncrementalAnalysisCache cache = null; |
| 3798 // CompilationUnit newUnit = null; |
| 3799 // _result = IncrementalAnalysisCache.cacheResult(cache, newUnit); |
| 3800 // JUnitTestCase.assertNull(_result); |
| 3801 // } |
| 3802 // void test_cacheResult_noResult() { |
| 3803 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3804 // CompilationUnit newUnit = null; |
| 3805 // _result = IncrementalAnalysisCache.cacheResult(cache, newUnit); |
| 3806 // JUnitTestCase.assertNull(_result); |
| 3807 // } |
| 3808 // void test_clear_differentSource() { |
| 3809 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3810 // Source otherSource = new TestSource.con1(new JavaFile("blat.dart"), "blat
"); |
| 3811 // _result = IncrementalAnalysisCache.clear(cache, otherSource); |
| 3812 // JUnitTestCase.assertSame(cache, _result); |
| 3813 // } |
| 3814 // void test_clear_nullCache() { |
| 3815 // IncrementalAnalysisCache cache = null; |
| 3816 // _result = IncrementalAnalysisCache.clear(cache, _source); |
| 3817 // JUnitTestCase.assertNull(_result); |
| 3818 // } |
| 3819 // void test_clear_sameSource() { |
| 3820 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3821 // _result = IncrementalAnalysisCache.clear(cache, _source); |
| 3822 // JUnitTestCase.assertNull(_result); |
| 3823 // } |
| 3824 // void test_update_append() { |
| 3825 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3826 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3827 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbaz
xlo", 4, 0, 1, newEntry); |
| 3828 // JUnitTestCase.assertNotNull(_result); |
| 3829 // JUnitTestCase.assertSame(_source, _result.source); |
| 3830 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3831 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3832 // JUnitTestCase.assertEquals("hbazxlo", _result.newContents); |
| 3833 // JUnitTestCase.assertEquals(1, _result.offset); |
| 3834 // JUnitTestCase.assertEquals(2, _result.oldLength); |
| 3835 // JUnitTestCase.assertEquals(4, _result.newLength); |
| 3836 // } |
| 3837 // void test_update_appendToCachedResult() { |
| 3838 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3839 // CompilationUnit newUnit = mock(CompilationUnit); |
| 3840 // cache = IncrementalAnalysisCache.cacheResult(cache, newUnit); |
| 3841 // JUnitTestCase.assertNotNull(cache); |
| 3842 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3843 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbaz
xlo", 4, 0, 1, newEntry); |
| 3844 // JUnitTestCase.assertNotNull(_result); |
| 3845 // JUnitTestCase.assertSame(_source, _result.source); |
| 3846 // JUnitTestCase.assertSame(newUnit, _result.resolvedUnit); |
| 3847 // JUnitTestCase.assertEquals("hbazlo", _result.oldContents); |
| 3848 // JUnitTestCase.assertEquals("hbazxlo", _result.newContents); |
| 3849 // JUnitTestCase.assertEquals(4, _result.offset); |
| 3850 // JUnitTestCase.assertEquals(0, _result.oldLength); |
| 3851 // JUnitTestCase.assertEquals(1, _result.newLength); |
| 3852 // } |
| 3853 // void test_update_appendWithNewResolvedUnit() { |
| 3854 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3855 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3856 // CompilationUnit newUnit = mock(CompilationUnit); |
| 3857 // newEntry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, newUnit); |
| 3858 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbaz
xlo", 4, 0, 1, newEntry); |
| 3859 // JUnitTestCase.assertNotNull(_result); |
| 3860 // JUnitTestCase.assertSame(_source, _result.source); |
| 3861 // JUnitTestCase.assertSame(newUnit, _result.resolvedUnit); |
| 3862 // JUnitTestCase.assertEquals("hbazlo", _result.oldContents); |
| 3863 // JUnitTestCase.assertEquals("hbazxlo", _result.newContents); |
| 3864 // JUnitTestCase.assertEquals(4, _result.offset); |
| 3865 // JUnitTestCase.assertEquals(0, _result.oldLength); |
| 3866 // JUnitTestCase.assertEquals(1, _result.newLength); |
| 3867 // } |
| 3868 // void test_update_appendWithNoNewResolvedUnit() { |
| 3869 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3870 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3871 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbaz
xlo", 4, 0, 1, newEntry); |
| 3872 // JUnitTestCase.assertNotNull(_result); |
| 3873 // JUnitTestCase.assertSame(_source, _result.source); |
| 3874 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3875 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3876 // JUnitTestCase.assertEquals("hbazxlo", _result.newContents); |
| 3877 // JUnitTestCase.assertEquals(1, _result.offset); |
| 3878 // JUnitTestCase.assertEquals(2, _result.oldLength); |
| 3879 // JUnitTestCase.assertEquals(4, _result.newLength); |
| 3880 // } |
| 3881 // void test_update_delete() { |
| 3882 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3883 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3884 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hzlo
", 1, 2, 0, newEntry); |
| 3885 // JUnitTestCase.assertNotNull(_result); |
| 3886 // JUnitTestCase.assertSame(_source, _result.source); |
| 3887 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3888 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3889 // JUnitTestCase.assertEquals("hzlo", _result.newContents); |
| 3890 // JUnitTestCase.assertEquals(1, _result.offset); |
| 3891 // JUnitTestCase.assertEquals(2, _result.oldLength); |
| 3892 // JUnitTestCase.assertEquals(1, _result.newLength); |
| 3893 // } |
| 3894 // void test_update_insert_nonContiguous_after() { |
| 3895 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3896 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3897 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbaz
lox", 6, 0, 1, newEntry); |
| 3898 // JUnitTestCase.assertNull(_result); |
| 3899 // } |
| 3900 // void test_update_insert_nonContiguous_before() { |
| 3901 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3902 // DartEntryImpl newEntry = new DartEntryImpl(); |
| 3903 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "xhba
zlo", 0, 0, 1, newEntry); |
| 3904 // JUnitTestCase.assertNull(_result); |
| 3905 // } |
| 3906 // void test_update_newSource_entry() { |
| 3907 // Source oldSource = new TestSource.con1(new JavaFile("blat.dart"), "blat")
; |
| 3908 // DartEntryImpl oldEntry = new DartEntryImpl(); |
| 3909 // CompilationUnit oldUnit = mock(CompilationUnit); |
| 3910 // oldEntry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, oldUnit); |
| 3911 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, ol
dSource, "hello", "hbazlo", 1, 2, 3, oldEntry); |
| 3912 // JUnitTestCase.assertSame(oldSource, cache.source); |
| 3913 // JUnitTestCase.assertSame(oldUnit, cache.resolvedUnit); |
| 3914 // _result = IncrementalAnalysisCache.update(cache, _source, "foo", "foobz",
3, 0, 2, _entry); |
| 3915 // JUnitTestCase.assertNotNull(_result); |
| 3916 // JUnitTestCase.assertSame(_source, _result.source); |
| 3917 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3918 // JUnitTestCase.assertEquals("foo", _result.oldContents); |
| 3919 // JUnitTestCase.assertEquals("foobz", _result.newContents); |
| 3920 // JUnitTestCase.assertEquals(3, _result.offset); |
| 3921 // JUnitTestCase.assertEquals(0, _result.oldLength); |
| 3922 // JUnitTestCase.assertEquals(2, _result.newLength); |
| 3923 // } |
| 3924 // void test_update_newSource_noEntry() { |
| 3925 // Source oldSource = new TestSource.con1(new JavaFile("blat.dart"), "blat")
; |
| 3926 // DartEntryImpl oldEntry = new DartEntryImpl(); |
| 3927 // CompilationUnit oldUnit = mock(CompilationUnit); |
| 3928 // oldEntry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, oldUnit); |
| 3929 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, ol
dSource, "hello", "hbazlo", 1, 2, 3, oldEntry); |
| 3930 // JUnitTestCase.assertSame(oldSource, cache.source); |
| 3931 // JUnitTestCase.assertSame(oldUnit, cache.resolvedUnit); |
| 3932 // _result = IncrementalAnalysisCache.update(cache, _source, "foo", "foobar"
, 3, 0, 3, null); |
| 3933 // JUnitTestCase.assertNull(_result); |
| 3934 // } |
| 3935 // void test_update_noCache_entry() { |
| 3936 // _result = IncrementalAnalysisCache.update(null, _source, "hello", "hbazlo
", 1, 2, 3, _entry); |
| 3937 // JUnitTestCase.assertNotNull(_result); |
| 3938 // JUnitTestCase.assertSame(_source, _result.source); |
| 3939 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3940 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3941 // JUnitTestCase.assertEquals("hbazlo", _result.newContents); |
| 3942 // JUnitTestCase.assertEquals(1, _result.offset); |
| 3943 // JUnitTestCase.assertEquals(2, _result.oldLength); |
| 3944 // JUnitTestCase.assertEquals(3, _result.newLength); |
| 3945 // JUnitTestCase.assertTrue(_result.hasWork); |
| 3946 // } |
| 3947 // void test_update_noCache_entry_noOldSource_append() { |
| 3948 // _result = IncrementalAnalysisCache.update(null, _source, null, "hellxo",
4, 0, 1, _entry); |
| 3949 // JUnitTestCase.assertNotNull(_result); |
| 3950 // JUnitTestCase.assertSame(_source, _result.source); |
| 3951 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3952 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3953 // JUnitTestCase.assertEquals("hellxo", _result.newContents); |
| 3954 // JUnitTestCase.assertEquals(4, _result.offset); |
| 3955 // JUnitTestCase.assertEquals(0, _result.oldLength); |
| 3956 // JUnitTestCase.assertEquals(1, _result.newLength); |
| 3957 // JUnitTestCase.assertTrue(_result.hasWork); |
| 3958 // } |
| 3959 // void test_update_noCache_entry_noOldSource_delete() { |
| 3960 // _result = IncrementalAnalysisCache.update(null, _source, null, "helo", 4,
1, 0, _entry); |
| 3961 // JUnitTestCase.assertNull(_result); |
| 3962 // } |
| 3963 // void test_update_noCache_entry_noOldSource_replace() { |
| 3964 // _result = IncrementalAnalysisCache.update(null, _source, null, "helxo", 4
, 1, 1, _entry); |
| 3965 // JUnitTestCase.assertNull(_result); |
| 3966 // } |
| 3967 // void test_update_noCache_noEntry() { |
| 3968 // _result = IncrementalAnalysisCache.update(null, _source, "hello", "hbazlo
", 1, 2, 3, null); |
| 3969 // JUnitTestCase.assertNull(_result); |
| 3970 // } |
| 3971 // void test_update_replace() { |
| 3972 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 3973 // _result = IncrementalAnalysisCache.update(cache, _source, "hbazlo", "hbar
rlo", 3, 1, 2, null); |
| 3974 // JUnitTestCase.assertNotNull(_result); |
| 3975 // JUnitTestCase.assertSame(_source, _result.source); |
| 3976 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 3977 // JUnitTestCase.assertEquals("hello", _result.oldContents); |
| 3978 // JUnitTestCase.assertEquals("hbarrlo", _result.newContents); |
| 3979 // JUnitTestCase.assertEquals(1, _result.offset); |
| 3980 // JUnitTestCase.assertEquals(2, _result.oldLength); |
| 3981 // JUnitTestCase.assertEquals(4, _result.newLength); |
| 3982 // } |
| 3983 // void test_verifyStructure_invalidUnit() { |
| 3984 // String oldCode = "main() {foo;}"; |
| 3985 // String newCode = "main() {boo;}"; |
| 3986 // CompilationUnit badUnit = _parse("main() {bad;}"); |
| 3987 // _entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, badUnit); |
| 3988 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, oldCode, newCode, 8, 1, 1, _entry); |
| 3989 // CompilationUnit newUnit = _parse(newCode); |
| 3990 // _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUni
t); |
| 3991 // JUnitTestCase.assertNull(_result); |
| 3992 // } |
| 3993 // void test_verifyStructure_noCache() { |
| 3994 // IncrementalAnalysisCache cache = null; |
| 3995 // CompilationUnit newUnit = mock(CompilationUnit); |
| 3996 // _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUni
t); |
| 3997 // JUnitTestCase.assertNull(_result); |
| 3998 // } |
| 3999 // void test_verifyStructure_noCacheNoUnit() { |
| 4000 // IncrementalAnalysisCache cache = null; |
| 4001 // CompilationUnit newUnit = null; |
| 4002 // _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUni
t); |
| 4003 // JUnitTestCase.assertNull(_result); |
| 4004 // } |
| 4005 // void test_verifyStructure_noUnit() { |
| 4006 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 4007 // CompilationUnit newUnit = null; |
| 4008 // _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUni
t); |
| 4009 // JUnitTestCase.assertSame(cache, _result); |
| 4010 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 4011 // } |
| 4012 // void test_verifyStructure_otherSource() { |
| 4013 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, "hello", "hbazlo", 1, 2, 3, _entry); |
| 4014 // CompilationUnit newUnit = mock(CompilationUnit); |
| 4015 // Source otherSource = new TestSource.con1(new JavaFile("blat.dart"), "blat
"); |
| 4016 // _result = IncrementalAnalysisCache.verifyStructure(cache, otherSource, ne
wUnit); |
| 4017 // JUnitTestCase.assertSame(cache, _result); |
| 4018 // JUnitTestCase.assertSame(_unit, _result.resolvedUnit); |
| 4019 // } |
| 4020 // void test_verifyStructure_validUnit() { |
| 4021 // String oldCode = "main() {foo;}"; |
| 4022 // String newCode = "main() {boo;}"; |
| 4023 // CompilationUnit goodUnit = _parse(newCode); |
| 4024 // _entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, goodUnit); |
| 4025 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, _s
ource, oldCode, newCode, 1, 2, 3, _entry); |
| 4026 // CompilationUnit newUnit = _parse(newCode); |
| 4027 // _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUni
t); |
| 4028 // JUnitTestCase.assertSame(cache, _result); |
| 4029 // JUnitTestCase.assertSame(goodUnit, _result.resolvedUnit); |
| 4030 // } |
| 4031 // @override |
| 4032 // void setUp() { |
| 4033 // _entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, _unit); |
| 4034 // } |
| 4035 // CompilationUnit _parse(String code) { |
| 4036 // Scanner scanner = new Scanner(_source, new CharSequenceReader(code), Anal
ysisErrorListener.NULL_LISTENER); |
| 4037 // Parser parser = new Parser(_source, AnalysisErrorListener.NULL_LISTENER); |
| 4038 // return parser.parseCompilationUnit(scanner.tokenize()); |
| 4039 // } |
| 4040 // static dartSuite() { |
| 4041 // _ut.group('IncrementalAnalysisCacheTest', () { |
| 4042 // _ut.test('test_cacheResult', () { |
| 4043 // final __test = new IncrementalAnalysisCacheTest(); |
| 4044 // runJUnitTest(__test, __test.test_cacheResult); |
| 4045 // }); |
| 4046 // _ut.test('test_cacheResult_noCache', () { |
| 4047 // final __test = new IncrementalAnalysisCacheTest(); |
| 4048 // runJUnitTest(__test, __test.test_cacheResult_noCache); |
| 4049 // }); |
| 4050 // _ut.test('test_cacheResult_noCacheNoResult', () { |
| 4051 // final __test = new IncrementalAnalysisCacheTest(); |
| 4052 // runJUnitTest(__test, __test.test_cacheResult_noCacheNoResult); |
| 4053 // }); |
| 4054 // _ut.test('test_cacheResult_noResult', () { |
| 4055 // final __test = new IncrementalAnalysisCacheTest(); |
| 4056 // runJUnitTest(__test, __test.test_cacheResult_noResult); |
| 4057 // }); |
| 4058 // _ut.test('test_clear_differentSource', () { |
| 4059 // final __test = new IncrementalAnalysisCacheTest(); |
| 4060 // runJUnitTest(__test, __test.test_clear_differentSource); |
| 4061 // }); |
| 4062 // _ut.test('test_clear_nullCache', () { |
| 4063 // final __test = new IncrementalAnalysisCacheTest(); |
| 4064 // runJUnitTest(__test, __test.test_clear_nullCache); |
| 4065 // }); |
| 4066 // _ut.test('test_clear_sameSource', () { |
| 4067 // final __test = new IncrementalAnalysisCacheTest(); |
| 4068 // runJUnitTest(__test, __test.test_clear_sameSource); |
| 4069 // }); |
| 4070 // _ut.test('test_update_append', () { |
| 4071 // final __test = new IncrementalAnalysisCacheTest(); |
| 4072 // runJUnitTest(__test, __test.test_update_append); |
| 4073 // }); |
| 4074 // _ut.test('test_update_appendToCachedResult', () { |
| 4075 // final __test = new IncrementalAnalysisCacheTest(); |
| 4076 // runJUnitTest(__test, __test.test_update_appendToCachedResult); |
| 4077 // }); |
| 4078 // _ut.test('test_update_appendWithNewResolvedUnit', () { |
| 4079 // final __test = new IncrementalAnalysisCacheTest(); |
| 4080 // runJUnitTest(__test, __test.test_update_appendWithNewResolvedUnit); |
| 4081 // }); |
| 4082 // _ut.test('test_update_appendWithNoNewResolvedUnit', () { |
| 4083 // final __test = new IncrementalAnalysisCacheTest(); |
| 4084 // runJUnitTest(__test, __test.test_update_appendWithNoNewResolvedUnit); |
| 4085 // }); |
| 4086 // _ut.test('test_update_delete', () { |
| 4087 // final __test = new IncrementalAnalysisCacheTest(); |
| 4088 // runJUnitTest(__test, __test.test_update_delete); |
| 4089 // }); |
| 4090 // _ut.test('test_update_insert_nonContiguous_after', () { |
| 4091 // final __test = new IncrementalAnalysisCacheTest(); |
| 4092 // runJUnitTest(__test, __test.test_update_insert_nonContiguous_after); |
| 4093 // }); |
| 4094 // _ut.test('test_update_insert_nonContiguous_before', () { |
| 4095 // final __test = new IncrementalAnalysisCacheTest(); |
| 4096 // runJUnitTest(__test, __test.test_update_insert_nonContiguous_before); |
| 4097 // }); |
| 4098 // _ut.test('test_update_newSource_entry', () { |
| 4099 // final __test = new IncrementalAnalysisCacheTest(); |
| 4100 // runJUnitTest(__test, __test.test_update_newSource_entry); |
| 4101 // }); |
| 4102 // _ut.test('test_update_newSource_noEntry', () { |
| 4103 // final __test = new IncrementalAnalysisCacheTest(); |
| 4104 // runJUnitTest(__test, __test.test_update_newSource_noEntry); |
| 4105 // }); |
| 4106 // _ut.test('test_update_noCache_entry', () { |
| 4107 // final __test = new IncrementalAnalysisCacheTest(); |
| 4108 // runJUnitTest(__test, __test.test_update_noCache_entry); |
| 4109 // }); |
| 4110 // _ut.test('test_update_noCache_entry_noOldSource_append', () { |
| 4111 // final __test = new IncrementalAnalysisCacheTest(); |
| 4112 // runJUnitTest(__test, __test.test_update_noCache_entry_noOldSource_app
end); |
| 4113 // }); |
| 4114 // _ut.test('test_update_noCache_entry_noOldSource_delete', () { |
| 4115 // final __test = new IncrementalAnalysisCacheTest(); |
| 4116 // runJUnitTest(__test, __test.test_update_noCache_entry_noOldSource_del
ete); |
| 4117 // }); |
| 4118 // _ut.test('test_update_noCache_entry_noOldSource_replace', () { |
| 4119 // final __test = new IncrementalAnalysisCacheTest(); |
| 4120 // runJUnitTest(__test, __test.test_update_noCache_entry_noOldSource_rep
lace); |
| 4121 // }); |
| 4122 // _ut.test('test_update_noCache_noEntry', () { |
| 4123 // final __test = new IncrementalAnalysisCacheTest(); |
| 4124 // runJUnitTest(__test, __test.test_update_noCache_noEntry); |
| 4125 // }); |
| 4126 // _ut.test('test_update_replace', () { |
| 4127 // final __test = new IncrementalAnalysisCacheTest(); |
| 4128 // runJUnitTest(__test, __test.test_update_replace); |
| 4129 // }); |
| 4130 // _ut.test('test_verifyStructure_invalidUnit', () { |
| 4131 // final __test = new IncrementalAnalysisCacheTest(); |
| 4132 // runJUnitTest(__test, __test.test_verifyStructure_invalidUnit); |
| 4133 // }); |
| 4134 // _ut.test('test_verifyStructure_noCache', () { |
| 4135 // final __test = new IncrementalAnalysisCacheTest(); |
| 4136 // runJUnitTest(__test, __test.test_verifyStructure_noCache); |
| 4137 // }); |
| 4138 // _ut.test('test_verifyStructure_noCacheNoUnit', () { |
| 4139 // final __test = new IncrementalAnalysisCacheTest(); |
| 4140 // runJUnitTest(__test, __test.test_verifyStructure_noCacheNoUnit); |
| 4141 // }); |
| 4142 // _ut.test('test_verifyStructure_noUnit', () { |
| 4143 // final __test = new IncrementalAnalysisCacheTest(); |
| 4144 // runJUnitTest(__test, __test.test_verifyStructure_noUnit); |
| 4145 // }); |
| 4146 // _ut.test('test_verifyStructure_otherSource', () { |
| 4147 // final __test = new IncrementalAnalysisCacheTest(); |
| 4148 // runJUnitTest(__test, __test.test_verifyStructure_otherSource); |
| 4149 // }); |
| 4150 // _ut.test('test_verifyStructure_validUnit', () { |
| 4151 // final __test = new IncrementalAnalysisCacheTest(); |
| 4152 // runJUnitTest(__test, __test.test_verifyStructure_validUnit); |
| 4153 // }); |
| 4154 // }); |
| 4155 // } |
| 4156 // } |
| 4157 // class IncrementalAnalysisTaskTest extends EngineTestCase { |
| 4158 // void test_accept() { |
| 4159 // IncrementalAnalysisTask task = new IncrementalAnalysisTask(null, null); |
| 4160 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_IncrementalAnaly
sisTaskTest_test_accept())); |
| 4161 // } |
| 4162 // void test_perform() { |
| 4163 // // main() {} String foo; |
| 4164 // // main() {String} String foo; |
| 4165 // CompilationUnit newUnit = _assertTask("main() {", "", "String", "} String
foo;"); |
| 4166 // NodeList<CompilationUnitMember> declarations = newUnit.declarations; |
| 4167 // FunctionDeclaration main = declarations[0] as FunctionDeclaration; |
| 4168 // JUnitTestCase.assertEquals("main", main.name.name); |
| 4169 // BlockFunctionBody body = main.functionExpression.body as BlockFunctionBod
y; |
| 4170 // ExpressionStatement statement = body.block.statements[0] as ExpressionSta
tement; |
| 4171 // JUnitTestCase.assertEquals("String;", statement.toSource()); |
| 4172 // SimpleIdentifier identifier = statement.expression as SimpleIdentifier; |
| 4173 // JUnitTestCase.assertEquals("String", identifier.name); |
| 4174 // JUnitTestCase.assertNotNull(identifier.staticElement); |
| 4175 // TopLevelVariableDeclaration fooDecl = declarations[1] as TopLevelVariable
Declaration; |
| 4176 // SimpleIdentifier fooName = fooDecl.variables.variables[0].name; |
| 4177 // JUnitTestCase.assertEquals("foo", fooName.name); |
| 4178 // JUnitTestCase.assertNotNull(fooName.staticElement); |
| 4179 // } |
| 4180 // CompilationUnit _assertTask(String prefix, String removed, String added, St
ring suffix) { |
| 4181 // String oldCode = EngineTestCase.createSource(["${prefix}${removed}${suffi
x}"]); |
| 4182 // String newCode = EngineTestCase.createSource(["${prefix}${added}${suffix}
"]); |
| 4183 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 4184 // Source source = new TestSource.con1(new JavaFile("/test.dart"), oldCode); |
| 4185 // DartEntryImpl entry = new DartEntryImpl(); |
| 4186 // CompilationUnit oldUnit = context.resolveCompilationUnit2(source, source)
; |
| 4187 // JUnitTestCase.assertNotNull(oldUnit); |
| 4188 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source, oldUnit); |
| 4189 // IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null, so
urce, oldCode, newCode, prefix.length, removed.length, added.length, entry); |
| 4190 // JUnitTestCase.assertNotNull(cache); |
| 4191 // IncrementalAnalysisTask task = new IncrementalAnalysisTask(context, cache
); |
| 4192 // CompilationUnit newUnit = task.perform(new TestTaskVisitor_IncrementalAna
lysisTaskTest_assertTask(task)); |
| 4193 // JUnitTestCase.assertNotNull(newUnit); |
| 4194 // return newUnit; |
| 4195 // } |
| 4196 // static dartSuite() { |
| 4197 // _ut.group('IncrementalAnalysisTaskTest', () { |
| 4198 // _ut.test('test_accept', () { |
| 4199 // final __test = new IncrementalAnalysisTaskTest(); |
| 4200 // runJUnitTest(__test, __test.test_accept); |
| 4201 // }); |
| 4202 // _ut.test('test_perform', () { |
| 4203 // final __test = new IncrementalAnalysisTaskTest(); |
| 4204 // runJUnitTest(__test, __test.test_perform); |
| 4205 // }); |
| 4206 // }); |
| 4207 // } |
| 4208 // } |
| 4209 // class InstrumentedAnalysisContextImplTest extends EngineTestCase { |
| 4210 // void test_addSourceInfo() { |
| 4211 // List<bool> invoked = [false]; |
| 4212 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_addSo
urceInfo(invoked)); |
| 4213 // context.addSourceInfo(null, null); |
| 4214 // JUnitTestCase.assertTrue(invoked[0]); |
| 4215 // } |
| 4216 // void test_applyChanges() { |
| 4217 // List<bool> invoked = [false]; |
| 4218 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_apply
Changes(invoked)); |
| 4219 // context.applyChanges(null); |
| 4220 // JUnitTestCase.assertTrue(invoked[0]); |
| 4221 // } |
| 4222 // void test_computeDocumentationComment() { |
| 4223 // List<bool> invoked = [false]; |
| 4224 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teDocumentationComment(invoked)); |
| 4225 // context.computeDocumentationComment(null); |
| 4226 // JUnitTestCase.assertTrue(invoked[0]); |
| 4227 // } |
| 4228 // void test_computeErrors() { |
| 4229 // List<bool> invoked = [false]; |
| 4230 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teErrors(invoked)); |
| 4231 // context.computeErrors(null); |
| 4232 // JUnitTestCase.assertTrue(invoked[0]); |
| 4233 // } |
| 4234 // void test_computeExportedLibraries() { |
| 4235 // List<bool> invoked = [false]; |
| 4236 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teExportedLibraries(invoked)); |
| 4237 // context.computeExportedLibraries(null); |
| 4238 // JUnitTestCase.assertTrue(invoked[0]); |
| 4239 // } |
| 4240 // void test_computeHtmlElement() { |
| 4241 // List<bool> invoked = [false]; |
| 4242 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teHtmlElement(invoked)); |
| 4243 // context.computeHtmlElement(null); |
| 4244 // JUnitTestCase.assertTrue(invoked[0]); |
| 4245 // } |
| 4246 // void test_computeImportedLibraries() { |
| 4247 // List<bool> invoked = [false]; |
| 4248 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teImportedLibraries(invoked)); |
| 4249 // context.computeImportedLibraries(null); |
| 4250 // JUnitTestCase.assertTrue(invoked[0]); |
| 4251 // } |
| 4252 // void test_computeKindOf() { |
| 4253 // List<bool> invoked = [false]; |
| 4254 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teKindOf(invoked)); |
| 4255 // context.computeKindOf(null); |
| 4256 // JUnitTestCase.assertTrue(invoked[0]); |
| 4257 // } |
| 4258 // void test_computeLibraryElement() { |
| 4259 // List<bool> invoked = [false]; |
| 4260 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teLibraryElement(invoked)); |
| 4261 // context.computeLibraryElement(null); |
| 4262 // JUnitTestCase.assertTrue(invoked[0]); |
| 4263 // } |
| 4264 // void test_computeLineInfo() { |
| 4265 // List<bool> invoked = [false]; |
| 4266 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teLineInfo(invoked)); |
| 4267 // context.computeLineInfo(null); |
| 4268 // JUnitTestCase.assertTrue(invoked[0]); |
| 4269 // } |
| 4270 // void test_computeResolvableCompilationUnit() { |
| 4271 // List<bool> invoked = [false]; |
| 4272 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_compu
teResolvableCompilationUnit(invoked)); |
| 4273 // context.computeResolvableCompilationUnit(null); |
| 4274 // JUnitTestCase.assertTrue(invoked[0]); |
| 4275 // } |
| 4276 // void test_creation() { |
| 4277 // JUnitTestCase.assertNotNull(new InstrumentedAnalysisContextImpl()); |
| 4278 // } |
| 4279 // void test_dispose() { |
| 4280 // List<bool> invoked = [false]; |
| 4281 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_dispo
se(invoked)); |
| 4282 // context.dispose(); |
| 4283 // JUnitTestCase.assertTrue(invoked[0]); |
| 4284 // } |
| 4285 // void test_exists() { |
| 4286 // List<bool> invoked = [false]; |
| 4287 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_exist
s(invoked)); |
| 4288 // context.exists(null); |
| 4289 // JUnitTestCase.assertTrue(invoked[0]); |
| 4290 // } |
| 4291 // void test_extractContext() { |
| 4292 // List<bool> invoked = [false]; |
| 4293 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extra
ctContext(invoked)); |
| 4294 // context.extractContext(null); |
| 4295 // JUnitTestCase.assertTrue(invoked[0]); |
| 4296 // } |
| 4297 // void test_extractContextInto() { |
| 4298 // List<bool> invoked = [false]; |
| 4299 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extra
ctContextInto(invoked)); |
| 4300 // context.extractContextInto(null, null); |
| 4301 // JUnitTestCase.assertTrue(invoked[0]); |
| 4302 // } |
| 4303 // void test_getAnalysisOptions() { |
| 4304 // List<bool> invoked = [false]; |
| 4305 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAn
alysisOptions(invoked)); |
| 4306 // context.analysisOptions; |
| 4307 // JUnitTestCase.assertTrue(invoked[0]); |
| 4308 // } |
| 4309 // void test_getAngularApplicationWithHtml() { |
| 4310 // List<bool> invoked = [false]; |
| 4311 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAn
gularApplicationWithHtml(invoked)); |
| 4312 // context.getAngularApplicationWithHtml(null); |
| 4313 // JUnitTestCase.assertTrue(invoked[0]); |
| 4314 // } |
| 4315 // void test_getCompilationUnitElement() { |
| 4316 // List<bool> invoked = [false]; |
| 4317 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getCo
mpilationUnitElement(invoked)); |
| 4318 // context.getCompilationUnitElement(null, null); |
| 4319 // JUnitTestCase.assertTrue(invoked[0]); |
| 4320 // } |
| 4321 // void test_getContents() { |
| 4322 // List<bool> invoked = [false]; |
| 4323 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getCo
ntents(invoked)); |
| 4324 // context.getContents(null); |
| 4325 // JUnitTestCase.assertTrue(invoked[0]); |
| 4326 // } |
| 4327 // void test_getContentsToReceiver() { |
| 4328 // List<bool> invoked = [false]; |
| 4329 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getCo
ntentsToReceiver(invoked)); |
| 4330 // context.getContentsToReceiver(null, null); |
| 4331 // JUnitTestCase.assertTrue(invoked[0]); |
| 4332 // } |
| 4333 // void test_getElement() { |
| 4334 // List<bool> invoked = [false]; |
| 4335 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getEl
ement(invoked)); |
| 4336 // context.getElement(null); |
| 4337 // JUnitTestCase.assertTrue(invoked[0]); |
| 4338 // } |
| 4339 // void test_getErrors() { |
| 4340 // List<bool> invoked = [false]; |
| 4341 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getEr
rors(invoked)); |
| 4342 // context.getErrors(null); |
| 4343 // JUnitTestCase.assertTrue(invoked[0]); |
| 4344 // } |
| 4345 // void test_getHtmlElement() { |
| 4346 // List<bool> invoked = [false]; |
| 4347 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHt
mlElement(invoked)); |
| 4348 // context.getHtmlElement(null); |
| 4349 // JUnitTestCase.assertTrue(invoked[0]); |
| 4350 // } |
| 4351 // void test_getHtmlFilesReferencing() { |
| 4352 // List<bool> invoked = [false]; |
| 4353 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHt
mlFilesReferencing(invoked)); |
| 4354 // context.getHtmlFilesReferencing(null); |
| 4355 // JUnitTestCase.assertTrue(invoked[0]); |
| 4356 // } |
| 4357 // void test_getHtmlSources() { |
| 4358 // List<bool> invoked = [false]; |
| 4359 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHt
mlSources(invoked)); |
| 4360 // context.htmlSources; |
| 4361 // JUnitTestCase.assertTrue(invoked[0]); |
| 4362 // } |
| 4363 // void test_getKindOf() { |
| 4364 // List<bool> invoked = [false]; |
| 4365 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getKi
ndOf(invoked)); |
| 4366 // context.getKindOf(null); |
| 4367 // JUnitTestCase.assertTrue(invoked[0]); |
| 4368 // } |
| 4369 // void test_getLaunchableClientLibrarySources() { |
| 4370 // List<bool> invoked = [false]; |
| 4371 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLa
unchableClientLibrarySources(invoked)); |
| 4372 // context.launchableClientLibrarySources; |
| 4373 // JUnitTestCase.assertTrue(invoked[0]); |
| 4374 // } |
| 4375 // void test_getLaunchableServerLibrarySources() { |
| 4376 // List<bool> invoked = [false]; |
| 4377 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLa
unchableServerLibrarySources(invoked)); |
| 4378 // context.launchableServerLibrarySources; |
| 4379 // JUnitTestCase.assertTrue(invoked[0]); |
| 4380 // } |
| 4381 // void test_getLibrariesContaining() { |
| 4382 // List<bool> invoked = [false]; |
| 4383 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
brariesContaining(invoked)); |
| 4384 // context.getLibrariesContaining(null); |
| 4385 // JUnitTestCase.assertTrue(invoked[0]); |
| 4386 // } |
| 4387 // void test_getLibrariesDependingOn() { |
| 4388 // List<bool> invoked = [false]; |
| 4389 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
brariesDependingOn(invoked)); |
| 4390 // context.getLibrariesDependingOn(null); |
| 4391 // JUnitTestCase.assertTrue(invoked[0]); |
| 4392 // } |
| 4393 // void test_getLibrariesReferencedFromHtml() { |
| 4394 // List<bool> invoked = [false]; |
| 4395 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
brariesReferencedFromHtml(invoked)); |
| 4396 // context.getLibrariesReferencedFromHtml(null); |
| 4397 // JUnitTestCase.assertTrue(invoked[0]); |
| 4398 // } |
| 4399 // void test_getLibraryElement() { |
| 4400 // List<bool> invoked = [false]; |
| 4401 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
braryElement(invoked)); |
| 4402 // context.getLibraryElement(null); |
| 4403 // JUnitTestCase.assertTrue(invoked[0]); |
| 4404 // } |
| 4405 // void test_getLibrarySources() { |
| 4406 // List<bool> invoked = [false]; |
| 4407 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
brarySources(invoked)); |
| 4408 // context.librarySources; |
| 4409 // JUnitTestCase.assertTrue(invoked[0]); |
| 4410 // } |
| 4411 // void test_getLineInfo() { |
| 4412 // List<bool> invoked = [false]; |
| 4413 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLi
neInfo(invoked)); |
| 4414 // context.getLineInfo(null); |
| 4415 // JUnitTestCase.assertTrue(invoked[0]); |
| 4416 // } |
| 4417 // void test_getModificationStamp() { |
| 4418 // List<bool> invoked = [false]; |
| 4419 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getMo
dificationStamp(invoked)); |
| 4420 // context.getModificationStamp(null); |
| 4421 // JUnitTestCase.assertTrue(invoked[0]); |
| 4422 // } |
| 4423 // void test_getPublicNamespace() { |
| 4424 // List<bool> invoked = [false]; |
| 4425 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getPu
blicNamespace(invoked)); |
| 4426 // context.getPublicNamespace(null); |
| 4427 // JUnitTestCase.assertTrue(invoked[0]); |
| 4428 // } |
| 4429 // void test_getRefactoringUnsafeSources() { |
| 4430 // List<bool> invoked = [false]; |
| 4431 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRe
factoringUnsafeSources(invoked)); |
| 4432 // context.refactoringUnsafeSources; |
| 4433 // JUnitTestCase.assertTrue(invoked[0]); |
| 4434 // } |
| 4435 // void test_getResolvedCompilationUnit_element() { |
| 4436 // List<bool> invoked = [false]; |
| 4437 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRe
solvedCompilationUnit_element(invoked)); |
| 4438 // context.getResolvedCompilationUnit(null, null as LibraryElement); |
| 4439 // JUnitTestCase.assertTrue(invoked[0]); |
| 4440 // } |
| 4441 // void test_getResolvedCompilationUnit_source() { |
| 4442 // List<bool> invoked = [false]; |
| 4443 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRe
solvedCompilationUnit_source(invoked)); |
| 4444 // context.getResolvedCompilationUnit2(null, null as Source); |
| 4445 // JUnitTestCase.assertTrue(invoked[0]); |
| 4446 // } |
| 4447 // void test_getResolvedHtmlUnit() { |
| 4448 // List<bool> invoked = [false]; |
| 4449 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRe
solvedHtmlUnit(invoked)); |
| 4450 // context.getResolvedHtmlUnit(null); |
| 4451 // JUnitTestCase.assertTrue(invoked[0]); |
| 4452 // } |
| 4453 // void test_getSourceFactory() { |
| 4454 // List<bool> invoked = [false]; |
| 4455 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getSo
urceFactory(invoked)); |
| 4456 // context.sourceFactory; |
| 4457 // JUnitTestCase.assertTrue(invoked[0]); |
| 4458 // } |
| 4459 // void test_getStatistics() { |
| 4460 // List<bool> invoked = [false]; |
| 4461 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getSt
atistics(invoked)); |
| 4462 // context.statistics; |
| 4463 // JUnitTestCase.assertTrue(invoked[0]); |
| 4464 // } |
| 4465 // void test_getTypeProvider() { |
| 4466 // List<bool> invoked = [false]; |
| 4467 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getTy
peProvider(invoked)); |
| 4468 // context.typeProvider; |
| 4469 // JUnitTestCase.assertTrue(invoked[0]); |
| 4470 // } |
| 4471 // void test_isClientLibrary() { |
| 4472 // List<bool> invoked = [false]; |
| 4473 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isCli
entLibrary(invoked)); |
| 4474 // context.isClientLibrary(null); |
| 4475 // JUnitTestCase.assertTrue(invoked[0]); |
| 4476 // } |
| 4477 // void test_isDisposed() { |
| 4478 // List<bool> invoked = [false]; |
| 4479 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isDis
posed(invoked)); |
| 4480 // context.isDisposed; |
| 4481 // JUnitTestCase.assertTrue(invoked[0]); |
| 4482 // } |
| 4483 // void test_isServerLibrary() { |
| 4484 // List<bool> invoked = [false]; |
| 4485 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isSer
verLibrary(invoked)); |
| 4486 // context.isServerLibrary(null); |
| 4487 // JUnitTestCase.assertTrue(invoked[0]); |
| 4488 // } |
| 4489 // void test_mergeContext() { |
| 4490 // List<bool> invoked = [false]; |
| 4491 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_merge
Context(invoked)); |
| 4492 // context.mergeContext(new InstrumentedAnalysisContextImpl.con1(new TestAna
lysisContext())); |
| 4493 // JUnitTestCase.assertTrue(invoked[0]); |
| 4494 // } |
| 4495 // void test_parseCompilationUnit() { |
| 4496 // List<bool> invoked = [false]; |
| 4497 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parse
CompilationUnit(invoked)); |
| 4498 // context.parseCompilationUnit(null); |
| 4499 // JUnitTestCase.assertTrue(invoked[0]); |
| 4500 // } |
| 4501 // void test_parseHtmlUnit() { |
| 4502 // List<bool> invoked = [false]; |
| 4503 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parse
HtmlUnit(invoked)); |
| 4504 // context.parseHtmlUnit(null); |
| 4505 // JUnitTestCase.assertTrue(invoked[0]); |
| 4506 // } |
| 4507 // void test_performAnalysisTask() { |
| 4508 // List<bool> invoked = [false]; |
| 4509 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_perfo
rmAnalysisTask(invoked)); |
| 4510 // context.performAnalysisTask(); |
| 4511 // JUnitTestCase.assertTrue(invoked[0]); |
| 4512 // } |
| 4513 // void test_recordLibraryElements() { |
| 4514 // List<bool> invoked = [false]; |
| 4515 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_recor
dLibraryElements(invoked)); |
| 4516 // context.recordLibraryElements(null); |
| 4517 // JUnitTestCase.assertTrue(invoked[0]); |
| 4518 // } |
| 4519 // void test_resolveCompilationUnit() { |
| 4520 // List<bool> invoked = [false]; |
| 4521 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resol
veCompilationUnit(invoked)); |
| 4522 // context.resolveCompilationUnit2(null, null as Source); |
| 4523 // JUnitTestCase.assertTrue(invoked[0]); |
| 4524 // } |
| 4525 // void test_resolveCompilationUnit_element() { |
| 4526 // List<bool> invoked = [false]; |
| 4527 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resol
veCompilationUnit_element(invoked)); |
| 4528 // context.resolveCompilationUnit(null, null as LibraryElement); |
| 4529 // JUnitTestCase.assertTrue(invoked[0]); |
| 4530 // } |
| 4531 // void test_resolveHtmlUnit() { |
| 4532 // List<bool> invoked = [false]; |
| 4533 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resol
veHtmlUnit(invoked)); |
| 4534 // context.resolveHtmlUnit(null); |
| 4535 // JUnitTestCase.assertTrue(invoked[0]); |
| 4536 // } |
| 4537 // void test_setAnalysisOptions() { |
| 4538 // List<bool> invoked = [false]; |
| 4539 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAn
alysisOptions(invoked)); |
| 4540 // context.analysisOptions = null; |
| 4541 // JUnitTestCase.assertTrue(invoked[0]); |
| 4542 // } |
| 4543 // void test_setAnalysisPriorityOrder() { |
| 4544 // List<bool> invoked = [false]; |
| 4545 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAn
alysisPriorityOrder(invoked)); |
| 4546 // context.analysisPriorityOrder = null; |
| 4547 // JUnitTestCase.assertTrue(invoked[0]); |
| 4548 // } |
| 4549 // void test_setChangedContents() { |
| 4550 // List<bool> invoked = [false]; |
| 4551 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setCh
angedContents(invoked)); |
| 4552 // context.setChangedContents(null, null, 0, 0, 0); |
| 4553 // JUnitTestCase.assertTrue(invoked[0]); |
| 4554 // } |
| 4555 // void test_setContents() { |
| 4556 // List<bool> invoked = [false]; |
| 4557 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setCo
ntents(invoked)); |
| 4558 // context.setContents(null, null); |
| 4559 // JUnitTestCase.assertTrue(invoked[0]); |
| 4560 // } |
| 4561 // void test_setSourceFactory() { |
| 4562 // List<bool> invoked = [false]; |
| 4563 // InstrumentedAnalysisContextImpl context = new InstrumentedAnalysisContext
Impl.con1(new TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setSo
urceFactory(invoked)); |
| 4564 // context.sourceFactory = null; |
| 4565 // JUnitTestCase.assertTrue(invoked[0]); |
| 4566 // } |
| 4567 // static dartSuite() { |
| 4568 // _ut.group('InstrumentedAnalysisContextImplTest', () { |
| 4569 // _ut.test('test_addSourceInfo', () { |
| 4570 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4571 // runJUnitTest(__test, __test.test_addSourceInfo); |
| 4572 // }); |
| 4573 // _ut.test('test_applyChanges', () { |
| 4574 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4575 // runJUnitTest(__test, __test.test_applyChanges); |
| 4576 // }); |
| 4577 // _ut.test('test_computeDocumentationComment', () { |
| 4578 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4579 // runJUnitTest(__test, __test.test_computeDocumentationComment); |
| 4580 // }); |
| 4581 // _ut.test('test_computeErrors', () { |
| 4582 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4583 // runJUnitTest(__test, __test.test_computeErrors); |
| 4584 // }); |
| 4585 // _ut.test('test_computeExportedLibraries', () { |
| 4586 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4587 // runJUnitTest(__test, __test.test_computeExportedLibraries); |
| 4588 // }); |
| 4589 // _ut.test('test_computeHtmlElement', () { |
| 4590 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4591 // runJUnitTest(__test, __test.test_computeHtmlElement); |
| 4592 // }); |
| 4593 // _ut.test('test_computeImportedLibraries', () { |
| 4594 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4595 // runJUnitTest(__test, __test.test_computeImportedLibraries); |
| 4596 // }); |
| 4597 // _ut.test('test_computeKindOf', () { |
| 4598 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4599 // runJUnitTest(__test, __test.test_computeKindOf); |
| 4600 // }); |
| 4601 // _ut.test('test_computeLibraryElement', () { |
| 4602 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4603 // runJUnitTest(__test, __test.test_computeLibraryElement); |
| 4604 // }); |
| 4605 // _ut.test('test_computeLineInfo', () { |
| 4606 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4607 // runJUnitTest(__test, __test.test_computeLineInfo); |
| 4608 // }); |
| 4609 // _ut.test('test_computeResolvableCompilationUnit', () { |
| 4610 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4611 // runJUnitTest(__test, __test.test_computeResolvableCompilationUnit); |
| 4612 // }); |
| 4613 // _ut.test('test_creation', () { |
| 4614 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4615 // runJUnitTest(__test, __test.test_creation); |
| 4616 // }); |
| 4617 // _ut.test('test_dispose', () { |
| 4618 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4619 // runJUnitTest(__test, __test.test_dispose); |
| 4620 // }); |
| 4621 // _ut.test('test_exists', () { |
| 4622 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4623 // runJUnitTest(__test, __test.test_exists); |
| 4624 // }); |
| 4625 // _ut.test('test_extractContext', () { |
| 4626 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4627 // runJUnitTest(__test, __test.test_extractContext); |
| 4628 // }); |
| 4629 // _ut.test('test_extractContextInto', () { |
| 4630 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4631 // runJUnitTest(__test, __test.test_extractContextInto); |
| 4632 // }); |
| 4633 // _ut.test('test_getAnalysisOptions', () { |
| 4634 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4635 // runJUnitTest(__test, __test.test_getAnalysisOptions); |
| 4636 // }); |
| 4637 // _ut.test('test_getAngularApplicationWithHtml', () { |
| 4638 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4639 // runJUnitTest(__test, __test.test_getAngularApplicationWithHtml); |
| 4640 // }); |
| 4641 // _ut.test('test_getCompilationUnitElement', () { |
| 4642 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4643 // runJUnitTest(__test, __test.test_getCompilationUnitElement); |
| 4644 // }); |
| 4645 // _ut.test('test_getContents', () { |
| 4646 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4647 // runJUnitTest(__test, __test.test_getContents); |
| 4648 // }); |
| 4649 // _ut.test('test_getContentsToReceiver', () { |
| 4650 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4651 // runJUnitTest(__test, __test.test_getContentsToReceiver); |
| 4652 // }); |
| 4653 // _ut.test('test_getElement', () { |
| 4654 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4655 // runJUnitTest(__test, __test.test_getElement); |
| 4656 // }); |
| 4657 // _ut.test('test_getErrors', () { |
| 4658 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4659 // runJUnitTest(__test, __test.test_getErrors); |
| 4660 // }); |
| 4661 // _ut.test('test_getHtmlElement', () { |
| 4662 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4663 // runJUnitTest(__test, __test.test_getHtmlElement); |
| 4664 // }); |
| 4665 // _ut.test('test_getHtmlFilesReferencing', () { |
| 4666 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4667 // runJUnitTest(__test, __test.test_getHtmlFilesReferencing); |
| 4668 // }); |
| 4669 // _ut.test('test_getHtmlSources', () { |
| 4670 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4671 // runJUnitTest(__test, __test.test_getHtmlSources); |
| 4672 // }); |
| 4673 // _ut.test('test_getKindOf', () { |
| 4674 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4675 // runJUnitTest(__test, __test.test_getKindOf); |
| 4676 // }); |
| 4677 // _ut.test('test_getLaunchableClientLibrarySources', () { |
| 4678 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4679 // runJUnitTest(__test, __test.test_getLaunchableClientLibrarySources); |
| 4680 // }); |
| 4681 // _ut.test('test_getLaunchableServerLibrarySources', () { |
| 4682 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4683 // runJUnitTest(__test, __test.test_getLaunchableServerLibrarySources); |
| 4684 // }); |
| 4685 // _ut.test('test_getLibrariesContaining', () { |
| 4686 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4687 // runJUnitTest(__test, __test.test_getLibrariesContaining); |
| 4688 // }); |
| 4689 // _ut.test('test_getLibrariesDependingOn', () { |
| 4690 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4691 // runJUnitTest(__test, __test.test_getLibrariesDependingOn); |
| 4692 // }); |
| 4693 // _ut.test('test_getLibrariesReferencedFromHtml', () { |
| 4694 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4695 // runJUnitTest(__test, __test.test_getLibrariesReferencedFromHtml); |
| 4696 // }); |
| 4697 // _ut.test('test_getLibraryElement', () { |
| 4698 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4699 // runJUnitTest(__test, __test.test_getLibraryElement); |
| 4700 // }); |
| 4701 // _ut.test('test_getLibrarySources', () { |
| 4702 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4703 // runJUnitTest(__test, __test.test_getLibrarySources); |
| 4704 // }); |
| 4705 // _ut.test('test_getLineInfo', () { |
| 4706 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4707 // runJUnitTest(__test, __test.test_getLineInfo); |
| 4708 // }); |
| 4709 // _ut.test('test_getModificationStamp', () { |
| 4710 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4711 // runJUnitTest(__test, __test.test_getModificationStamp); |
| 4712 // }); |
| 4713 // _ut.test('test_getPublicNamespace', () { |
| 4714 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4715 // runJUnitTest(__test, __test.test_getPublicNamespace); |
| 4716 // }); |
| 4717 // _ut.test('test_getRefactoringUnsafeSources', () { |
| 4718 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4719 // runJUnitTest(__test, __test.test_getRefactoringUnsafeSources); |
| 4720 // }); |
| 4721 // _ut.test('test_getResolvedCompilationUnit_element', () { |
| 4722 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4723 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_element); |
| 4724 // }); |
| 4725 // _ut.test('test_getResolvedCompilationUnit_source', () { |
| 4726 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4727 // runJUnitTest(__test, __test.test_getResolvedCompilationUnit_source); |
| 4728 // }); |
| 4729 // _ut.test('test_getResolvedHtmlUnit', () { |
| 4730 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4731 // runJUnitTest(__test, __test.test_getResolvedHtmlUnit); |
| 4732 // }); |
| 4733 // _ut.test('test_getSourceFactory', () { |
| 4734 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4735 // runJUnitTest(__test, __test.test_getSourceFactory); |
| 4736 // }); |
| 4737 // _ut.test('test_getStatistics', () { |
| 4738 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4739 // runJUnitTest(__test, __test.test_getStatistics); |
| 4740 // }); |
| 4741 // _ut.test('test_getTypeProvider', () { |
| 4742 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4743 // runJUnitTest(__test, __test.test_getTypeProvider); |
| 4744 // }); |
| 4745 // _ut.test('test_isClientLibrary', () { |
| 4746 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4747 // runJUnitTest(__test, __test.test_isClientLibrary); |
| 4748 // }); |
| 4749 // _ut.test('test_isDisposed', () { |
| 4750 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4751 // runJUnitTest(__test, __test.test_isDisposed); |
| 4752 // }); |
| 4753 // _ut.test('test_isServerLibrary', () { |
| 4754 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4755 // runJUnitTest(__test, __test.test_isServerLibrary); |
| 4756 // }); |
| 4757 // _ut.test('test_mergeContext', () { |
| 4758 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4759 // runJUnitTest(__test, __test.test_mergeContext); |
| 4760 // }); |
| 4761 // _ut.test('test_parseCompilationUnit', () { |
| 4762 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4763 // runJUnitTest(__test, __test.test_parseCompilationUnit); |
| 4764 // }); |
| 4765 // _ut.test('test_parseHtmlUnit', () { |
| 4766 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4767 // runJUnitTest(__test, __test.test_parseHtmlUnit); |
| 4768 // }); |
| 4769 // _ut.test('test_performAnalysisTask', () { |
| 4770 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4771 // runJUnitTest(__test, __test.test_performAnalysisTask); |
| 4772 // }); |
| 4773 // _ut.test('test_recordLibraryElements', () { |
| 4774 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4775 // runJUnitTest(__test, __test.test_recordLibraryElements); |
| 4776 // }); |
| 4777 // _ut.test('test_resolveCompilationUnit', () { |
| 4778 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4779 // runJUnitTest(__test, __test.test_resolveCompilationUnit); |
| 4780 // }); |
| 4781 // _ut.test('test_resolveCompilationUnit_element', () { |
| 4782 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4783 // runJUnitTest(__test, __test.test_resolveCompilationUnit_element); |
| 4784 // }); |
| 4785 // _ut.test('test_resolveHtmlUnit', () { |
| 4786 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4787 // runJUnitTest(__test, __test.test_resolveHtmlUnit); |
| 4788 // }); |
| 4789 // _ut.test('test_setAnalysisOptions', () { |
| 4790 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4791 // runJUnitTest(__test, __test.test_setAnalysisOptions); |
| 4792 // }); |
| 4793 // _ut.test('test_setAnalysisPriorityOrder', () { |
| 4794 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4795 // runJUnitTest(__test, __test.test_setAnalysisPriorityOrder); |
| 4796 // }); |
| 4797 // _ut.test('test_setChangedContents', () { |
| 4798 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4799 // runJUnitTest(__test, __test.test_setChangedContents); |
| 4800 // }); |
| 4801 // _ut.test('test_setContents', () { |
| 4802 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4803 // runJUnitTest(__test, __test.test_setContents); |
| 4804 // }); |
| 4805 // _ut.test('test_setSourceFactory', () { |
| 4806 // final __test = new InstrumentedAnalysisContextImplTest(); |
| 4807 // runJUnitTest(__test, __test.test_setSourceFactory); |
| 4808 // }); |
| 4809 // }); |
| 4810 // } |
| 4811 // } |
| 4812 // class ParseDartTaskTest extends EngineTestCase { |
| 4813 // void test_accept() { |
| 4814 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4815 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ParseDartTaskTes
t_test_accept())); |
| 4816 // } |
| 4817 // void test_getCompilationUnit() { |
| 4818 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4819 // JUnitTestCase.assertNull(task.compilationUnit); |
| 4820 // } |
| 4821 // void test_getErrors() { |
| 4822 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4823 // EngineTestCase.assertLength(0, task.errors); |
| 4824 // } |
| 4825 // void test_getException() { |
| 4826 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4827 // JUnitTestCase.assertNull(task.exception); |
| 4828 // } |
| 4829 // void test_getModificationTime() { |
| 4830 // int modificationTime = 26; |
| 4831 // ParseDartTask task = new ParseDartTask(null, null, modificationTime, null
, null); |
| 4832 // JUnitTestCase.assertEquals(modificationTime, task.modificationTime); |
| 4833 // } |
| 4834 // void test_getSource() { |
| 4835 // Source source = new TestSource.con2(""); |
| 4836 // ParseDartTask task = new ParseDartTask(null, source, 0, null, null); |
| 4837 // JUnitTestCase.assertSame(source, task.source); |
| 4838 // } |
| 4839 // void test_hasNonPartOfDirective() { |
| 4840 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4841 // JUnitTestCase.assertFalse(task.hasNonPartOfDirective); |
| 4842 // } |
| 4843 // void test_hasPartOfDirective() { |
| 4844 // ParseDartTask task = new ParseDartTask(null, null, 0, null, null); |
| 4845 // JUnitTestCase.assertFalse(task.hasPartOfDirective); |
| 4846 // } |
| 4847 // void test_perform_exception() { |
| 4848 // TestSource source = new TestSource(); |
| 4849 // source.generateExceptionOnRead = true; |
| 4850 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 4851 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 4852 // ParseDartTask task = new ParseDartTask(context, source, 0, null, null); |
| 4853 // task.perform(new TestTaskVisitor_ParseDartTaskTest_test_perform_exception
()); |
| 4854 // } |
| 4855 // void test_perform_library() { |
| 4856 // String content = EngineTestCase.createSource([ |
| 4857 // "library lib;", |
| 4858 // "import 'lib2.dart';", |
| 4859 // "export 'lib3.dart';", |
| 4860 // "part 'part.dart';", |
| 4861 // "class A {"]); |
| 4862 // Source source = new TestSource.con2(content); |
| 4863 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 4864 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 4865 // ParseDartTask task = _createParseTask(context, source, content); |
| 4866 // task.perform(new TestTaskVisitor_ParseDartTaskTest_test_perform_library(c
ontext, source)); |
| 4867 // } |
| 4868 // void test_perform_part() { |
| 4869 // String content = EngineTestCase.createSource(["part of lib;", "class B {}
"]); |
| 4870 // Source source = new TestSource.con2(content); |
| 4871 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 4872 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 4873 // ParseDartTask task = _createParseTask(context, source, content); |
| 4874 // task.perform(new TestTaskVisitor_ParseDartTaskTest_test_perform_part(cont
ext, source)); |
| 4875 // } |
| 4876 // void test_perform_validateDirectives() { |
| 4877 // String content = EngineTestCase.createSource([ |
| 4878 // "library lib;", |
| 4879 // "import '/does/not/exist.dart';", |
| 4880 // "import 'invaliduri^.dart';", |
| 4881 // "export '\${a}lib3.dart';", |
| 4882 // "part 'part.dart';", |
| 4883 // "class A {}"]); |
| 4884 // Source source = new TestSource.con2(content); |
| 4885 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 4886 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 4887 // ParseDartTask task = _createParseTask(context, source, content); |
| 4888 // task.perform(new TestTaskVisitor_ParseDartTaskTest_test_perform_validateD
irectives(context, source)); |
| 4889 // } |
| 4890 // /** |
| 4891 // * Create and return a task that will parse the given content from the give
n source in the given |
| 4892 // * context. |
| 4893 // * |
| 4894 // * @param context the context to be passed to the task |
| 4895 // * @param source the source to be parsed |
| 4896 // * @param content the content of the source to be parsed |
| 4897 // * @return the task that was created |
| 4898 // * @throws AnalysisException if the task could not be created |
| 4899 // */ |
| 4900 // ParseDartTask _createParseTask(InternalAnalysisContext context, Source sour
ce, String content) { |
| 4901 // ScanDartTask scanTask = new ScanDartTask(context, source, context.getModi
ficationStamp(source), content); |
| 4902 // scanTask.perform(new TestTaskVisitor_ParseDartTaskTest_createParseTask())
; |
| 4903 // return new ParseDartTask(context, source, scanTask.modificationTime, scan
Task.tokenStream, scanTask.lineInfo); |
| 4904 // } |
| 4905 // static dartSuite() { |
| 4906 // _ut.group('ParseDartTaskTest', () { |
| 4907 // _ut.test('test_accept', () { |
| 4908 // final __test = new ParseDartTaskTest(); |
| 4909 // runJUnitTest(__test, __test.test_accept); |
| 4910 // }); |
| 4911 // _ut.test('test_getCompilationUnit', () { |
| 4912 // final __test = new ParseDartTaskTest(); |
| 4913 // runJUnitTest(__test, __test.test_getCompilationUnit); |
| 4914 // }); |
| 4915 // _ut.test('test_getErrors', () { |
| 4916 // final __test = new ParseDartTaskTest(); |
| 4917 // runJUnitTest(__test, __test.test_getErrors); |
| 4918 // }); |
| 4919 // _ut.test('test_getException', () { |
| 4920 // final __test = new ParseDartTaskTest(); |
| 4921 // runJUnitTest(__test, __test.test_getException); |
| 4922 // }); |
| 4923 // _ut.test('test_getModificationTime', () { |
| 4924 // final __test = new ParseDartTaskTest(); |
| 4925 // runJUnitTest(__test, __test.test_getModificationTime); |
| 4926 // }); |
| 4927 // _ut.test('test_getSource', () { |
| 4928 // final __test = new ParseDartTaskTest(); |
| 4929 // runJUnitTest(__test, __test.test_getSource); |
| 4930 // }); |
| 4931 // _ut.test('test_hasNonPartOfDirective', () { |
| 4932 // final __test = new ParseDartTaskTest(); |
| 4933 // runJUnitTest(__test, __test.test_hasNonPartOfDirective); |
| 4934 // }); |
| 4935 // _ut.test('test_hasPartOfDirective', () { |
| 4936 // final __test = new ParseDartTaskTest(); |
| 4937 // runJUnitTest(__test, __test.test_hasPartOfDirective); |
| 4938 // }); |
| 4939 // _ut.test('test_perform_exception', () { |
| 4940 // final __test = new ParseDartTaskTest(); |
| 4941 // runJUnitTest(__test, __test.test_perform_exception); |
| 4942 // }); |
| 4943 // _ut.test('test_perform_library', () { |
| 4944 // final __test = new ParseDartTaskTest(); |
| 4945 // runJUnitTest(__test, __test.test_perform_library); |
| 4946 // }); |
| 4947 // _ut.test('test_perform_part', () { |
| 4948 // final __test = new ParseDartTaskTest(); |
| 4949 // runJUnitTest(__test, __test.test_perform_part); |
| 4950 // }); |
| 4951 // _ut.test('test_perform_validateDirectives', () { |
| 4952 // final __test = new ParseDartTaskTest(); |
| 4953 // runJUnitTest(__test, __test.test_perform_validateDirectives); |
| 4954 // }); |
| 4955 // }); |
| 4956 // } |
| 4957 // } |
| 4958 // class ParseHtmlTaskTest extends EngineTestCase { |
| 4959 // void test_accept() { |
| 4960 // ParseHtmlTask task = new ParseHtmlTask(null, null, 0, ""); |
| 4961 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ParseHtmlTaskTes
t_test_accept())); |
| 4962 // } |
| 4963 // void test_getException() { |
| 4964 // ParseHtmlTask task = new ParseHtmlTask(null, null, 0, ""); |
| 4965 // JUnitTestCase.assertNull(task.exception); |
| 4966 // } |
| 4967 // void test_getHtmlUnit() { |
| 4968 // ParseHtmlTask task = new ParseHtmlTask(null, null, 0, ""); |
| 4969 // JUnitTestCase.assertNull(task.htmlUnit); |
| 4970 // } |
| 4971 // void test_getLineInfo() { |
| 4972 // ParseHtmlTask task = new ParseHtmlTask(null, null, 0, ""); |
| 4973 // JUnitTestCase.assertNull(task.lineInfo); |
| 4974 // } |
| 4975 // void test_getReferencedLibraries() { |
| 4976 // ParseHtmlTask task = new ParseHtmlTask(null, null, 0, ""); |
| 4977 // EngineTestCase.assertLength(0, task.referencedLibraries); |
| 4978 // } |
| 4979 // void test_getSource() { |
| 4980 // Source source = new TestSource.con2(""); |
| 4981 // ParseHtmlTask task = new ParseHtmlTask(null, source, 0, ""); |
| 4982 // JUnitTestCase.assertSame(source, task.source); |
| 4983 // } |
| 4984 // void test_perform_embedded_source() { |
| 4985 // String contents = EngineTestCase.createSource([ |
| 4986 // "<html>", |
| 4987 // "<head>", |
| 4988 // " <script type='application/dart'>", |
| 4989 // " void buttonPressed() {}", |
| 4990 // " </script>", |
| 4991 // "</head>", |
| 4992 // "<body>", |
| 4993 // "</body>", |
| 4994 // "</html>"]); |
| 4995 // TestLogger testLogger = new TestLogger(); |
| 4996 // ParseHtmlTask task = parseContents(contents, testLogger); |
| 4997 // EngineTestCase.assertLength(0, task.referencedLibraries); |
| 4998 // JUnitTestCase.assertEquals(0, testLogger.getErrorCount()); |
| 4999 // JUnitTestCase.assertEquals(0, testLogger.getInfoCount()); |
| 5000 // } |
| 5001 // void test_perform_empty_source_reference() { |
| 5002 // String contents = EngineTestCase.createSource([ |
| 5003 // "<html>", |
| 5004 // "<head>", |
| 5005 // " <script type='application/dart' src=''/>", |
| 5006 // "</head>", |
| 5007 // "<body>", |
| 5008 // "</body>", |
| 5009 // "</html>"]); |
| 5010 // TestLogger testLogger = new TestLogger(); |
| 5011 // ParseHtmlTask task = parseContents(contents, testLogger); |
| 5012 // EngineTestCase.assertLength(0, task.referencedLibraries); |
| 5013 // JUnitTestCase.assertEquals(0, testLogger.getErrorCount()); |
| 5014 // JUnitTestCase.assertEquals(0, testLogger.getInfoCount()); |
| 5015 // } |
| 5016 // void test_perform_invalid_source_reference() { |
| 5017 // String contents = EngineTestCase.createSource([ |
| 5018 // "<html>", |
| 5019 // "<head>", |
| 5020 // " <script type='application/dart' src='an;invalid:[]uri'/>", |
| 5021 // "</head>", |
| 5022 // "<body>", |
| 5023 // "</body>", |
| 5024 // "</html>"]); |
| 5025 // TestLogger testLogger = new TestLogger(); |
| 5026 // ParseHtmlTask task = parseContents(contents, testLogger); |
| 5027 // EngineTestCase.assertLength(0, task.referencedLibraries); |
| 5028 // JUnitTestCase.assertEquals(0, testLogger.getErrorCount()); |
| 5029 // JUnitTestCase.assertEquals(0, testLogger.getInfoCount()); |
| 5030 // } |
| 5031 // void test_perform_non_existing_source_reference() { |
| 5032 // String contents = EngineTestCase.createSource([ |
| 5033 // "<html>", |
| 5034 // "<head>", |
| 5035 // " <script type='application/dart' src='does/not/exist.dart'/>", |
| 5036 // "</head>", |
| 5037 // "<body>", |
| 5038 // "</body>", |
| 5039 // "</html>"]); |
| 5040 // TestLogger testLogger = new TestLogger(); |
| 5041 // ParseHtmlTask task = parseSource(new TestSource_ParseHtmlTaskTest_test_pe
rform_non_existing_source_reference(contents), contents, testLogger); |
| 5042 // EngineTestCase.assertLength(0, task.referencedLibraries); |
| 5043 // JUnitTestCase.assertEquals(0, testLogger.getErrorCount()); |
| 5044 // JUnitTestCase.assertEquals(0, testLogger.getInfoCount()); |
| 5045 // } |
| 5046 // void test_perform_referenced_source() { |
| 5047 // String contents = EngineTestCase.createSource([ |
| 5048 // "<html>", |
| 5049 // "<head>", |
| 5050 // " <script type='application/dart' src='test.dart'/>", |
| 5051 // "</head>", |
| 5052 // "<body>", |
| 5053 // "</body>", |
| 5054 // "</html>"]); |
| 5055 // TestLogger testLogger = new TestLogger(); |
| 5056 // ParseHtmlTask task = parseContents(contents, testLogger); |
| 5057 // EngineTestCase.assertLength(1, task.referencedLibraries); |
| 5058 // JUnitTestCase.assertEquals(0, testLogger.getErrorCount()); |
| 5059 // JUnitTestCase.assertEquals(0, testLogger.getInfoCount()); |
| 5060 // } |
| 5061 // ParseHtmlTask parseContents(String contents, TestLogger testLogger) => pars
eSource(new TestSource.con2(contents), contents, testLogger); |
| 5062 // ParseHtmlTask parseSource(Source source, String contents, TestLogger testLo
gger) { |
| 5063 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 5064 // context.setContents(source, contents); |
| 5065 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 5066 // ParseHtmlTask task = new ParseHtmlTask(context, source, context.getModifi
cationStamp(source), contents); |
| 5067 // Logger oldLogger = AnalysisEngine.instance.logger; |
| 5068 // try { |
| 5069 // AnalysisEngine.instance.logger = testLogger; |
| 5070 // task.perform(new TestTaskVisitor_ParseHtmlTaskTest_parseSource(context,
source)); |
| 5071 // } finally { |
| 5072 // AnalysisEngine.instance.logger = oldLogger; |
| 5073 // } |
| 5074 // return task; |
| 5075 // } |
| 5076 // static dartSuite() { |
| 5077 // _ut.group('ParseHtmlTaskTest', () { |
| 5078 // _ut.test('test_accept', () { |
| 5079 // final __test = new ParseHtmlTaskTest(); |
| 5080 // runJUnitTest(__test, __test.test_accept); |
| 5081 // }); |
| 5082 // _ut.test('test_getException', () { |
| 5083 // final __test = new ParseHtmlTaskTest(); |
| 5084 // runJUnitTest(__test, __test.test_getException); |
| 5085 // }); |
| 5086 // _ut.test('test_getHtmlUnit', () { |
| 5087 // final __test = new ParseHtmlTaskTest(); |
| 5088 // runJUnitTest(__test, __test.test_getHtmlUnit); |
| 5089 // }); |
| 5090 // _ut.test('test_getLineInfo', () { |
| 5091 // final __test = new ParseHtmlTaskTest(); |
| 5092 // runJUnitTest(__test, __test.test_getLineInfo); |
| 5093 // }); |
| 5094 // _ut.test('test_getReferencedLibraries', () { |
| 5095 // final __test = new ParseHtmlTaskTest(); |
| 5096 // runJUnitTest(__test, __test.test_getReferencedLibraries); |
| 5097 // }); |
| 5098 // _ut.test('test_getSource', () { |
| 5099 // final __test = new ParseHtmlTaskTest(); |
| 5100 // runJUnitTest(__test, __test.test_getSource); |
| 5101 // }); |
| 5102 // _ut.test('test_perform_embedded_source', () { |
| 5103 // final __test = new ParseHtmlTaskTest(); |
| 5104 // runJUnitTest(__test, __test.test_perform_embedded_source); |
| 5105 // }); |
| 5106 // _ut.test('test_perform_empty_source_reference', () { |
| 5107 // final __test = new ParseHtmlTaskTest(); |
| 5108 // runJUnitTest(__test, __test.test_perform_empty_source_reference); |
| 5109 // }); |
| 5110 // _ut.test('test_perform_invalid_source_reference', () { |
| 5111 // final __test = new ParseHtmlTaskTest(); |
| 5112 // runJUnitTest(__test, __test.test_perform_invalid_source_reference); |
| 5113 // }); |
| 5114 // _ut.test('test_perform_non_existing_source_reference', () { |
| 5115 // final __test = new ParseHtmlTaskTest(); |
| 5116 // runJUnitTest(__test, __test.test_perform_non_existing_source_referenc
e); |
| 5117 // }); |
| 5118 // _ut.test('test_perform_referenced_source', () { |
| 5119 // final __test = new ParseHtmlTaskTest(); |
| 5120 // runJUnitTest(__test, __test.test_perform_referenced_source); |
| 5121 // }); |
| 5122 // }); |
| 5123 // } |
| 5124 // } |
| 5125 // class PartitionManagerTest extends EngineTestCase { |
| 5126 // void test_creation() { |
| 5127 // JUnitTestCase.assertNotNull(new PartitionManager()); |
| 5128 // } |
| 5129 // void test_forSdk() { |
| 5130 // PartitionManager manager = new PartitionManager(); |
| 5131 // DartSdk sdk1 = new MockDartSdk(); |
| 5132 // SdkCachePartition partition1 = manager.forSdk(sdk1); |
| 5133 // JUnitTestCase.assertNotNull(partition1); |
| 5134 // JUnitTestCase.assertSame(partition1, manager.forSdk(sdk1)); |
| 5135 // DartSdk sdk2 = new MockDartSdk(); |
| 5136 // SdkCachePartition partition2 = manager.forSdk(sdk2); |
| 5137 // JUnitTestCase.assertNotNull(partition2); |
| 5138 // JUnitTestCase.assertSame(partition2, manager.forSdk(sdk2)); |
| 5139 // JUnitTestCase.assertNotSame(partition1, partition2); |
| 5140 // } |
| 5141 // static dartSuite() { |
| 5142 // _ut.group('PartitionManagerTest', () { |
| 5143 // _ut.test('test_creation', () { |
| 5144 // final __test = new PartitionManagerTest(); |
| 5145 // runJUnitTest(__test, __test.test_creation); |
| 5146 // }); |
| 5147 // _ut.test('test_forSdk', () { |
| 5148 // final __test = new PartitionManagerTest(); |
| 5149 // runJUnitTest(__test, __test.test_forSdk); |
| 5150 // }); |
| 5151 // }); |
| 5152 // } |
| 5153 // } |
| 5154 // class ResolveDartLibraryTaskTest extends EngineTestCase { |
| 5155 // void test_accept() { |
| 5156 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null
); |
| 5157 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ResolveDartLibra
ryTaskTest_test_accept())); |
| 5158 // } |
| 5159 // void test_getException() { |
| 5160 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null
); |
| 5161 // JUnitTestCase.assertNull(task.exception); |
| 5162 // } |
| 5163 // void test_getLibraryResolver() { |
| 5164 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null
); |
| 5165 // JUnitTestCase.assertNull(task.libraryResolver); |
| 5166 // } |
| 5167 // void test_getLibrarySource() { |
| 5168 // Source source = new TestSource.con2(""); |
| 5169 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, sour
ce); |
| 5170 // JUnitTestCase.assertSame(source, task.librarySource); |
| 5171 // } |
| 5172 // void test_getUnitSource() { |
| 5173 // Source source = new TestSource.con2(""); |
| 5174 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, source, nu
ll); |
| 5175 // JUnitTestCase.assertSame(source, task.unitSource); |
| 5176 // } |
| 5177 // void test_perform_exception() { |
| 5178 // TestSource source = new TestSource(); |
| 5179 // source.generateExceptionOnRead = true; |
| 5180 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 5181 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 5182 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(context, source,
source); |
| 5183 // task.perform(new TestTaskVisitor_ResolveDartLibraryTaskTest_test_perform_
exception()); |
| 5184 // } |
| 5185 // void test_perform_library() { |
| 5186 // Source source = new TestSource.con2(EngineTestCase.createSource(["library
lib;", "class A {}"])); |
| 5187 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 5188 // ResolveDartLibraryTask task = new ResolveDartLibraryTask(context, source,
source); |
| 5189 // task.perform(new TestTaskVisitor_ResolveDartLibraryTaskTest_test_perform_
library(source)); |
| 5190 // } |
| 5191 // static dartSuite() { |
| 5192 // _ut.group('ResolveDartLibraryTaskTest', () { |
| 5193 // _ut.test('test_accept', () { |
| 5194 // final __test = new ResolveDartLibraryTaskTest(); |
| 5195 // runJUnitTest(__test, __test.test_accept); |
| 5196 // }); |
| 5197 // _ut.test('test_getException', () { |
| 5198 // final __test = new ResolveDartLibraryTaskTest(); |
| 5199 // runJUnitTest(__test, __test.test_getException); |
| 5200 // }); |
| 5201 // _ut.test('test_getLibraryResolver', () { |
| 5202 // final __test = new ResolveDartLibraryTaskTest(); |
| 5203 // runJUnitTest(__test, __test.test_getLibraryResolver); |
| 5204 // }); |
| 5205 // _ut.test('test_getLibrarySource', () { |
| 5206 // final __test = new ResolveDartLibraryTaskTest(); |
| 5207 // runJUnitTest(__test, __test.test_getLibrarySource); |
| 5208 // }); |
| 5209 // _ut.test('test_getUnitSource', () { |
| 5210 // final __test = new ResolveDartLibraryTaskTest(); |
| 5211 // runJUnitTest(__test, __test.test_getUnitSource); |
| 5212 // }); |
| 5213 // _ut.test('test_perform_exception', () { |
| 5214 // final __test = new ResolveDartLibraryTaskTest(); |
| 5215 // runJUnitTest(__test, __test.test_perform_exception); |
| 5216 // }); |
| 5217 // _ut.test('test_perform_library', () { |
| 5218 // final __test = new ResolveDartLibraryTaskTest(); |
| 5219 // runJUnitTest(__test, __test.test_perform_library); |
| 5220 // }); |
| 5221 // }); |
| 5222 // } |
| 5223 // } |
| 5224 // class ResolveDartUnitTaskTest extends EngineTestCase { |
| 5225 // void test_accept() { |
| 5226 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, null); |
| 5227 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ResolveDartUnitT
askTest_test_accept())); |
| 5228 // } |
| 5229 // void test_getException() { |
| 5230 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, null); |
| 5231 // JUnitTestCase.assertNull(task.exception); |
| 5232 // } |
| 5233 // void test_getLibrarySource() { |
| 5234 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 5235 // LibraryElementImpl element = ElementFactory.library(context, "lib"); |
| 5236 // Source source = element.source; |
| 5237 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, element); |
| 5238 // JUnitTestCase.assertSame(source, task.librarySource); |
| 5239 // } |
| 5240 // void test_getModificationTime() { |
| 5241 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, null); |
| 5242 // JUnitTestCase.assertEquals(-1, task.modificationTime); |
| 5243 // } |
| 5244 // void test_getResolvedUnit() { |
| 5245 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, null, null); |
| 5246 // JUnitTestCase.assertNull(task.resolvedUnit); |
| 5247 // } |
| 5248 // void test_getSource() { |
| 5249 // Source source = new TestSource.con2(""); |
| 5250 // ResolveDartUnitTask task = new ResolveDartUnitTask(null, source, null); |
| 5251 // JUnitTestCase.assertSame(source, task.source); |
| 5252 // } |
| 5253 // void test_perform_exception() { |
| 5254 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 5255 // LibraryElementImpl element = ElementFactory.library(context, "lib"); |
| 5256 // TestSource source = new TestSource(); |
| 5257 // source.generateExceptionOnRead = true; |
| 5258 // (element.definingCompilationUnit as CompilationUnitElementImpl).source =
source; |
| 5259 // ResolveDartUnitTask task = new ResolveDartUnitTask(context, source, eleme
nt); |
| 5260 // task.perform(new TestTaskVisitor_ResolveDartUnitTaskTest_test_perform_exc
eption()); |
| 5261 // } |
| 5262 // void xtest_perform_library() { |
| 5263 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 5264 // LibraryElementImpl libraryElement = ElementFactory.library(context, "lib"
); |
| 5265 // CompilationUnitElementImpl unitElement = libraryElement.definingCompilati
onUnit as CompilationUnitElementImpl; |
| 5266 // ClassElementImpl classElement = ElementFactory.classElement2("A", []); |
| 5267 // classElement.nameOffset = 19; |
| 5268 // ConstructorElementImpl constructorElement = ElementFactory.constructorEle
ment2(classElement, null, []); |
| 5269 // constructorElement.synthetic = true; |
| 5270 // classElement.constructors = <ConstructorElement> [constructorElement]; |
| 5271 // unitElement.types = <ClassElement> [classElement]; |
| 5272 // Source source = unitElement.source; |
| 5273 // context.setContents(source, EngineTestCase.createSource(["library lib;",
"class A {}"])); |
| 5274 // ResolveDartUnitTask task = new ResolveDartUnitTask(context, source, libra
ryElement); |
| 5275 // task.perform(new TestTaskVisitor_ResolveDartUnitTaskTest_xtest_perform_li
brary(source, context)); |
| 5276 // } |
| 5277 // static dartSuite() { |
| 5278 // _ut.group('ResolveDartUnitTaskTest', () { |
| 5279 // _ut.test('test_accept', () { |
| 5280 // final __test = new ResolveDartUnitTaskTest(); |
| 5281 // runJUnitTest(__test, __test.test_accept); |
| 5282 // }); |
| 5283 // _ut.test('test_getException', () { |
| 5284 // final __test = new ResolveDartUnitTaskTest(); |
| 5285 // runJUnitTest(__test, __test.test_getException); |
| 5286 // }); |
| 5287 // _ut.test('test_getLibrarySource', () { |
| 5288 // final __test = new ResolveDartUnitTaskTest(); |
| 5289 // runJUnitTest(__test, __test.test_getLibrarySource); |
| 5290 // }); |
| 5291 // _ut.test('test_getModificationTime', () { |
| 5292 // final __test = new ResolveDartUnitTaskTest(); |
| 5293 // runJUnitTest(__test, __test.test_getModificationTime); |
| 5294 // }); |
| 5295 // _ut.test('test_getResolvedUnit', () { |
| 5296 // final __test = new ResolveDartUnitTaskTest(); |
| 5297 // runJUnitTest(__test, __test.test_getResolvedUnit); |
| 5298 // }); |
| 5299 // _ut.test('test_getSource', () { |
| 5300 // final __test = new ResolveDartUnitTaskTest(); |
| 5301 // runJUnitTest(__test, __test.test_getSource); |
| 5302 // }); |
| 5303 // _ut.test('test_perform_exception', () { |
| 5304 // final __test = new ResolveDartUnitTaskTest(); |
| 5305 // runJUnitTest(__test, __test.test_perform_exception); |
| 5306 // }); |
| 5307 // }); |
| 5308 // } |
| 5309 // } |
| 5310 // class ResolveHtmlTaskTest extends EngineTestCase { |
| 5311 // void test_accept() { |
| 5312 // ResolveHtmlTask task = new ResolveHtmlTask(null, null, 0, null); |
| 5313 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ResolveHtmlTaskT
est_test_accept())); |
| 5314 // } |
| 5315 // void test_getElement() { |
| 5316 // ResolveHtmlTask task = new ResolveHtmlTask(null, null, 0, null); |
| 5317 // JUnitTestCase.assertNull(task.element); |
| 5318 // } |
| 5319 // void test_getException() { |
| 5320 // ResolveHtmlTask task = new ResolveHtmlTask(null, null, 0, null); |
| 5321 // JUnitTestCase.assertNull(task.exception); |
| 5322 // } |
| 5323 // void test_getModificationTime() { |
| 5324 // int modificationTime = 28; |
| 5325 // ResolveHtmlTask task = new ResolveHtmlTask(null, null, modificationTime,
null); |
| 5326 // JUnitTestCase.assertEquals(modificationTime, task.modificationTime); |
| 5327 // } |
| 5328 // void test_getResolutionErrors() { |
| 5329 // ResolveHtmlTask task = new ResolveHtmlTask(null, null, 0, null); |
| 5330 // EngineTestCase.assertLength(0, task.resolutionErrors); |
| 5331 // } |
| 5332 // void test_getSource() { |
| 5333 // Source source = new TestSource.con2(""); |
| 5334 // ResolveHtmlTask task = new ResolveHtmlTask(null, source, 0, null); |
| 5335 // JUnitTestCase.assertSame(source, task.source); |
| 5336 // } |
| 5337 // void test_perform_exception() { |
| 5338 // Source source = new TestSource(); |
| 5339 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 5340 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 5341 // ResolveHtmlTask task = new ResolveHtmlTask(context, source, 0, null); |
| 5342 // task.perform(new TestTaskVisitor_ResolveHtmlTaskTest_test_perform_excepti
on()); |
| 5343 // } |
| 5344 // void test_perform_valid() { |
| 5345 // int modificationStamp = 73; |
| 5346 // String content = EngineTestCase.createSource([ |
| 5347 // "<html>", |
| 5348 // "<head>", |
| 5349 // " <script type='application/dart'>", |
| 5350 // " void f() { x = 0; }", |
| 5351 // " </script>", |
| 5352 // "</head>", |
| 5353 // "<body>", |
| 5354 // "</body>", |
| 5355 // "</html>"]); |
| 5356 // Source source = new TestSource.con1(FileUtilities2.createFile("/test.html
"), content); |
| 5357 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 5358 // ParseHtmlTask parseTask = new ParseHtmlTask(context, source, modification
Stamp, content); |
| 5359 // parseTask.perform(new TestTaskVisitor_ResolveHtmlTaskTest_test_perform_va
lid()); |
| 5360 // ResolveHtmlTask task = new ResolveHtmlTask(context, source, parseTask.mod
ificationTime, parseTask.htmlUnit); |
| 5361 // task.perform(new TestTaskVisitor_ResolveHtmlTaskTest_test_perform_valid_2
(modificationStamp, source)); |
| 5362 // } |
| 5363 // static dartSuite() { |
| 5364 // _ut.group('ResolveHtmlTaskTest', () { |
| 5365 // _ut.test('test_accept', () { |
| 5366 // final __test = new ResolveHtmlTaskTest(); |
| 5367 // runJUnitTest(__test, __test.test_accept); |
| 5368 // }); |
| 5369 // _ut.test('test_getElement', () { |
| 5370 // final __test = new ResolveHtmlTaskTest(); |
| 5371 // runJUnitTest(__test, __test.test_getElement); |
| 5372 // }); |
| 5373 // _ut.test('test_getException', () { |
| 5374 // final __test = new ResolveHtmlTaskTest(); |
| 5375 // runJUnitTest(__test, __test.test_getException); |
| 5376 // }); |
| 5377 // _ut.test('test_getModificationTime', () { |
| 5378 // final __test = new ResolveHtmlTaskTest(); |
| 5379 // runJUnitTest(__test, __test.test_getModificationTime); |
| 5380 // }); |
| 5381 // _ut.test('test_getResolutionErrors', () { |
| 5382 // final __test = new ResolveHtmlTaskTest(); |
| 5383 // runJUnitTest(__test, __test.test_getResolutionErrors); |
| 5384 // }); |
| 5385 // _ut.test('test_getSource', () { |
| 5386 // final __test = new ResolveHtmlTaskTest(); |
| 5387 // runJUnitTest(__test, __test.test_getSource); |
| 5388 // }); |
| 5389 // _ut.test('test_perform_exception', () { |
| 5390 // final __test = new ResolveHtmlTaskTest(); |
| 5391 // runJUnitTest(__test, __test.test_perform_exception); |
| 5392 // }); |
| 5393 // _ut.test('test_perform_valid', () { |
| 5394 // final __test = new ResolveHtmlTaskTest(); |
| 5395 // runJUnitTest(__test, __test.test_perform_valid); |
| 5396 // }); |
| 5397 // }); |
| 5398 // } |
| 5399 // } |
| 5400 // class ScanDartTaskTest extends EngineTestCase { |
| 5401 // void test_accept() { |
| 5402 // ScanDartTask task = new ScanDartTask(null, null, 0, null); |
| 5403 // JUnitTestCase.assertTrue(task.accept(new TestTaskVisitor_ScanDartTaskTest
_test_accept())); |
| 5404 // } |
| 5405 // void test_getErrors() { |
| 5406 // ScanDartTask task = new ScanDartTask(null, null, 0, null); |
| 5407 // EngineTestCase.assertLength(0, task.errors); |
| 5408 // } |
| 5409 // void test_getException() { |
| 5410 // ScanDartTask task = new ScanDartTask(null, null, 0, null); |
| 5411 // JUnitTestCase.assertNull(task.exception); |
| 5412 // } |
| 5413 // void test_getLineInfo() { |
| 5414 // ScanDartTask task = new ScanDartTask(null, null, 0, null); |
| 5415 // JUnitTestCase.assertNull(task.lineInfo); |
| 5416 // } |
| 5417 // void test_getModificationTime() { |
| 5418 // ScanDartTask task = new ScanDartTask(null, null, 0, null); |
| 5419 // JUnitTestCase.assertEquals(0, task.modificationTime); |
| 5420 // } |
| 5421 // void test_getSource() { |
| 5422 // Source source = new TestSource.con2(""); |
| 5423 // ScanDartTask task = new ScanDartTask(null, source, 0, null); |
| 5424 // JUnitTestCase.assertSame(source, task.source); |
| 5425 // } |
| 5426 // void test_perform_valid() { |
| 5427 // String content = EngineTestCase.createSource(["class A {}"]); |
| 5428 // Source source = new TestSource.con2(content); |
| 5429 // InternalAnalysisContext context = new AnalysisContextImpl(); |
| 5430 // context.sourceFactory = new SourceFactory([new FileUriResolver()]); |
| 5431 // ScanDartTask task = new ScanDartTask(context, source, source.modification
Stamp, content); |
| 5432 // task.perform(new TestTaskVisitor_ScanDartTaskTest_test_perform_valid(cont
ext, source)); |
| 5433 // } |
| 5434 // static dartSuite() { |
| 5435 // _ut.group('ScanDartTaskTest', () { |
| 5436 // _ut.test('test_accept', () { |
| 5437 // final __test = new ScanDartTaskTest(); |
| 5438 // runJUnitTest(__test, __test.test_accept); |
| 5439 // }); |
| 5440 // _ut.test('test_getErrors', () { |
| 5441 // final __test = new ScanDartTaskTest(); |
| 5442 // runJUnitTest(__test, __test.test_getErrors); |
| 5443 // }); |
| 5444 // _ut.test('test_getException', () { |
| 5445 // final __test = new ScanDartTaskTest(); |
| 5446 // runJUnitTest(__test, __test.test_getException); |
| 5447 // }); |
| 5448 // _ut.test('test_getLineInfo', () { |
| 5449 // final __test = new ScanDartTaskTest(); |
| 5450 // runJUnitTest(__test, __test.test_getLineInfo); |
| 5451 // }); |
| 5452 // _ut.test('test_getModificationTime', () { |
| 5453 // final __test = new ScanDartTaskTest(); |
| 5454 // runJUnitTest(__test, __test.test_getModificationTime); |
| 5455 // }); |
| 5456 // _ut.test('test_getSource', () { |
| 5457 // final __test = new ScanDartTaskTest(); |
| 5458 // runJUnitTest(__test, __test.test_getSource); |
| 5459 // }); |
| 5460 // _ut.test('test_perform_valid', () { |
| 5461 // final __test = new ScanDartTaskTest(); |
| 5462 // runJUnitTest(__test, __test.test_perform_valid); |
| 5463 // }); |
| 5464 // }); |
| 5465 // } |
| 5466 // } |
| 5467 // class SdkCachePartitionTest extends EngineTestCase { |
| 5468 // void test_contains_false() { |
| 5469 // SdkCachePartition partition = new SdkCachePartition(8); |
| 5470 // Source source = new TestSource(); |
| 5471 // JUnitTestCase.assertFalse(partition.contains(source)); |
| 5472 // } |
| 5473 // void test_contains_true() { |
| 5474 // SdkCachePartition partition = new SdkCachePartition(8); |
| 5475 // SourceFactory factory = new SourceFactory([new DartUriResolver(DirectoryB
asedDartSdk.defaultSdk)]); |
| 5476 // Source source = factory.forUri("dart:core"); |
| 5477 // JUnitTestCase.assertTrue(partition.contains(source)); |
| 5478 // } |
| 5479 // void test_creation() { |
| 5480 // JUnitTestCase.assertNotNull(new SdkCachePartition(8)); |
| 5481 // } |
| 5482 // static dartSuite() { |
| 5483 // _ut.group('SdkCachePartitionTest', () { |
| 5484 // _ut.test('test_contains_false', () { |
| 5485 // final __test = new SdkCachePartitionTest(); |
| 5486 // runJUnitTest(__test, __test.test_contains_false); |
| 5487 // }); |
| 5488 // _ut.test('test_contains_true', () { |
| 5489 // final __test = new SdkCachePartitionTest(); |
| 5490 // runJUnitTest(__test, __test.test_contains_true); |
| 5491 // }); |
| 5492 // _ut.test('test_creation', () { |
| 5493 // final __test = new SdkCachePartitionTest(); |
| 5494 // runJUnitTest(__test, __test.test_creation); |
| 5495 // }); |
| 5496 // }); |
| 5497 // } |
| 5498 // } |
| 5499 // class SourceContainer_AnalysisContextImplTest_test_applyChanges_removeContain
er implements SourceContainer { |
| 5500 // Source libB; |
| 5501 // SourceContainer_AnalysisContextImplTest_test_applyChanges_removeContainer(t
his.libB); |
| 5502 // @override |
| 5503 // bool contains(Source source) => source == libB; |
| 5504 // } |
| 5505 // /** |
| 5506 // * Instances of the class `TestAnalysisContext` implement an analysis context
in which every |
| 5507 // * method will cause a test to fail when invoked. |
| 5508 // */ |
| 5509 // class TestAnalysisContext implements InternalAnalysisContext { |
| 5510 // @override |
| 5511 // void addSourceInfo(Source source, SourceEntry info) { |
| 5512 // JUnitTestCase.fail("Unexpected invocation of addSourceInfo"); |
| 5513 // } |
| 5514 // @override |
| 5515 // void applyAnalysisDelta(AnalysisDelta delta) { |
| 5516 // JUnitTestCase.fail("Unexpected invocation of applyAnalysisDelta"); |
| 5517 // } |
| 5518 // @override |
| 5519 // void applyChanges(ChangeSet changeSet) { |
| 5520 // JUnitTestCase.fail("Unexpected invocation of applyChanges"); |
| 5521 // } |
| 5522 // @override |
| 5523 // String computeDocumentationComment(Element element) { |
| 5524 // JUnitTestCase.fail("Unexpected invocation of computeDocumentationComment"
); |
| 5525 // return null; |
| 5526 // } |
| 5527 // @override |
| 5528 // List<AnalysisError> computeErrors(Source source) { |
| 5529 // JUnitTestCase.fail("Unexpected invocation of computeErrors"); |
| 5530 // return null; |
| 5531 // } |
| 5532 // @override |
| 5533 // List<Source> computeExportedLibraries(Source source) { |
| 5534 // JUnitTestCase.fail("Unexpected invocation of computeExportedLibraries"); |
| 5535 // return null; |
| 5536 // } |
| 5537 // @override |
| 5538 // HtmlElement computeHtmlElement(Source source) { |
| 5539 // JUnitTestCase.fail("Unexpected invocation of computeHtmlElement"); |
| 5540 // return null; |
| 5541 // } |
| 5542 // @override |
| 5543 // List<Source> computeImportedLibraries(Source source) { |
| 5544 // JUnitTestCase.fail("Unexpected invocation of computeImportedLibraries"); |
| 5545 // return null; |
| 5546 // } |
| 5547 // @override |
| 5548 // SourceKind computeKindOf(Source source) { |
| 5549 // JUnitTestCase.fail("Unexpected invocation of computeKindOf"); |
| 5550 // return null; |
| 5551 // } |
| 5552 // @override |
| 5553 // LibraryElement computeLibraryElement(Source source) { |
| 5554 // JUnitTestCase.fail("Unexpected invocation of computeLibraryElement"); |
| 5555 // return null; |
| 5556 // } |
| 5557 // @override |
| 5558 // LineInfo computeLineInfo(Source source) { |
| 5559 // JUnitTestCase.fail("Unexpected invocation of computeLineInfo"); |
| 5560 // return null; |
| 5561 // } |
| 5562 // @override |
| 5563 // ResolvableCompilationUnit computeResolvableCompilationUnit(Source source) { |
| 5564 // JUnitTestCase.fail("Unexpected invocation of computeResolvableCompilation
Unit"); |
| 5565 // return null; |
| 5566 // } |
| 5567 // @override |
| 5568 // void dispose() { |
| 5569 // JUnitTestCase.fail("Unexpected invocation of dispose"); |
| 5570 // } |
| 5571 // @override |
| 5572 // bool exists(Source source) { |
| 5573 // JUnitTestCase.fail("Unexpected invocation of exists"); |
| 5574 // return false; |
| 5575 // } |
| 5576 // @override |
| 5577 // AnalysisContext extractContext(SourceContainer container) { |
| 5578 // JUnitTestCase.fail("Unexpected invocation of extractContext"); |
| 5579 // return null; |
| 5580 // } |
| 5581 // @override |
| 5582 // InternalAnalysisContext extractContextInto(SourceContainer container, Inter
nalAnalysisContext newContext) { |
| 5583 // JUnitTestCase.fail("Unexpected invocation of extractContextInto"); |
| 5584 // return null; |
| 5585 // } |
| 5586 // @override |
| 5587 // AnalysisOptions get analysisOptions { |
| 5588 // JUnitTestCase.fail("Unexpected invocation of getAnalysisOptions"); |
| 5589 // return null; |
| 5590 // } |
| 5591 // @override |
| 5592 // AngularApplication getAngularApplicationWithHtml(Source htmlSource) { |
| 5593 // JUnitTestCase.fail("Unexpected invocation of getAngularApplicationWithHtm
l"); |
| 5594 // return null; |
| 5595 // } |
| 5596 // @override |
| 5597 // CompilationUnitElement getCompilationUnitElement(Source unitSource, Source
librarySource) { |
| 5598 // JUnitTestCase.fail("Unexpected invocation of getCompilationUnitElement"); |
| 5599 // return null; |
| 5600 // } |
| 5601 // @override |
| 5602 // TimestampedData<String> getContents(Source source) { |
| 5603 // JUnitTestCase.fail("Unexpected invocation of getContents"); |
| 5604 // return null; |
| 5605 // } |
| 5606 // @override |
| 5607 // void getContentsToReceiver(Source source, Source_ContentReceiver receiver)
{ |
| 5608 // JUnitTestCase.fail("Unexpected invocation of getContentsToReceiver"); |
| 5609 // } |
| 5610 // @override |
| 5611 // DeclaredVariables get declaredVariables { |
| 5612 // JUnitTestCase.fail("Unexpected invocation of getDeclaredVariables"); |
| 5613 // return null; |
| 5614 // } |
| 5615 // @override |
| 5616 // Element getElement(ElementLocation location) { |
| 5617 // JUnitTestCase.fail("Unexpected invocation of getElement"); |
| 5618 // return null; |
| 5619 // } |
| 5620 // @override |
| 5621 // AnalysisErrorInfo getErrors(Source source) { |
| 5622 // JUnitTestCase.fail("Unexpected invocation of getErrors"); |
| 5623 // return null; |
| 5624 // } |
| 5625 // @override |
| 5626 // HtmlElement getHtmlElement(Source source) { |
| 5627 // JUnitTestCase.fail("Unexpected invocation of getHtmlElement"); |
| 5628 // return null; |
| 5629 // } |
| 5630 // @override |
| 5631 // List<Source> getHtmlFilesReferencing(Source source) { |
| 5632 // JUnitTestCase.fail("Unexpected invocation of getHtmlFilesReferencing"); |
| 5633 // return null; |
| 5634 // } |
| 5635 // @override |
| 5636 // List<Source> get htmlSources { |
| 5637 // JUnitTestCase.fail("Unexpected invocation of getHtmlSources"); |
| 5638 // return null; |
| 5639 // } |
| 5640 // @override |
| 5641 // SourceKind getKindOf(Source source) { |
| 5642 // JUnitTestCase.fail("Unexpected invocation of getKindOf"); |
| 5643 // return null; |
| 5644 // } |
| 5645 // @override |
| 5646 // List<Source> get launchableClientLibrarySources { |
| 5647 // JUnitTestCase.fail("Unexpected invocation of getLaunchableClientLibrarySo
urces"); |
| 5648 // return null; |
| 5649 // } |
| 5650 // @override |
| 5651 // List<Source> get launchableServerLibrarySources { |
| 5652 // JUnitTestCase.fail("Unexpected invocation of getLaunchableServerLibrarySo
urces"); |
| 5653 // return null; |
| 5654 // } |
| 5655 // @override |
| 5656 // List<Source> getLibrariesContaining(Source source) { |
| 5657 // JUnitTestCase.fail("Unexpected invocation of getLibrariesContaining"); |
| 5658 // return null; |
| 5659 // } |
| 5660 // @override |
| 5661 // List<Source> getLibrariesDependingOn(Source librarySource) { |
| 5662 // JUnitTestCase.fail("Unexpected invocation of getLibrariesDependingOn"); |
| 5663 // return null; |
| 5664 // } |
| 5665 // @override |
| 5666 // List<Source> getLibrariesReferencedFromHtml(Source htmlSource) { |
| 5667 // JUnitTestCase.fail("Unexpected invocation of getLibrariesReferencedFromHt
ml"); |
| 5668 // return null; |
| 5669 // } |
| 5670 // @override |
| 5671 // LibraryElement getLibraryElement(Source source) { |
| 5672 // JUnitTestCase.fail("Unexpected invocation of getLibraryElement"); |
| 5673 // return null; |
| 5674 // } |
| 5675 // @override |
| 5676 // List<Source> get librarySources { |
| 5677 // JUnitTestCase.fail("Unexpected invocation of getLibrarySources"); |
| 5678 // return null; |
| 5679 // } |
| 5680 // @override |
| 5681 // LineInfo getLineInfo(Source source) { |
| 5682 // JUnitTestCase.fail("Unexpected invocation of getLineInfo"); |
| 5683 // return null; |
| 5684 // } |
| 5685 // @override |
| 5686 // int getModificationStamp(Source source) { |
| 5687 // JUnitTestCase.fail("Unexpected invocation of getModificationStamp"); |
| 5688 // return 0; |
| 5689 // } |
| 5690 // @override |
| 5691 // List<Source> get prioritySources { |
| 5692 // JUnitTestCase.fail("Unexpected invocation of getPrioritySources"); |
| 5693 // return null; |
| 5694 // } |
| 5695 // @override |
| 5696 // Namespace getPublicNamespace(LibraryElement library) { |
| 5697 // JUnitTestCase.fail("Unexpected invocation of getPublicNamespace"); |
| 5698 // return null; |
| 5699 // } |
| 5700 // @override |
| 5701 // List<Source> get refactoringUnsafeSources { |
| 5702 // JUnitTestCase.fail("Unexpected invocation of getRefactoringUnsafeSources"
); |
| 5703 // return null; |
| 5704 // } |
| 5705 // @override |
| 5706 // CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElemen
t library) { |
| 5707 // JUnitTestCase.fail("Unexpected invocation of getResolvedCompilationUnit")
; |
| 5708 // return null; |
| 5709 // } |
| 5710 // @override |
| 5711 // CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libra
rySource) { |
| 5712 // JUnitTestCase.fail("Unexpected invocation of getResolvedCompilationUnit")
; |
| 5713 // return null; |
| 5714 // } |
| 5715 // @override |
| 5716 // HtmlUnit getResolvedHtmlUnit(Source htmlSource) { |
| 5717 // JUnitTestCase.fail("Unexpected invocation of getResolvedHtmlUnit"); |
| 5718 // return null; |
| 5719 // } |
| 5720 // @override |
| 5721 // SourceFactory get sourceFactory { |
| 5722 // JUnitTestCase.fail("Unexpected invocation of getSourceFactory"); |
| 5723 // return null; |
| 5724 // } |
| 5725 // @override |
| 5726 // AnalysisContextStatistics get statistics { |
| 5727 // JUnitTestCase.fail("Unexpected invocation of getStatistics"); |
| 5728 // return null; |
| 5729 // } |
| 5730 // @override |
| 5731 // TypeProvider get typeProvider { |
| 5732 // JUnitTestCase.fail("Unexpected invocation of getTypeProvider"); |
| 5733 // return null; |
| 5734 // } |
| 5735 // @override |
| 5736 // bool isClientLibrary(Source librarySource) { |
| 5737 // JUnitTestCase.fail("Unexpected invocation of isClientLibrary"); |
| 5738 // return false; |
| 5739 // } |
| 5740 // @override |
| 5741 // bool get isDisposed { |
| 5742 // JUnitTestCase.fail("Unexpected invocation of isDisposed"); |
| 5743 // return false; |
| 5744 // } |
| 5745 // @override |
| 5746 // bool isServerLibrary(Source librarySource) { |
| 5747 // JUnitTestCase.fail("Unexpected invocation of isServerLibrary"); |
| 5748 // return false; |
| 5749 // } |
| 5750 // @override |
| 5751 // void mergeContext(AnalysisContext context) { |
| 5752 // JUnitTestCase.fail("Unexpected invocation of mergeContext"); |
| 5753 // } |
| 5754 // @override |
| 5755 // CompilationUnit parseCompilationUnit(Source source) { |
| 5756 // JUnitTestCase.fail("Unexpected invocation of parseCompilationUnit"); |
| 5757 // return null; |
| 5758 // } |
| 5759 // @override |
| 5760 // HtmlUnit parseHtmlUnit(Source source) { |
| 5761 // JUnitTestCase.fail("Unexpected invocation of parseHtmlUnit"); |
| 5762 // return null; |
| 5763 // } |
| 5764 // @override |
| 5765 // AnalysisResult performAnalysisTask() { |
| 5766 // JUnitTestCase.fail("Unexpected invocation of performAnalysisTask"); |
| 5767 // return null; |
| 5768 // } |
| 5769 // @override |
| 5770 // void recordLibraryElements(Map<Source, LibraryElement> elementMap) { |
| 5771 // JUnitTestCase.fail("Unexpected invocation of recordLibraryElements"); |
| 5772 // } |
| 5773 // @override |
| 5774 // CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement li
brary) { |
| 5775 // JUnitTestCase.fail("Unexpected invocation of resolveCompilationUnit"); |
| 5776 // return null; |
| 5777 // } |
| 5778 // @override |
| 5779 // CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySo
urce) { |
| 5780 // JUnitTestCase.fail("Unexpected invocation of resolveCompilationUnit"); |
| 5781 // return null; |
| 5782 // } |
| 5783 // @override |
| 5784 // HtmlUnit resolveHtmlUnit(Source htmlSource) { |
| 5785 // JUnitTestCase.fail("Unexpected invocation of resolveHtmlUnit"); |
| 5786 // return null; |
| 5787 // } |
| 5788 // @override |
| 5789 // void set analysisOptions(AnalysisOptions options) { |
| 5790 // JUnitTestCase.fail("Unexpected invocation of setAnalysisOptions"); |
| 5791 // } |
| 5792 // @override |
| 5793 // void set analysisPriorityOrder(List<Source> sources) { |
| 5794 // JUnitTestCase.fail("Unexpected invocation of setAnalysisPriorityOrder"); |
| 5795 // } |
| 5796 // @override |
| 5797 // void setChangedContents(Source source, String contents, int offset, int old
Length, int newLength) { |
| 5798 // JUnitTestCase.fail("Unexpected invocation of setChangedContents"); |
| 5799 // } |
| 5800 // @override |
| 5801 // void setContents(Source source, String contents) { |
| 5802 // JUnitTestCase.fail("Unexpected invocation of setContents"); |
| 5803 // } |
| 5804 // @override |
| 5805 // void set sourceFactory(SourceFactory factory) { |
| 5806 // JUnitTestCase.fail("Unexpected invocation of setSourceFactory"); |
| 5807 // } |
| 5808 // } |
| 5809 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_addSourceI
nfo extends TestAnalysisContext { |
| 5810 // List<bool> invoked; |
| 5811 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_addSourceInfo(
this.invoked) : super(); |
| 5812 // @override |
| 5813 // void addSourceInfo(Source source, SourceEntry info) { |
| 5814 // invoked[0] = true; |
| 5815 // } |
| 5816 // } |
| 5817 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_applyChang
es extends TestAnalysisContext { |
| 5818 // List<bool> invoked; |
| 5819 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_applyChanges(t
his.invoked) : super(); |
| 5820 // @override |
| 5821 // void applyChanges(ChangeSet changeSet) { |
| 5822 // invoked[0] = true; |
| 5823 // } |
| 5824 // } |
| 5825 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeDoc
umentationComment extends TestAnalysisContext { |
| 5826 // List<bool> invoked; |
| 5827 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeDocumen
tationComment(this.invoked) : super(); |
| 5828 // @override |
| 5829 // String computeDocumentationComment(Element element) { |
| 5830 // invoked[0] = true; |
| 5831 // return null; |
| 5832 // } |
| 5833 // } |
| 5834 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeErr
ors extends TestAnalysisContext { |
| 5835 // List<bool> invoked; |
| 5836 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeErrors(
this.invoked) : super(); |
| 5837 // @override |
| 5838 // List<AnalysisError> computeErrors(Source source) { |
| 5839 // invoked[0] = true; |
| 5840 // return AnalysisError.NO_ERRORS; |
| 5841 // } |
| 5842 // } |
| 5843 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeExp
ortedLibraries extends TestAnalysisContext { |
| 5844 // List<bool> invoked; |
| 5845 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeExporte
dLibraries(this.invoked) : super(); |
| 5846 // @override |
| 5847 // List<Source> computeExportedLibraries(Source source) { |
| 5848 // invoked[0] = true; |
| 5849 // return null; |
| 5850 // } |
| 5851 // } |
| 5852 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeHtm
lElement extends TestAnalysisContext { |
| 5853 // List<bool> invoked; |
| 5854 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeHtmlEle
ment(this.invoked) : super(); |
| 5855 // @override |
| 5856 // HtmlElement computeHtmlElement(Source source) { |
| 5857 // invoked[0] = true; |
| 5858 // return null; |
| 5859 // } |
| 5860 // } |
| 5861 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeImp
ortedLibraries extends TestAnalysisContext { |
| 5862 // List<bool> invoked; |
| 5863 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeImporte
dLibraries(this.invoked) : super(); |
| 5864 // @override |
| 5865 // List<Source> computeImportedLibraries(Source source) { |
| 5866 // invoked[0] = true; |
| 5867 // return null; |
| 5868 // } |
| 5869 // } |
| 5870 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeKin
dOf extends TestAnalysisContext { |
| 5871 // List<bool> invoked; |
| 5872 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeKindOf(
this.invoked) : super(); |
| 5873 // @override |
| 5874 // SourceKind computeKindOf(Source source) { |
| 5875 // invoked[0] = true; |
| 5876 // return null; |
| 5877 // } |
| 5878 // } |
| 5879 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeLib
raryElement extends TestAnalysisContext { |
| 5880 // List<bool> invoked; |
| 5881 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeLibrary
Element(this.invoked) : super(); |
| 5882 // @override |
| 5883 // LibraryElement computeLibraryElement(Source source) { |
| 5884 // invoked[0] = true; |
| 5885 // return null; |
| 5886 // } |
| 5887 // } |
| 5888 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeLin
eInfo extends TestAnalysisContext { |
| 5889 // List<bool> invoked; |
| 5890 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeLineInf
o(this.invoked) : super(); |
| 5891 // @override |
| 5892 // LineInfo computeLineInfo(Source source) { |
| 5893 // invoked[0] = true; |
| 5894 // return null; |
| 5895 // } |
| 5896 // } |
| 5897 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeRes
olvableCompilationUnit extends TestAnalysisContext { |
| 5898 // List<bool> invoked; |
| 5899 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_computeResolva
bleCompilationUnit(this.invoked) : super(); |
| 5900 // @override |
| 5901 // ResolvableCompilationUnit computeResolvableCompilationUnit(Source source) { |
| 5902 // invoked[0] = true; |
| 5903 // return null; |
| 5904 // } |
| 5905 // } |
| 5906 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_dispose ex
tends TestAnalysisContext { |
| 5907 // List<bool> invoked; |
| 5908 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_dispose(this.i
nvoked) : super(); |
| 5909 // @override |
| 5910 // void dispose() { |
| 5911 // invoked[0] = true; |
| 5912 // } |
| 5913 // } |
| 5914 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_exists ext
ends TestAnalysisContext { |
| 5915 // List<bool> invoked; |
| 5916 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_exists(this.in
voked) : super(); |
| 5917 // @override |
| 5918 // bool exists(Source source) { |
| 5919 // invoked[0] = true; |
| 5920 // return false; |
| 5921 // } |
| 5922 // } |
| 5923 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extractCon
text extends TestAnalysisContext { |
| 5924 // List<bool> invoked; |
| 5925 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extractContext
(this.invoked) : super(); |
| 5926 // @override |
| 5927 // InternalAnalysisContext extractContextInto(SourceContainer container, Inter
nalAnalysisContext newContext) { |
| 5928 // invoked[0] = true; |
| 5929 // return null; |
| 5930 // } |
| 5931 // } |
| 5932 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extractCon
textInto extends TestAnalysisContext { |
| 5933 // List<bool> invoked; |
| 5934 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_extractContext
Into(this.invoked) : super(); |
| 5935 // @override |
| 5936 // InternalAnalysisContext extractContextInto(SourceContainer container, Inter
nalAnalysisContext newContext) { |
| 5937 // invoked[0] = true; |
| 5938 // return null; |
| 5939 // } |
| 5940 // } |
| 5941 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAnalysi
sOptions extends TestAnalysisContext { |
| 5942 // List<bool> invoked; |
| 5943 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAnalysisOpt
ions(this.invoked) : super(); |
| 5944 // @override |
| 5945 // AnalysisOptions get analysisOptions { |
| 5946 // invoked[0] = true; |
| 5947 // return null; |
| 5948 // } |
| 5949 // } |
| 5950 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAngular
ApplicationWithHtml extends TestAnalysisContext { |
| 5951 // List<bool> invoked; |
| 5952 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getAngularAppl
icationWithHtml(this.invoked) : super(); |
| 5953 // @override |
| 5954 // AngularApplication getAngularApplicationWithHtml(Source htmlSource) { |
| 5955 // invoked[0] = true; |
| 5956 // return null; |
| 5957 // } |
| 5958 // } |
| 5959 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getCompila
tionUnitElement extends TestAnalysisContext { |
| 5960 // List<bool> invoked; |
| 5961 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getCompilation
UnitElement(this.invoked) : super(); |
| 5962 // @override |
| 5963 // CompilationUnitElement getCompilationUnitElement(Source unitSource, Source
librarySource) { |
| 5964 // invoked[0] = true; |
| 5965 // return null; |
| 5966 // } |
| 5967 // } |
| 5968 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getContent
s extends TestAnalysisContext { |
| 5969 // List<bool> invoked; |
| 5970 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getContents(th
is.invoked) : super(); |
| 5971 // @override |
| 5972 // TimestampedData<String> getContents(Source source) { |
| 5973 // invoked[0] = true; |
| 5974 // return null; |
| 5975 // } |
| 5976 // } |
| 5977 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getContent
sToReceiver extends TestAnalysisContext { |
| 5978 // List<bool> invoked; |
| 5979 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getContentsToR
eceiver(this.invoked) : super(); |
| 5980 // @override |
| 5981 // void getContentsToReceiver(Source source, Source_ContentReceiver receiver)
{ |
| 5982 // invoked[0] = true; |
| 5983 // } |
| 5984 // } |
| 5985 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getElement
extends TestAnalysisContext { |
| 5986 // List<bool> invoked; |
| 5987 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getElement(thi
s.invoked) : super(); |
| 5988 // @override |
| 5989 // Element getElement(ElementLocation location) { |
| 5990 // invoked[0] = true; |
| 5991 // return null; |
| 5992 // } |
| 5993 // } |
| 5994 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getErrors
extends TestAnalysisContext { |
| 5995 // List<bool> invoked; |
| 5996 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getErrors(this
.invoked) : super(); |
| 5997 // @override |
| 5998 // AnalysisErrorInfo getErrors(Source source) { |
| 5999 // invoked[0] = true; |
| 6000 // return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null); |
| 6001 // } |
| 6002 // } |
| 6003 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlEle
ment extends TestAnalysisContext { |
| 6004 // List<bool> invoked; |
| 6005 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlElement
(this.invoked) : super(); |
| 6006 // @override |
| 6007 // HtmlElement getHtmlElement(Source source) { |
| 6008 // invoked[0] = true; |
| 6009 // return null; |
| 6010 // } |
| 6011 // } |
| 6012 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlFil
esReferencing extends TestAnalysisContext { |
| 6013 // List<bool> invoked; |
| 6014 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlFilesRe
ferencing(this.invoked) : super(); |
| 6015 // @override |
| 6016 // List<Source> getHtmlFilesReferencing(Source source) { |
| 6017 // invoked[0] = true; |
| 6018 // return Source.EMPTY_ARRAY; |
| 6019 // } |
| 6020 // } |
| 6021 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlSou
rces extends TestAnalysisContext { |
| 6022 // List<bool> invoked; |
| 6023 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getHtmlSources
(this.invoked) : super(); |
| 6024 // @override |
| 6025 // List<Source> get htmlSources { |
| 6026 // invoked[0] = true; |
| 6027 // return Source.EMPTY_ARRAY; |
| 6028 // } |
| 6029 // } |
| 6030 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getKindOf
extends TestAnalysisContext { |
| 6031 // List<bool> invoked; |
| 6032 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getKindOf(this
.invoked) : super(); |
| 6033 // @override |
| 6034 // SourceKind getKindOf(Source source) { |
| 6035 // invoked[0] = true; |
| 6036 // return null; |
| 6037 // } |
| 6038 // } |
| 6039 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLauncha
bleClientLibrarySources extends TestAnalysisContext { |
| 6040 // List<bool> invoked; |
| 6041 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLaunchableC
lientLibrarySources(this.invoked) : super(); |
| 6042 // @override |
| 6043 // List<Source> get launchableClientLibrarySources { |
| 6044 // invoked[0] = true; |
| 6045 // return Source.EMPTY_ARRAY; |
| 6046 // } |
| 6047 // } |
| 6048 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLauncha
bleServerLibrarySources extends TestAnalysisContext { |
| 6049 // List<bool> invoked; |
| 6050 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLaunchableS
erverLibrarySources(this.invoked) : super(); |
| 6051 // @override |
| 6052 // List<Source> get launchableServerLibrarySources { |
| 6053 // invoked[0] = true; |
| 6054 // return Source.EMPTY_ARRAY; |
| 6055 // } |
| 6056 // } |
| 6057 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrari
esContaining extends TestAnalysisContext { |
| 6058 // List<bool> invoked; |
| 6059 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrariesCo
ntaining(this.invoked) : super(); |
| 6060 // @override |
| 6061 // List<Source> getLibrariesContaining(Source source) { |
| 6062 // invoked[0] = true; |
| 6063 // return Source.EMPTY_ARRAY; |
| 6064 // } |
| 6065 // } |
| 6066 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrari
esDependingOn extends TestAnalysisContext { |
| 6067 // List<bool> invoked; |
| 6068 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrariesDe
pendingOn(this.invoked) : super(); |
| 6069 // @override |
| 6070 // List<Source> getLibrariesDependingOn(Source librarySource) { |
| 6071 // invoked[0] = true; |
| 6072 // return Source.EMPTY_ARRAY; |
| 6073 // } |
| 6074 // } |
| 6075 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrari
esReferencedFromHtml extends TestAnalysisContext { |
| 6076 // List<bool> invoked; |
| 6077 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrariesRe
ferencedFromHtml(this.invoked) : super(); |
| 6078 // @override |
| 6079 // List<Source> getLibrariesReferencedFromHtml(Source htmlSource) { |
| 6080 // invoked[0] = true; |
| 6081 // return null; |
| 6082 // } |
| 6083 // } |
| 6084 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrary
Element extends TestAnalysisContext { |
| 6085 // List<bool> invoked; |
| 6086 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibraryElem
ent(this.invoked) : super(); |
| 6087 // @override |
| 6088 // LibraryElement getLibraryElement(Source source) { |
| 6089 // invoked[0] = true; |
| 6090 // return null; |
| 6091 // } |
| 6092 // } |
| 6093 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrary
Sources extends TestAnalysisContext { |
| 6094 // List<bool> invoked; |
| 6095 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLibrarySour
ces(this.invoked) : super(); |
| 6096 // @override |
| 6097 // List<Source> get librarySources { |
| 6098 // invoked[0] = true; |
| 6099 // return Source.EMPTY_ARRAY; |
| 6100 // } |
| 6101 // } |
| 6102 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLineInf
o extends TestAnalysisContext { |
| 6103 // List<bool> invoked; |
| 6104 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getLineInfo(th
is.invoked) : super(); |
| 6105 // @override |
| 6106 // LineInfo getLineInfo(Source source) { |
| 6107 // invoked[0] = true; |
| 6108 // return null; |
| 6109 // } |
| 6110 // } |
| 6111 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getModific
ationStamp extends TestAnalysisContext { |
| 6112 // List<bool> invoked; |
| 6113 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getModificatio
nStamp(this.invoked) : super(); |
| 6114 // @override |
| 6115 // int getModificationStamp(Source source) { |
| 6116 // invoked[0] = true; |
| 6117 // return 0; |
| 6118 // } |
| 6119 // } |
| 6120 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getPublicN
amespace extends TestAnalysisContext { |
| 6121 // List<bool> invoked; |
| 6122 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getPublicNames
pace(this.invoked) : super(); |
| 6123 // @override |
| 6124 // Namespace getPublicNamespace(LibraryElement library) { |
| 6125 // invoked[0] = true; |
| 6126 // return null; |
| 6127 // } |
| 6128 // } |
| 6129 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRefacto
ringUnsafeSources extends TestAnalysisContext { |
| 6130 // List<bool> invoked; |
| 6131 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getRefactoring
UnsafeSources(this.invoked) : super(); |
| 6132 // @override |
| 6133 // List<Source> get refactoringUnsafeSources { |
| 6134 // invoked[0] = true; |
| 6135 // return null; |
| 6136 // } |
| 6137 // } |
| 6138 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolve
dCompilationUnit_element extends TestAnalysisContext { |
| 6139 // List<bool> invoked; |
| 6140 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolvedCom
pilationUnit_element(this.invoked) : super(); |
| 6141 // @override |
| 6142 // CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElemen
t library) { |
| 6143 // invoked[0] = true; |
| 6144 // return null; |
| 6145 // } |
| 6146 // } |
| 6147 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolve
dCompilationUnit_source extends TestAnalysisContext { |
| 6148 // List<bool> invoked; |
| 6149 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolvedCom
pilationUnit_source(this.invoked) : super(); |
| 6150 // @override |
| 6151 // CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libra
rySource) { |
| 6152 // invoked[0] = true; |
| 6153 // return null; |
| 6154 // } |
| 6155 // } |
| 6156 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolve
dHtmlUnit extends TestAnalysisContext { |
| 6157 // List<bool> invoked; |
| 6158 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getResolvedHtm
lUnit(this.invoked) : super(); |
| 6159 // @override |
| 6160 // HtmlUnit getResolvedHtmlUnit(Source htmlSource) { |
| 6161 // invoked[0] = true; |
| 6162 // return null; |
| 6163 // } |
| 6164 // } |
| 6165 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getSourceF
actory extends TestAnalysisContext { |
| 6166 // List<bool> invoked; |
| 6167 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getSourceFacto
ry(this.invoked) : super(); |
| 6168 // @override |
| 6169 // SourceFactory get sourceFactory { |
| 6170 // invoked[0] = true; |
| 6171 // return null; |
| 6172 // } |
| 6173 // } |
| 6174 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getStatist
ics extends TestAnalysisContext { |
| 6175 // List<bool> invoked; |
| 6176 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getStatistics(
this.invoked) : super(); |
| 6177 // @override |
| 6178 // AnalysisContextStatistics get statistics { |
| 6179 // invoked[0] = true; |
| 6180 // return null; |
| 6181 // } |
| 6182 // } |
| 6183 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getTypePro
vider extends TestAnalysisContext { |
| 6184 // List<bool> invoked; |
| 6185 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_getTypeProvide
r(this.invoked) : super(); |
| 6186 // @override |
| 6187 // TypeProvider get typeProvider { |
| 6188 // invoked[0] = true; |
| 6189 // return null; |
| 6190 // } |
| 6191 // } |
| 6192 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isClientLi
brary extends TestAnalysisContext { |
| 6193 // List<bool> invoked; |
| 6194 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isClientLibrar
y(this.invoked) : super(); |
| 6195 // @override |
| 6196 // bool isClientLibrary(Source librarySource) { |
| 6197 // invoked[0] = true; |
| 6198 // return false; |
| 6199 // } |
| 6200 // } |
| 6201 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isDisposed
extends TestAnalysisContext { |
| 6202 // List<bool> invoked; |
| 6203 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isDisposed(thi
s.invoked) : super(); |
| 6204 // @override |
| 6205 // bool get isDisposed { |
| 6206 // invoked[0] = true; |
| 6207 // return false; |
| 6208 // } |
| 6209 // } |
| 6210 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isServerLi
brary extends TestAnalysisContext { |
| 6211 // List<bool> invoked; |
| 6212 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_isServerLibrar
y(this.invoked) : super(); |
| 6213 // @override |
| 6214 // bool isServerLibrary(Source librarySource) { |
| 6215 // invoked[0] = true; |
| 6216 // return false; |
| 6217 // } |
| 6218 // } |
| 6219 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_mergeConte
xt extends TestAnalysisContext { |
| 6220 // List<bool> invoked; |
| 6221 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_mergeContext(t
his.invoked) : super(); |
| 6222 // @override |
| 6223 // void mergeContext(AnalysisContext context) { |
| 6224 // invoked[0] = true; |
| 6225 // } |
| 6226 // } |
| 6227 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parseCompi
lationUnit extends TestAnalysisContext { |
| 6228 // List<bool> invoked; |
| 6229 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parseCompilati
onUnit(this.invoked) : super(); |
| 6230 // @override |
| 6231 // CompilationUnit parseCompilationUnit(Source source) { |
| 6232 // invoked[0] = true; |
| 6233 // return null; |
| 6234 // } |
| 6235 // } |
| 6236 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parseHtmlU
nit extends TestAnalysisContext { |
| 6237 // List<bool> invoked; |
| 6238 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_parseHtmlUnit(
this.invoked) : super(); |
| 6239 // @override |
| 6240 // HtmlUnit parseHtmlUnit(Source source) { |
| 6241 // invoked[0] = true; |
| 6242 // return null; |
| 6243 // } |
| 6244 // } |
| 6245 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_performAna
lysisTask extends TestAnalysisContext { |
| 6246 // List<bool> invoked; |
| 6247 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_performAnalysi
sTask(this.invoked) : super(); |
| 6248 // @override |
| 6249 // AnalysisResult performAnalysisTask() { |
| 6250 // invoked[0] = true; |
| 6251 // return new AnalysisResult(new List<ChangeNotice>(0), 0, null, 0); |
| 6252 // } |
| 6253 // } |
| 6254 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_recordLibr
aryElements extends TestAnalysisContext { |
| 6255 // List<bool> invoked; |
| 6256 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_recordLibraryE
lements(this.invoked) : super(); |
| 6257 // @override |
| 6258 // void recordLibraryElements(Map<Source, LibraryElement> elementMap) { |
| 6259 // invoked[0] = true; |
| 6260 // } |
| 6261 // } |
| 6262 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveCom
pilationUnit extends TestAnalysisContext { |
| 6263 // List<bool> invoked; |
| 6264 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveCompila
tionUnit(this.invoked) : super(); |
| 6265 // @override |
| 6266 // CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySo
urce) { |
| 6267 // invoked[0] = true; |
| 6268 // return null; |
| 6269 // } |
| 6270 // } |
| 6271 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveCom
pilationUnit_element extends TestAnalysisContext { |
| 6272 // List<bool> invoked; |
| 6273 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveCompila
tionUnit_element(this.invoked) : super(); |
| 6274 // @override |
| 6275 // CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement li
brary) { |
| 6276 // invoked[0] = true; |
| 6277 // return null; |
| 6278 // } |
| 6279 // } |
| 6280 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveHtm
lUnit extends TestAnalysisContext { |
| 6281 // List<bool> invoked; |
| 6282 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_resolveHtmlUni
t(this.invoked) : super(); |
| 6283 // @override |
| 6284 // HtmlUnit resolveHtmlUnit(Source htmlSource) { |
| 6285 // invoked[0] = true; |
| 6286 // return null; |
| 6287 // } |
| 6288 // } |
| 6289 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAnalysi
sOptions extends TestAnalysisContext { |
| 6290 // List<bool> invoked; |
| 6291 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAnalysisOpt
ions(this.invoked) : super(); |
| 6292 // @override |
| 6293 // void set analysisOptions(AnalysisOptions options) { |
| 6294 // invoked[0] = true; |
| 6295 // } |
| 6296 // } |
| 6297 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAnalysi
sPriorityOrder extends TestAnalysisContext { |
| 6298 // List<bool> invoked; |
| 6299 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setAnalysisPri
orityOrder(this.invoked) : super(); |
| 6300 // @override |
| 6301 // void set analysisPriorityOrder(List<Source> sources) { |
| 6302 // invoked[0] = true; |
| 6303 // } |
| 6304 // } |
| 6305 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setChanged
Contents extends TestAnalysisContext { |
| 6306 // List<bool> invoked; |
| 6307 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setChangedCont
ents(this.invoked) : super(); |
| 6308 // @override |
| 6309 // void setChangedContents(Source source, String contents, int offset, int old
Length, int newLength) { |
| 6310 // invoked[0] = true; |
| 6311 // } |
| 6312 // } |
| 6313 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setContent
s extends TestAnalysisContext { |
| 6314 // List<bool> invoked; |
| 6315 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setContents(th
is.invoked) : super(); |
| 6316 // @override |
| 6317 // void setContents(Source source, String contents) { |
| 6318 // invoked[0] = true; |
| 6319 // } |
| 6320 // } |
| 6321 // class TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setSourceF
actory extends TestAnalysisContext { |
| 6322 // List<bool> invoked; |
| 6323 // TestAnalysisContext_InstrumentedAnalysisContextImplTest_test_setSourceFacto
ry(this.invoked) : super(); |
| 6324 // @override |
| 6325 // void set sourceFactory(SourceFactory factory) { |
| 6326 // invoked[0] = true; |
| 6327 // } |
| 6328 // } |
| 6329 // /** |
| 6330 // * This subclass of DartEntryImpl allows test code to invoke the copyFrom() m
ethod. |
| 6331 // */ |
| 6332 // class TestDartEntryImpl extends DartEntryImpl { |
| 6333 // @override |
| 6334 // void copyFrom(SourceEntryImpl entry) { |
| 6335 // super.copyFrom(entry); |
| 6336 // } |
| 6337 // } |
| 6338 // class TestSource_AnalysisContextImplTest_test_exists_true extends TestSource
{ |
| 6339 // @override |
| 6340 // bool exists() => true; |
| 6341 // } |
| 6342 // class TestSource_AnalysisContextImplTest_test_getModificationStamp_fromSource
extends TestSource { |
| 6343 // long stamp; |
| 6344 // TestSource_AnalysisContextImplTest_test_getModificationStamp_fromSource(thi
s.stamp) : super(); |
| 6345 // @override |
| 6346 // int get modificationStamp => stamp; |
| 6347 // } |
| 6348 // class TestSource_AnalysisContextImplTest_test_getModificationStamp_overridden
extends TestSource { |
| 6349 // long stamp; |
| 6350 // TestSource_AnalysisContextImplTest_test_getModificationStamp_overridden(thi
s.stamp) : super(); |
| 6351 // @override |
| 6352 // int get modificationStamp => stamp; |
| 6353 // } |
| 6354 // class TestSource_ParseHtmlTaskTest_test_perform_non_existing_source_reference
extends TestSource { |
| 6355 // TestSource_ParseHtmlTaskTest_test_perform_non_existing_source_reference(Str
ing arg0) : super.con2(arg0); |
| 6356 // @override |
| 6357 // Uri resolveRelativeUri(Uri containedUri) { |
| 6358 // try { |
| 6359 // return parseUriWithException("file:/does/not/exist.dart"); |
| 6360 // } on URISyntaxException catch (exception) { |
| 6361 // return null; |
| 6362 // } |
| 6363 // } |
| 6364 // } |
| 6365 // /** |
| 6366 // * Instances of the class `TestTaskVisitor` implement a task visitor that fai
ls if any of its |
| 6367 // * methods are invoked. Subclasses typically override the expected methods to
not cause a test |
| 6368 // * failure. |
| 6369 // */ |
| 6370 // class TestTaskVisitor<E> implements AnalysisTaskVisitor<E> { |
| 6371 // @override |
| 6372 // E visitBuildDartElementModelTask(BuildDartElementModelTask task) { |
| 6373 // JUnitTestCase.fail("Unexpectedly invoked visitBuildDartElementModelTask")
; |
| 6374 // return null; |
| 6375 // } |
| 6376 // @override |
| 6377 // E visitGenerateDartErrorsTask(GenerateDartErrorsTask task) { |
| 6378 // JUnitTestCase.fail("Unexpectedly invoked visitGenerateDartErrorsTask"); |
| 6379 // return null; |
| 6380 // } |
| 6381 // @override |
| 6382 // E visitGenerateDartHintsTask(GenerateDartHintsTask task) { |
| 6383 // JUnitTestCase.fail("Unexpectedly invoked visitGenerateDartHintsTask"); |
| 6384 // return null; |
| 6385 // } |
| 6386 // @override |
| 6387 // E visitGetContentTask(GetContentTask task) { |
| 6388 // JUnitTestCase.fail("Unexpectedly invoked visitGetContentsTask"); |
| 6389 // return null; |
| 6390 // } |
| 6391 // @override |
| 6392 // E visitIncrementalAnalysisTask(IncrementalAnalysisTask incrementalAnalysisT
ask) { |
| 6393 // JUnitTestCase.fail("Unexpectedly invoked visitIncrementalAnalysisTask"); |
| 6394 // return null; |
| 6395 // } |
| 6396 // @override |
| 6397 // E visitParseDartTask(ParseDartTask task) { |
| 6398 // JUnitTestCase.fail("Unexpectedly invoked visitParseDartTask"); |
| 6399 // return null; |
| 6400 // } |
| 6401 // @override |
| 6402 // E visitParseHtmlTask(ParseHtmlTask task) { |
| 6403 // JUnitTestCase.fail("Unexpectedly invoked visitParseHtmlTask"); |
| 6404 // return null; |
| 6405 // } |
| 6406 // @override |
| 6407 // E visitPolymerBuildHtmlTask(PolymerBuildHtmlTask task) { |
| 6408 // JUnitTestCase.fail("Unexpectedly invoked visitPolymerBuildHtmlTask"); |
| 6409 // return null; |
| 6410 // } |
| 6411 // @override |
| 6412 // E visitPolymerResolveHtmlTask(PolymerResolveHtmlTask task) { |
| 6413 // JUnitTestCase.fail("Unexpectedly invoked visitPolymerResolveHtmlTask"); |
| 6414 // return null; |
| 6415 // } |
| 6416 // @override |
| 6417 // E visitResolveAngularComponentTemplateTask(ResolveAngularComponentTemplateT
ask task) { |
| 6418 // JUnitTestCase.fail("Unexpectedly invoked visitResolveAngularComponentTemp
lateTask"); |
| 6419 // return null; |
| 6420 // } |
| 6421 // @override |
| 6422 // E visitResolveAngularEntryHtmlTask(ResolveAngularEntryHtmlTask task) { |
| 6423 // JUnitTestCase.fail("Unexpectedly invoked visitResolveAngularEntryHtmlTask
"); |
| 6424 // return null; |
| 6425 // } |
| 6426 // @override |
| 6427 // E visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task) { |
| 6428 // JUnitTestCase.fail("Unexpectedly invoked visitResolveDartLibraryCycleTask
"); |
| 6429 // return null; |
| 6430 // } |
| 6431 // @override |
| 6432 // E visitResolveDartLibraryTask(ResolveDartLibraryTask task) { |
| 6433 // JUnitTestCase.fail("Unexpectedly invoked visitResolveDartLibraryTask"); |
| 6434 // return null; |
| 6435 // } |
| 6436 // @override |
| 6437 // E visitResolveDartUnitTask(ResolveDartUnitTask task) { |
| 6438 // JUnitTestCase.fail("Unexpectedly invoked visitResolveDartUnitTask"); |
| 6439 // return null; |
| 6440 // } |
| 6441 // @override |
| 6442 // E visitResolveHtmlTask(ResolveHtmlTask task) { |
| 6443 // JUnitTestCase.fail("Unexpectedly invoked visitResolveHtmlTask"); |
| 6444 // return null; |
| 6445 // } |
| 6446 // @override |
| 6447 // E visitScanDartTask(ScanDartTask task) { |
| 6448 // JUnitTestCase.fail("Unexpectedly invoked visitScanDartTask"); |
| 6449 // return null; |
| 6450 // } |
| 6451 // } |
| 6452 // class TestTaskVisitor_BuildDartElementModelTaskTest_test_accept extends TestT
askVisitor<Boolean> { |
| 6453 // @override |
| 6454 // bool visitBuildDartElementModelTask(BuildDartElementModelTask task) => true
; |
| 6455 // } |
| 6456 // class TestTaskVisitor_BuildDartElementModelTaskTest_test_perform_multiple ext
ends TestTaskVisitor<Object> { |
| 6457 // @override |
| 6458 // Object visitBuildDartElementModelTask(BuildDartElementModelTask task) { |
| 6459 // CaughtException exception = task.exception; |
| 6460 // if (exception != null) { |
| 6461 // throw exception; |
| 6462 // } |
| 6463 // EngineTestCase.assertLength(0, task.errorListener.errors); |
| 6464 // List<ResolvableLibrary> librariesInCycle = task.librariesInCycle; |
| 6465 // EngineTestCase.assertSizeOfList(3, librariesInCycle); |
| 6466 // for (int i = 0; i < 3; i++) { |
| 6467 // ResolvableLibrary library = librariesInCycle[i]; |
| 6468 // LibraryElementImpl libraryElement = library.libraryElement; |
| 6469 // JUnitTestCase.assertNotNull(libraryElement); |
| 6470 // CompilationUnitElement unitElement = libraryElement.definingCompilation
Unit; |
| 6471 // JUnitTestCase.assertNotNull(unitElement); |
| 6472 // List<ClassElement> types = unitElement.types; |
| 6473 // EngineTestCase.assertLength(1, types); |
| 6474 // } |
| 6475 // return null; |
| 6476 // } |
| 6477 // } |
| 6478 // class TestTaskVisitor_BuildDartElementModelTaskTest_test_perform_single_noPar
ts extends TestTaskVisitor<Object> { |
| 6479 // @override |
| 6480 // Object visitBuildDartElementModelTask(BuildDartElementModelTask task) { |
| 6481 // CaughtException exception = task.exception; |
| 6482 // if (exception != null) { |
| 6483 // throw exception; |
| 6484 // } |
| 6485 // EngineTestCase.assertLength(0, task.errorListener.errors); |
| 6486 // List<ResolvableLibrary> librariesInCycle = task.librariesInCycle; |
| 6487 // EngineTestCase.assertSizeOfList(1, librariesInCycle); |
| 6488 // ResolvableLibrary library = librariesInCycle[0]; |
| 6489 // LibraryElementImpl libraryElement = library.libraryElement; |
| 6490 // JUnitTestCase.assertNotNull(libraryElement); |
| 6491 // CompilationUnitElement unitElement = libraryElement.definingCompilationUn
it; |
| 6492 // JUnitTestCase.assertNotNull(unitElement); |
| 6493 // List<ClassElement> types = unitElement.types; |
| 6494 // EngineTestCase.assertLength(2, types); |
| 6495 // InterfaceType supertype = types[1].supertype; |
| 6496 // JUnitTestCase.assertNotNull(supertype); |
| 6497 // JUnitTestCase.assertSame(types[0], supertype.element); |
| 6498 // return null; |
| 6499 // } |
| 6500 // } |
| 6501 // class TestTaskVisitor_BuildDartElementModelTaskTest_test_perform_single_parts
extends TestTaskVisitor<Object> { |
| 6502 // @override |
| 6503 // Object visitBuildDartElementModelTask(BuildDartElementModelTask task) { |
| 6504 // CaughtException exception = task.exception; |
| 6505 // if (exception != null) { |
| 6506 // throw exception; |
| 6507 // } |
| 6508 // EngineTestCase.assertLength(0, task.errorListener.errors); |
| 6509 // List<ResolvableLibrary> librariesInCycle = task.librariesInCycle; |
| 6510 // EngineTestCase.assertSizeOfList(1, librariesInCycle); |
| 6511 // ResolvableLibrary library = librariesInCycle[0]; |
| 6512 // LibraryElementImpl libraryElement = library.libraryElement; |
| 6513 // JUnitTestCase.assertNotNull(libraryElement); |
| 6514 // CompilationUnitElement definingUnit = libraryElement.definingCompilationU
nit; |
| 6515 // JUnitTestCase.assertNotNull(definingUnit); |
| 6516 // List<ClassElement> definingTypes = definingUnit.types; |
| 6517 // EngineTestCase.assertLength(2, definingTypes); |
| 6518 // List<CompilationUnitElement> parts = libraryElement.parts; |
| 6519 // JUnitTestCase.assertNotNull(parts); |
| 6520 // EngineTestCase.assertLength(2, parts); |
| 6521 // List<ClassElement> types = parts[0].types; |
| 6522 // EngineTestCase.assertLength(1, types); |
| 6523 // InterfaceType supertype = types[0].supertype; |
| 6524 // JUnitTestCase.assertNotNull(supertype); |
| 6525 // JUnitTestCase.assertSame(definingTypes[1], supertype.element); |
| 6526 // types = parts[1].types; |
| 6527 // EngineTestCase.assertLength(1, types); |
| 6528 // InterfaceType implementedType = types[0].interfaces[0]; |
| 6529 // JUnitTestCase.assertNotNull(implementedType); |
| 6530 // JUnitTestCase.assertSame(definingTypes[0], implementedType.element); |
| 6531 // return null; |
| 6532 // } |
| 6533 // } |
| 6534 // class TestTaskVisitor_GenerateDartErrorsTaskTest_test_accept extends TestTask
Visitor<Boolean> { |
| 6535 // @override |
| 6536 // bool visitGenerateDartErrorsTask(GenerateDartErrorsTask task) => true; |
| 6537 // } |
| 6538 // class TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform extends TestTas
kVisitor<Boolean> { |
| 6539 // LibraryElement libraryElement; |
| 6540 // Source source; |
| 6541 // TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform(this.libraryElement
, this.source) : super(); |
| 6542 // @override |
| 6543 // bool visitGenerateDartErrorsTask(GenerateDartErrorsTask task) { |
| 6544 // CaughtException exception = task.exception; |
| 6545 // if (exception != null) { |
| 6546 // throw exception; |
| 6547 // } |
| 6548 // JUnitTestCase.assertSame(libraryElement, task.libraryElement); |
| 6549 // JUnitTestCase.assertSame(source, task.source); |
| 6550 // List<AnalysisError> errors = task.errors; |
| 6551 // EngineTestCase.assertLength(1, errors); |
| 6552 // return true; |
| 6553 // } |
| 6554 // } |
| 6555 // class TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform_validateDirecti
ves extends TestTaskVisitor<Boolean> { |
| 6556 // LibraryElement libraryElement; |
| 6557 // Source source; |
| 6558 // TestTaskVisitor_GenerateDartErrorsTaskTest_test_perform_validateDirectives(
this.libraryElement, this.source) : super(); |
| 6559 // @override |
| 6560 // bool visitGenerateDartErrorsTask(GenerateDartErrorsTask task) { |
| 6561 // CaughtException exception = task.exception; |
| 6562 // if (exception != null) { |
| 6563 // throw exception; |
| 6564 // } |
| 6565 // JUnitTestCase.assertSame(libraryElement, task.libraryElement); |
| 6566 // JUnitTestCase.assertSame(source, task.source); |
| 6567 // List<AnalysisError> errors = task.errors; |
| 6568 // EngineTestCase.assertLength(1, errors); |
| 6569 // JUnitTestCase.assertSame(CompileTimeErrorCode.URI_DOES_NOT_EXIST, errors[
0].errorCode); |
| 6570 // return true; |
| 6571 // } |
| 6572 // } |
| 6573 // class TestTaskVisitor_GenerateDartHintsTaskTest_test_accept extends TestTaskV
isitor<Boolean> { |
| 6574 // @override |
| 6575 // bool visitGenerateDartHintsTask(GenerateDartHintsTask task) => true; |
| 6576 // } |
| 6577 // class TestTaskVisitor_GenerateDartHintsTaskTest_test_perform extends TestTask
Visitor<Boolean> { |
| 6578 // Source librarySource; |
| 6579 // Source partSource; |
| 6580 // TestTaskVisitor_GenerateDartHintsTaskTest_test_perform(this.librarySource,
this.partSource) : super(); |
| 6581 // @override |
| 6582 // bool visitGenerateDartHintsTask(GenerateDartHintsTask task) { |
| 6583 // CaughtException exception = task.exception; |
| 6584 // if (exception != null) { |
| 6585 // throw exception; |
| 6586 // } |
| 6587 // JUnitTestCase.assertNotNull(task.libraryElement); |
| 6588 // HashMap<Source, TimestampedData<List<AnalysisError>>> hintMap = task.hint
Map; |
| 6589 // EngineTestCase.assertSizeOfMap(2, hintMap); |
| 6590 // EngineTestCase.assertLength(1, hintMap[librarySource].data); |
| 6591 // EngineTestCase.assertLength(0, hintMap[partSource].data); |
| 6592 // return true; |
| 6593 // } |
| 6594 // } |
| 6595 // class TestTaskVisitor_GetContentTaskTest_test_accept extends TestTaskVisitor<
Boolean> { |
| 6596 // @override |
| 6597 // bool visitGetContentTask(GetContentTask task) => true; |
| 6598 // } |
| 6599 // class TestTaskVisitor_GetContentTaskTest_test_perform_exception extends TestT
askVisitor<Boolean> { |
| 6600 // @override |
| 6601 // bool visitGetContentTask(GetContentTask task) { |
| 6602 // JUnitTestCase.assertNotNull(task.exception); |
| 6603 // return true; |
| 6604 // } |
| 6605 // } |
| 6606 // class TestTaskVisitor_GetContentTaskTest_test_perform_valid extends TestTaskV
isitor<Boolean> { |
| 6607 // InternalAnalysisContext context; |
| 6608 // Source source; |
| 6609 // TestTaskVisitor_GetContentTaskTest_test_perform_valid(this.context, this.so
urce) : super(); |
| 6610 // @override |
| 6611 // bool visitGetContentTask(GetContentTask task) { |
| 6612 // CaughtException exception = task.exception; |
| 6613 // if (exception != null) { |
| 6614 // throw exception; |
| 6615 // } |
| 6616 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6617 // JUnitTestCase.assertSame(source, task.source); |
| 6618 // return true; |
| 6619 // } |
| 6620 // } |
| 6621 // class TestTaskVisitor_IncrementalAnalysisTaskTest_assertTask extends TestTask
Visitor<CompilationUnit> { |
| 6622 // IncrementalAnalysisTask task; |
| 6623 // TestTaskVisitor_IncrementalAnalysisTaskTest_assertTask(this.task) : super()
; |
| 6624 // @override |
| 6625 // CompilationUnit visitIncrementalAnalysisTask(IncrementalAnalysisTask increm
entalAnalysisTask) => task.compilationUnit; |
| 6626 // } |
| 6627 // class TestTaskVisitor_IncrementalAnalysisTaskTest_test_accept extends TestTas
kVisitor<Boolean> { |
| 6628 // @override |
| 6629 // bool visitIncrementalAnalysisTask(IncrementalAnalysisTask task) => true; |
| 6630 // } |
| 6631 // class TestTaskVisitor_ParseDartTaskTest_createParseTask extends TestTaskVisit
or<Object> { |
| 6632 // @override |
| 6633 // Object visitScanDartTask(ScanDartTask task) => null; |
| 6634 // } |
| 6635 // class TestTaskVisitor_ParseDartTaskTest_test_accept extends TestTaskVisitor<B
oolean> { |
| 6636 // @override |
| 6637 // bool visitParseDartTask(ParseDartTask task) => true; |
| 6638 // } |
| 6639 // class TestTaskVisitor_ParseDartTaskTest_test_perform_exception extends TestTa
skVisitor<Boolean> { |
| 6640 // @override |
| 6641 // bool visitParseDartTask(ParseDartTask task) { |
| 6642 // JUnitTestCase.assertNotNull(task.exception); |
| 6643 // return true; |
| 6644 // } |
| 6645 // } |
| 6646 // class TestTaskVisitor_ParseDartTaskTest_test_perform_library extends TestTask
Visitor<Object> { |
| 6647 // InternalAnalysisContext context; |
| 6648 // Source source; |
| 6649 // TestTaskVisitor_ParseDartTaskTest_test_perform_library(this.context, this.s
ource) : super(); |
| 6650 // @override |
| 6651 // Object visitParseDartTask(ParseDartTask task) { |
| 6652 // CaughtException exception = task.exception; |
| 6653 // if (exception != null) { |
| 6654 // throw exception; |
| 6655 // } |
| 6656 // JUnitTestCase.assertNotNull(task.compilationUnit); |
| 6657 // EngineTestCase.assertLength(1, task.errors); |
| 6658 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6659 // JUnitTestCase.assertSame(source, task.source); |
| 6660 // JUnitTestCase.assertTrue(task.hasNonPartOfDirective); |
| 6661 // JUnitTestCase.assertFalse(task.hasPartOfDirective); |
| 6662 // return null; |
| 6663 // } |
| 6664 // } |
| 6665 // class TestTaskVisitor_ParseDartTaskTest_test_perform_part extends TestTaskVis
itor<Object> { |
| 6666 // InternalAnalysisContext context; |
| 6667 // Source source; |
| 6668 // TestTaskVisitor_ParseDartTaskTest_test_perform_part(this.context, this.sour
ce) : super(); |
| 6669 // @override |
| 6670 // Object visitParseDartTask(ParseDartTask task) { |
| 6671 // CaughtException exception = task.exception; |
| 6672 // if (exception != null) { |
| 6673 // throw exception; |
| 6674 // } |
| 6675 // JUnitTestCase.assertNotNull(task.compilationUnit); |
| 6676 // EngineTestCase.assertLength(0, task.errors); |
| 6677 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6678 // JUnitTestCase.assertSame(source, task.source); |
| 6679 // JUnitTestCase.assertFalse(task.hasNonPartOfDirective); |
| 6680 // JUnitTestCase.assertTrue(task.hasPartOfDirective); |
| 6681 // return null; |
| 6682 // } |
| 6683 // } |
| 6684 // class TestTaskVisitor_ParseDartTaskTest_test_perform_validateDirectives exten
ds TestTaskVisitor<Object> { |
| 6685 // InternalAnalysisContext context; |
| 6686 // Source source; |
| 6687 // TestTaskVisitor_ParseDartTaskTest_test_perform_validateDirectives(this.cont
ext, this.source) : super(); |
| 6688 // @override |
| 6689 // Object visitParseDartTask(ParseDartTask task) { |
| 6690 // CaughtException exception = task.exception; |
| 6691 // if (exception != null) { |
| 6692 // throw exception; |
| 6693 // } |
| 6694 // JUnitTestCase.assertNotNull(task.compilationUnit); |
| 6695 // GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 6696 // errorListener.addAll(task.errors); |
| 6697 // errorListener.assertErrorsWithCodes([ |
| 6698 // CompileTimeErrorCode.URI_WITH_INTERPOLATION, |
| 6699 // CompileTimeErrorCode.INVALID_URI]); |
| 6700 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6701 // JUnitTestCase.assertSame(source, task.source); |
| 6702 // JUnitTestCase.assertTrue(task.hasNonPartOfDirective); |
| 6703 // JUnitTestCase.assertFalse(task.hasPartOfDirective); |
| 6704 // return null; |
| 6705 // } |
| 6706 // } |
| 6707 // class TestTaskVisitor_ParseHtmlTaskTest_parseSource extends TestTaskVisitor<B
oolean> { |
| 6708 // InternalAnalysisContext context; |
| 6709 // Source source; |
| 6710 // TestTaskVisitor_ParseHtmlTaskTest_parseSource(this.context, this.source) :
super(); |
| 6711 // @override |
| 6712 // bool visitParseHtmlTask(ParseHtmlTask task) { |
| 6713 // CaughtException exception = task.exception; |
| 6714 // if (exception != null) { |
| 6715 // throw exception; |
| 6716 // } |
| 6717 // JUnitTestCase.assertNotNull(task.htmlUnit); |
| 6718 // JUnitTestCase.assertNotNull(task.lineInfo); |
| 6719 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6720 // JUnitTestCase.assertSame(source, task.source); |
| 6721 // return true; |
| 6722 // } |
| 6723 // } |
| 6724 // class TestTaskVisitor_ParseHtmlTaskTest_test_accept extends TestTaskVisitor<B
oolean> { |
| 6725 // @override |
| 6726 // bool visitParseHtmlTask(ParseHtmlTask task) => true; |
| 6727 // } |
| 6728 // class TestTaskVisitor_ResolveDartLibraryTaskTest_test_accept extends TestTask
Visitor<Boolean> { |
| 6729 // @override |
| 6730 // bool visitResolveDartLibraryTask(ResolveDartLibraryTask task) => true; |
| 6731 // } |
| 6732 // class TestTaskVisitor_ResolveDartLibraryTaskTest_test_perform_exception exten
ds TestTaskVisitor<Boolean> { |
| 6733 // @override |
| 6734 // bool visitResolveDartLibraryTask(ResolveDartLibraryTask task) { |
| 6735 // JUnitTestCase.assertNotNull(task.exception); |
| 6736 // return true; |
| 6737 // } |
| 6738 // } |
| 6739 // class TestTaskVisitor_ResolveDartLibraryTaskTest_test_perform_library extends
TestTaskVisitor<Boolean> { |
| 6740 // Source source; |
| 6741 // TestTaskVisitor_ResolveDartLibraryTaskTest_test_perform_library(this.source
) : super(); |
| 6742 // @override |
| 6743 // bool visitResolveDartLibraryTask(ResolveDartLibraryTask task) { |
| 6744 // CaughtException exception = task.exception; |
| 6745 // if (exception != null) { |
| 6746 // throw exception; |
| 6747 // } |
| 6748 // JUnitTestCase.assertNotNull(task.libraryResolver); |
| 6749 // JUnitTestCase.assertSame(source, task.librarySource); |
| 6750 // JUnitTestCase.assertSame(source, task.unitSource); |
| 6751 // return true; |
| 6752 // } |
| 6753 // } |
| 6754 // class TestTaskVisitor_ResolveDartUnitTaskTest_test_accept extends TestTaskVis
itor<Boolean> { |
| 6755 // @override |
| 6756 // bool visitResolveDartUnitTask(ResolveDartUnitTask task) => true; |
| 6757 // } |
| 6758 // class TestTaskVisitor_ResolveDartUnitTaskTest_test_perform_exception extends
TestTaskVisitor<Boolean> { |
| 6759 // @override |
| 6760 // bool visitResolveDartUnitTask(ResolveDartUnitTask task) { |
| 6761 // JUnitTestCase.assertNotNull(task.exception); |
| 6762 // return true; |
| 6763 // } |
| 6764 // } |
| 6765 // class TestTaskVisitor_ResolveDartUnitTaskTest_xtest_perform_library extends T
estTaskVisitor<Boolean> { |
| 6766 // Source source; |
| 6767 // InternalAnalysisContext context; |
| 6768 // TestTaskVisitor_ResolveDartUnitTaskTest_xtest_perform_library(this.source,
this.context) : super(); |
| 6769 // @override |
| 6770 // bool visitResolveDartUnitTask(ResolveDartUnitTask task) { |
| 6771 // CaughtException exception = task.exception; |
| 6772 // if (exception != null) { |
| 6773 // throw exception; |
| 6774 // } |
| 6775 // JUnitTestCase.assertSame(source, task.librarySource); |
| 6776 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6777 // JUnitTestCase.assertNotNull(task.resolvedUnit); |
| 6778 // JUnitTestCase.assertSame(source, task.source); |
| 6779 // return true; |
| 6780 // } |
| 6781 // } |
| 6782 // class TestTaskVisitor_ResolveHtmlTaskTest_test_accept extends TestTaskVisitor
<Boolean> { |
| 6783 // @override |
| 6784 // bool visitResolveHtmlTask(ResolveHtmlTask task) => true; |
| 6785 // } |
| 6786 // class TestTaskVisitor_ResolveHtmlTaskTest_test_perform_exception extends Test
TaskVisitor<Boolean> { |
| 6787 // @override |
| 6788 // bool visitResolveHtmlTask(ResolveHtmlTask task) { |
| 6789 // JUnitTestCase.assertNotNull(task.exception); |
| 6790 // return true; |
| 6791 // } |
| 6792 // } |
| 6793 // class TestTaskVisitor_ResolveHtmlTaskTest_test_perform_valid extends TestTask
Visitor<Object> { |
| 6794 // @override |
| 6795 // Object visitParseHtmlTask(ParseHtmlTask task) => null; |
| 6796 // } |
| 6797 // class TestTaskVisitor_ResolveHtmlTaskTest_test_perform_valid_2 extends TestTa
skVisitor<Object> { |
| 6798 // long modificationStamp; |
| 6799 // Source source; |
| 6800 // TestTaskVisitor_ResolveHtmlTaskTest_test_perform_valid_2(this.modificationS
tamp, this.source) : super(); |
| 6801 // @override |
| 6802 // Object visitResolveHtmlTask(ResolveHtmlTask task) { |
| 6803 // CaughtException exception = task.exception; |
| 6804 // if (exception != null) { |
| 6805 // throw exception; |
| 6806 // } |
| 6807 // JUnitTestCase.assertNotNull(task.element); |
| 6808 // JUnitTestCase.assertEquals(modificationStamp, task.modificationTime); |
| 6809 // EngineTestCase.assertLength(1, task.resolutionErrors); |
| 6810 // JUnitTestCase.assertSame(source, task.source); |
| 6811 // return null; |
| 6812 // } |
| 6813 // } |
| 6814 // class TestTaskVisitor_ScanDartTaskTest_test_accept extends TestTaskVisitor<Bo
olean> { |
| 6815 // @override |
| 6816 // bool visitScanDartTask(ScanDartTask task) => true; |
| 6817 // } |
| 6818 // class TestTaskVisitor_ScanDartTaskTest_test_perform_valid extends TestTaskVis
itor<Boolean> { |
| 6819 // InternalAnalysisContext context; |
| 6820 // Source source; |
| 6821 // TestTaskVisitor_ScanDartTaskTest_test_perform_valid(this.context, this.sour
ce) : super(); |
| 6822 // @override |
| 6823 // bool visitScanDartTask(ScanDartTask task) { |
| 6824 // CaughtException exception = task.exception; |
| 6825 // if (exception != null) { |
| 6826 // throw exception; |
| 6827 // } |
| 6828 // JUnitTestCase.assertNotNull(task.tokenStream); |
| 6829 // EngineTestCase.assertLength(0, task.errors); |
| 6830 // JUnitTestCase.assertNotNull(task.lineInfo); |
| 6831 // JUnitTestCase.assertEquals(context.getModificationStamp(source), task.mod
ificationTime); |
| 6832 // JUnitTestCase.assertSame(source, task.source); |
| 6833 // return true; |
| 6834 // } |
| 6835 // } |
| 6836 // class UniversalCachePartitionTest extends EngineTestCase { |
| 6837 // void test_contains() { |
| 6838 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6839 // TestSource source = new TestSource(); |
| 6840 // JUnitTestCase.assertTrue(partition.contains(source)); |
| 6841 // } |
| 6842 // void test_creation() { |
| 6843 // JUnitTestCase.assertNotNull(new UniversalCachePartition(8, null)); |
| 6844 // } |
| 6845 // void test_entrySet() { |
| 6846 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6847 // TestSource source = new TestSource(); |
| 6848 // DartEntryImpl entry = new DartEntryImpl(); |
| 6849 // partition.put(source, entry); |
| 6850 // JavaIterator<MapEntry<Source, SourceEntry>> entries = new JavaIterator(ge
tMapEntrySet(partition.map)); |
| 6851 // JUnitTestCase.assertTrue(entries.hasNext); |
| 6852 // MapEntry<Source, SourceEntry> mapEntry = entries.next(); |
| 6853 // JUnitTestCase.assertSame(source, mapEntry.getKey()); |
| 6854 // JUnitTestCase.assertSame(entry, mapEntry.getValue()); |
| 6855 // JUnitTestCase.assertFalse(entries.hasNext); |
| 6856 // } |
| 6857 // void test_get() { |
| 6858 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6859 // TestSource source = new TestSource(); |
| 6860 // JUnitTestCase.assertNull(partition.get(source)); |
| 6861 // } |
| 6862 // void test_put_noFlush() { |
| 6863 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6864 // TestSource source = new TestSource(); |
| 6865 // DartEntryImpl entry = new DartEntryImpl(); |
| 6866 // partition.put(source, entry); |
| 6867 // JUnitTestCase.assertSame(entry, partition.get(source)); |
| 6868 // } |
| 6869 // void test_remove() { |
| 6870 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6871 // TestSource source = new TestSource(); |
| 6872 // DartEntryImpl entry = new DartEntryImpl(); |
| 6873 // partition.put(source, entry); |
| 6874 // JUnitTestCase.assertSame(entry, partition.get(source)); |
| 6875 // partition.remove(source); |
| 6876 // JUnitTestCase.assertNull(partition.get(source)); |
| 6877 // } |
| 6878 // void test_setMaxCacheSize() { |
| 6879 // UniversalCachePartition partition = new UniversalCachePartition(8, new Ca
cheRetentionPolicy_UniversalCachePartitionTest_test_setMaxCacheSize()); |
| 6880 // int size = 6; |
| 6881 // for (int i = 0; i < size; i++) { |
| 6882 // Source source = new TestSource.con1(FileUtilities2.createFile("/test${i
}.dart"), ""); |
| 6883 // DartEntryImpl entry = new DartEntryImpl(); |
| 6884 // entry.setValue(DartEntry.PARSED_UNIT, null); |
| 6885 // partition.put(source, entry); |
| 6886 // partition.accessedAst(source); |
| 6887 // } |
| 6888 // _assertNonFlushedCount(size, partition); |
| 6889 // int newSize = size - 2; |
| 6890 // partition.maxCacheSize = newSize; |
| 6891 // _assertNonFlushedCount(newSize, partition); |
| 6892 // } |
| 6893 // void test_size() { |
| 6894 // UniversalCachePartition partition = new UniversalCachePartition(8, null); |
| 6895 // int size = 4; |
| 6896 // for (int i = 0; i < size; i++) { |
| 6897 // Source source = new TestSource.con1(FileUtilities2.createFile("/test${i
}.dart"), ""); |
| 6898 // partition.put(source, new DartEntryImpl()); |
| 6899 // partition.accessedAst(source); |
| 6900 // } |
| 6901 // JUnitTestCase.assertEquals(size, partition.size()); |
| 6902 // } |
| 6903 // void _assertNonFlushedCount(int expectedCount, UniversalCachePartition part
ition) { |
| 6904 // int nonFlushedCount = 0; |
| 6905 // JavaIterator<MapEntry<Source, SourceEntry>> entries = new JavaIterator(ge
tMapEntrySet(partition.map)); |
| 6906 // while (entries.hasNext) { |
| 6907 // MapEntry<Source, SourceEntry> entry = entries.next(); |
| 6908 // if (entry.getValue().getState(DartEntry.PARSED_UNIT) != CacheState.FLUS
HED) { |
| 6909 // nonFlushedCount++; |
| 6910 // } |
| 6911 // } |
| 6912 // JUnitTestCase.assertEquals(expectedCount, nonFlushedCount); |
| 6913 // } |
| 6914 // static dartSuite() { |
| 6915 // _ut.group('UniversalCachePartitionTest', () { |
| 6916 // _ut.test('test_contains', () { |
| 6917 // final __test = new UniversalCachePartitionTest(); |
| 6918 // runJUnitTest(__test, __test.test_contains); |
| 6919 // }); |
| 6920 // _ut.test('test_creation', () { |
| 6921 // final __test = new UniversalCachePartitionTest(); |
| 6922 // runJUnitTest(__test, __test.test_creation); |
| 6923 // }); |
| 6924 // _ut.test('test_entrySet', () { |
| 6925 // final __test = new UniversalCachePartitionTest(); |
| 6926 // runJUnitTest(__test, __test.test_entrySet); |
| 6927 // }); |
| 6928 // _ut.test('test_get', () { |
| 6929 // final __test = new UniversalCachePartitionTest(); |
| 6930 // runJUnitTest(__test, __test.test_get); |
| 6931 // }); |
| 6932 // _ut.test('test_put_noFlush', () { |
| 6933 // final __test = new UniversalCachePartitionTest(); |
| 6934 // runJUnitTest(__test, __test.test_put_noFlush); |
| 6935 // }); |
| 6936 // _ut.test('test_remove', () { |
| 6937 // final __test = new UniversalCachePartitionTest(); |
| 6938 // runJUnitTest(__test, __test.test_remove); |
| 6939 // }); |
| 6940 // _ut.test('test_setMaxCacheSize', () { |
| 6941 // final __test = new UniversalCachePartitionTest(); |
| 6942 // runJUnitTest(__test, __test.test_setMaxCacheSize); |
| 6943 // }); |
| 6944 // _ut.test('test_size', () { |
| 6945 // final __test = new UniversalCachePartitionTest(); |
| 6946 // runJUnitTest(__test, __test.test_size); |
| 6947 // }); |
| 6948 // }); |
| 6949 // } |
| 6950 // } |
| 6951 // class WorkManagerTest extends EngineTestCase { |
| 6952 // void test_addFirst() { |
| 6953 // TestSource source1 = new TestSource.con1(FileUtilities2.createFile("/f1.d
art"), ""); |
| 6954 // TestSource source2 = new TestSource.con1(FileUtilities2.createFile("/f2.d
art"), ""); |
| 6955 // WorkManager manager = new WorkManager(); |
| 6956 // manager.add(source1, SourcePriority.UNKNOWN); |
| 6957 // manager.addFirst(source2, SourcePriority.UNKNOWN); |
| 6958 // WorkManager_WorkIterator iterator = manager.iterator(); |
| 6959 // JUnitTestCase.assertSame(source2, iterator.next()); |
| 6960 // JUnitTestCase.assertSame(source1, iterator.next()); |
| 6961 // } |
| 6962 // void test_creation() { |
| 6963 // JUnitTestCase.assertNotNull(new WorkManager()); |
| 6964 // } |
| 6965 // void test_iterator_empty() { |
| 6966 // WorkManager manager = new WorkManager(); |
| 6967 // WorkManager_WorkIterator iterator = manager.iterator(); |
| 6968 // JUnitTestCase.assertFalse(iterator.hasNext); |
| 6969 // try { |
| 6970 // iterator.next(); |
| 6971 // JUnitTestCase.fail("Expected NoSuchElementException"); |
| 6972 // } on NoSuchElementException catch (exception) { |
| 6973 // } |
| 6974 // } |
| 6975 // void test_iterator_nonEmpty() { |
| 6976 // TestSource source = new TestSource(); |
| 6977 // WorkManager manager = new WorkManager(); |
| 6978 // manager.add(source, SourcePriority.UNKNOWN); |
| 6979 // WorkManager_WorkIterator iterator = manager.iterator(); |
| 6980 // JUnitTestCase.assertTrue(iterator.hasNext); |
| 6981 // JUnitTestCase.assertSame(source, iterator.next()); |
| 6982 // } |
| 6983 // void test_remove() { |
| 6984 // TestSource source1 = new TestSource.con1(FileUtilities2.createFile("/f1.d
art"), ""); |
| 6985 // TestSource source2 = new TestSource.con1(FileUtilities2.createFile("/f2.d
art"), ""); |
| 6986 // TestSource source3 = new TestSource.con1(FileUtilities2.createFile("/f3.d
art"), ""); |
| 6987 // WorkManager manager = new WorkManager(); |
| 6988 // manager.add(source1, SourcePriority.UNKNOWN); |
| 6989 // manager.add(source2, SourcePriority.UNKNOWN); |
| 6990 // manager.add(source3, SourcePriority.UNKNOWN); |
| 6991 // manager.remove(source2); |
| 6992 // WorkManager_WorkIterator iterator = manager.iterator(); |
| 6993 // JUnitTestCase.assertSame(source1, iterator.next()); |
| 6994 // JUnitTestCase.assertSame(source3, iterator.next()); |
| 6995 // } |
| 6996 // void test_toString_empty() { |
| 6997 // WorkManager manager = new WorkManager(); |
| 6998 // JUnitTestCase.assertNotNull(manager.toString()); |
| 6999 // } |
| 7000 // void test_toString_nonEmpty() { |
| 7001 // WorkManager manager = new WorkManager(); |
| 7002 // manager.add(new TestSource(), SourcePriority.HTML); |
| 7003 // manager.add(new TestSource(), SourcePriority.LIBRARY); |
| 7004 // manager.add(new TestSource(), SourcePriority.NORMAL_PART); |
| 7005 // manager.add(new TestSource(), SourcePriority.PRIORITY_PART); |
| 7006 // manager.add(new TestSource(), SourcePriority.UNKNOWN); |
| 7007 // JUnitTestCase.assertNotNull(manager.toString()); |
| 7008 // } |
| 7009 // static dartSuite() { |
| 7010 // _ut.group('WorkManagerTest', () { |
| 7011 // _ut.test('test_addFirst', () { |
| 7012 // final __test = new WorkManagerTest(); |
| 7013 // runJUnitTest(__test, __test.test_addFirst); |
| 7014 // }); |
| 7015 // _ut.test('test_creation', () { |
| 7016 // final __test = new WorkManagerTest(); |
| 7017 // runJUnitTest(__test, __test.test_creation); |
| 7018 // }); |
| 7019 // _ut.test('test_iterator_empty', () { |
| 7020 // final __test = new WorkManagerTest(); |
| 7021 // runJUnitTest(__test, __test.test_iterator_empty); |
| 7022 // }); |
| 7023 // _ut.test('test_iterator_nonEmpty', () { |
| 7024 // final __test = new WorkManagerTest(); |
| 7025 // runJUnitTest(__test, __test.test_iterator_nonEmpty); |
| 7026 // }); |
| 7027 // _ut.test('test_remove', () { |
| 7028 // final __test = new WorkManagerTest(); |
| 7029 // runJUnitTest(__test, __test.test_remove); |
| 7030 // }); |
| 7031 // _ut.test('test_toString_empty', () { |
| 7032 // final __test = new WorkManagerTest(); |
| 7033 // runJUnitTest(__test, __test.test_toString_empty); |
| 7034 // }); |
| 7035 // _ut.test('test_toString_nonEmpty', () { |
| 7036 // final __test = new WorkManagerTest(); |
| 7037 // runJUnitTest(__test, __test.test_toString_nonEmpty); |
| 7038 // }); |
| 7039 // }); |
| 7040 // } |
| 7041 // } |
| 7042 // main() { |
| 7043 // AnalysisContextImplTest.dartSuite(); |
| 7044 // AnalysisOptionsImplTest.dartSuite(); |
| 7045 // IncrementalAnalysisCacheTest.dartSuite(); |
| 7046 // InstrumentedAnalysisContextImplTest.dartSuite(); |
| 7047 // WorkManagerTest.dartSuite(); |
| 7048 // AnalysisTaskTest.dartSuite(); |
| 7049 // BuildDartElementModelTaskTest.dartSuite(); |
| 7050 // GenerateDartErrorsTaskTest.dartSuite(); |
| 7051 // GenerateDartHintsTaskTest.dartSuite(); |
| 7052 // GetContentTaskTest.dartSuite(); |
| 7053 // IncrementalAnalysisTaskTest.dartSuite(); |
| 7054 // ParseDartTaskTest.dartSuite(); |
| 7055 // ParseHtmlTaskTest.dartSuite(); |
| 7056 // ResolveDartLibraryTaskTest.dartSuite(); |
| 7057 // ResolveDartUnitTaskTest.dartSuite(); |
| 7058 // ResolveHtmlTaskTest.dartSuite(); |
| 7059 // ScanDartTaskTest.dartSuite(); |
| 7060 // AnalysisCacheTest.dartSuite(); |
| 7061 // DartEntryImplTest.dartSuite(); |
| 7062 // HtmlEntryImplTest.dartSuite(); |
| 7063 // PartitionManagerTest.dartSuite(); |
| 7064 // SdkCachePartitionTest.dartSuite(); |
| 7065 // UniversalCachePartitionTest.dartSuite(); |
| 7066 // } |
| 7067 |
| 7068 main() { |
| 7069 } |
| OLD | NEW |