| OLD | NEW |
| 1 // // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // // for details. All rights reserved. Use of this source code is governed by a | 2 // // for details. All rights reserved. Use of this source code is governed by a |
| 3 // // BSD-style license that can be found in the LICENSE file. | 3 // // BSD-style license that can be found in the LICENSE file. |
| 4 // // This code was auto-generated, is not intended to be edited, and is subject
to | 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. | 5 // // significant change. Please see the README file for more information. |
| 6 // library engine.engine_test; | 6 // library engine.engine_test; |
| 7 // import 'dart:collection'; | 7 // import 'dart:collection'; |
| 8 // import 'package:analyzer/src/generated/ast.dart'; | 8 // import 'package:analyzer/src/generated/ast.dart'; |
| 9 // import 'package:analyzer/src/generated/element.dart'; | 9 // import 'package:analyzer/src/generated/element.dart'; |
| 10 // import 'package:analyzer/src/generated/engine.dart'; | 10 // import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 // "</html>"])); | 410 // "</html>"])); |
| 411 // LineInfo info = _context.computeLineInfo(source); | 411 // LineInfo info = _context.computeLineInfo(source); |
| 412 // JUnitTestCase.assertNotNull(info); | 412 // JUnitTestCase.assertNotNull(info); |
| 413 // } | 413 // } |
| 414 // void test_computeResolvableCompilationUnit_dart_exception() { | 414 // void test_computeResolvableCompilationUnit_dart_exception() { |
| 415 // TestSource source = _addSourceWithException("/test.dart"); | 415 // TestSource source = _addSourceWithException("/test.dart"); |
| 416 // try { | 416 // try { |
| 417 // _context.computeResolvableCompilationUnit(source); | 417 // _context.computeResolvableCompilationUnit(source); |
| 418 // JUnitTestCase.fail("Expected AnalysisException"); | 418 // JUnitTestCase.fail("Expected AnalysisException"); |
| 419 // } on AnalysisException catch (exception) { | 419 // } on AnalysisException catch (exception) { |
| 420 // // Expected |
| 420 // } | 421 // } |
| 421 // } | 422 // } |
| 422 // void test_computeResolvableCompilationUnit_html_exception() { | 423 // void test_computeResolvableCompilationUnit_html_exception() { |
| 423 // Source source = _addSource("/lib.html", "<html></html>"); | 424 // Source source = _addSource("/lib.html", "<html></html>"); |
| 424 // try { | 425 // try { |
| 425 // _context.computeResolvableCompilationUnit(source); | 426 // _context.computeResolvableCompilationUnit(source); |
| 426 // JUnitTestCase.fail("Expected AnalysisException"); | 427 // JUnitTestCase.fail("Expected AnalysisException"); |
| 427 // } on AnalysisException catch (exception) { | 428 // } on AnalysisException catch (exception) { |
| 429 // // Expected |
| 428 // } | 430 // } |
| 429 // } | 431 // } |
| 430 // void test_computeResolvableCompilationUnit_valid() { | 432 // void test_computeResolvableCompilationUnit_valid() { |
| 431 // Source source = _addSource("/lib.dart", "library lib;"); | 433 // Source source = _addSource("/lib.dart", "library lib;"); |
| 432 // CompilationUnit parsedUnit = _context.parseCompilationUnit(source); | 434 // CompilationUnit parsedUnit = _context.parseCompilationUnit(source); |
| 433 // JUnitTestCase.assertNotNull(parsedUnit); | 435 // JUnitTestCase.assertNotNull(parsedUnit); |
| 434 // CompilationUnit resolvedUnit = _context.computeResolvableCompilationUnit(
source).compilationUnit; | 436 // CompilationUnit resolvedUnit = _context.computeResolvableCompilationUnit(
source).compilationUnit; |
| 435 // JUnitTestCase.assertNotNull(resolvedUnit); | 437 // JUnitTestCase.assertNotNull(resolvedUnit); |
| 436 // JUnitTestCase.assertNotSame(parsedUnit, resolvedUnit); | 438 // JUnitTestCase.assertNotSame(parsedUnit, resolvedUnit); |
| 437 // } | 439 // } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 // JUnitTestCase.assertNull(_context.getResolvedHtmlUnit(source)); | 822 // JUnitTestCase.assertNull(_context.getResolvedHtmlUnit(source)); |
| 821 // _context.resolveHtmlUnit(source); | 823 // _context.resolveHtmlUnit(source); |
| 822 // JUnitTestCase.assertNotNull(_context.getResolvedHtmlUnit(source)); | 824 // JUnitTestCase.assertNotNull(_context.getResolvedHtmlUnit(source)); |
| 823 // } | 825 // } |
| 824 // void test_getSourceFactory() { | 826 // void test_getSourceFactory() { |
| 825 // JUnitTestCase.assertSame(_sourceFactory, _context.sourceFactory); | 827 // JUnitTestCase.assertSame(_sourceFactory, _context.sourceFactory); |
| 826 // } | 828 // } |
| 827 // void test_getStatistics() { | 829 // void test_getStatistics() { |
| 828 // AnalysisContextStatistics statistics = _context.statistics; | 830 // AnalysisContextStatistics statistics = _context.statistics; |
| 829 // JUnitTestCase.assertNotNull(statistics); | 831 // JUnitTestCase.assertNotNull(statistics); |
| 832 // // The following lines are fragile. The values depend on the number of li
braries in the SDK. |
| 833 // // assertLength(0, statistics.getCacheRows()); |
| 834 // // assertLength(0, statistics.getExceptions()); |
| 835 // // assertLength(0, statistics.getSources()); |
| 830 // } | 836 // } |
| 831 // void test_isClientLibrary_dart() { | 837 // void test_isClientLibrary_dart() { |
| 832 // _context = AnalysisContextFactory.contextWithCore(); | 838 // _context = AnalysisContextFactory.contextWithCore(); |
| 833 // _sourceFactory = _context.sourceFactory; | 839 // _sourceFactory = _context.sourceFactory; |
| 834 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["im
port 'dart:html';", "", "main() {}"])); | 840 // Source source = _addSource("/test.dart", EngineTestCase.createSource(["im
port 'dart:html';", "", "main() {}"])); |
| 835 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); | 841 // JUnitTestCase.assertFalse(_context.isClientLibrary(source)); |
| 836 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); | 842 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| 837 // _context.computeLibraryElement(source); | 843 // _context.computeLibraryElement(source); |
| 838 // JUnitTestCase.assertTrue(_context.isClientLibrary(source)); | 844 // JUnitTestCase.assertTrue(_context.isClientLibrary(source)); |
| 839 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); | 845 // JUnitTestCase.assertFalse(_context.isServerLibrary(source)); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 863 // List<AnalysisError> errors = _context.getErrors(source).errors; | 869 // List<AnalysisError> errors = _context.getErrors(source).errors; |
| 864 // JUnitTestCase.assertNotNull(errors); | 870 // JUnitTestCase.assertNotNull(errors); |
| 865 // JUnitTestCase.assertTrue(errors.length > 0); | 871 // JUnitTestCase.assertTrue(errors.length > 0); |
| 866 // } | 872 // } |
| 867 // void test_parseCompilationUnit_exception() { | 873 // void test_parseCompilationUnit_exception() { |
| 868 // Source source = _addSourceWithException("/test.dart"); | 874 // Source source = _addSourceWithException("/test.dart"); |
| 869 // try { | 875 // try { |
| 870 // _context.parseCompilationUnit(source); | 876 // _context.parseCompilationUnit(source); |
| 871 // JUnitTestCase.fail("Expected AnalysisException"); | 877 // JUnitTestCase.fail("Expected AnalysisException"); |
| 872 // } on AnalysisException catch (exception) { | 878 // } on AnalysisException catch (exception) { |
| 879 // // Expected. |
| 873 // } | 880 // } |
| 874 // } | 881 // } |
| 875 // void test_parseCompilationUnit_html() { | 882 // void test_parseCompilationUnit_html() { |
| 876 // Source source = _addSource("/test.html", "<html></html>"); | 883 // Source source = _addSource("/test.html", "<html></html>"); |
| 877 // JUnitTestCase.assertNull(_context.parseCompilationUnit(source)); | 884 // JUnitTestCase.assertNull(_context.parseCompilationUnit(source)); |
| 878 // } | 885 // } |
| 879 // void test_parseCompilationUnit_noErrors() { | 886 // void test_parseCompilationUnit_noErrors() { |
| 880 // Source source = _addSource("/lib.dart", "library lib;"); | 887 // Source source = _addSource("/lib.dart", "library lib;"); |
| 881 // CompilationUnit compilationUnit = _context.parseCompilationUnit(source); | 888 // CompilationUnit compilationUnit = _context.parseCompilationUnit(source); |
| 882 // JUnitTestCase.assertNotNull(compilationUnit); | 889 // JUnitTestCase.assertNotNull(compilationUnit); |
| 883 // EngineTestCase.assertLength(0, _context.getErrors(source).errors); | 890 // EngineTestCase.assertLength(0, _context.getErrors(source).errors); |
| 884 // } | 891 // } |
| 885 // void test_parseCompilationUnit_nonExistentSource() { | 892 // void test_parseCompilationUnit_nonExistentSource() { |
| 886 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); | 893 // Source source = new FileBasedSource.con1(FileUtilities2.createFile("/test
.dart")); |
| 887 // try { | 894 // try { |
| 888 // _context.parseCompilationUnit(source); | 895 // _context.parseCompilationUnit(source); |
| 889 // JUnitTestCase.fail("Expected AnalysisException because file does not ex
ist"); | 896 // JUnitTestCase.fail("Expected AnalysisException because file does not ex
ist"); |
| 890 // } on AnalysisException catch (exception) { | 897 // } on AnalysisException catch (exception) { |
| 898 // // Expected result |
| 891 // } | 899 // } |
| 892 // } | 900 // } |
| 893 // void test_parseHtmlUnit_noErrors() { | 901 // void test_parseHtmlUnit_noErrors() { |
| 894 // Source source = _addSource("/lib.html", "<html></html>"); | 902 // Source source = _addSource("/lib.html", "<html></html>"); |
| 895 // HtmlUnit unit = _context.parseHtmlUnit(source); | 903 // HtmlUnit unit = _context.parseHtmlUnit(source); |
| 896 // JUnitTestCase.assertNotNull(unit); | 904 // JUnitTestCase.assertNotNull(unit); |
| 897 // } | 905 // } |
| 898 // void test_parseHtmlUnit_resolveDirectives() { | 906 // void test_parseHtmlUnit_resolveDirectives() { |
| 899 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "class ClassA {}"])); | 907 // Source libSource = _addSource("/lib.dart", EngineTestCase.createSource(["
library lib;", "class ClassA {}"])); |
| 900 // Source source = _addSource("/lib.html", EngineTestCase.createSource([ | 908 // Source source = _addSource("/lib.html", EngineTestCase.createSource([ |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 // } | 1076 // } |
| 1069 // void test_performAnalysisTask_IOException() { | 1077 // void test_performAnalysisTask_IOException() { |
| 1070 // TestSource source = _addSourceWithException2("/test.dart", "library test;
"); | 1078 // TestSource source = _addSourceWithException2("/test.dart", "library test;
"); |
| 1071 // int oldTimestamp = _context.getModificationStamp(source); | 1079 // int oldTimestamp = _context.getModificationStamp(source); |
| 1072 // source.generateExceptionOnRead = false; | 1080 // source.generateExceptionOnRead = false; |
| 1073 // _analyzeAll_assertFinished(); | 1081 // _analyzeAll_assertFinished(); |
| 1074 // JUnitTestCase.assertEquals(1, source.readCount); | 1082 // JUnitTestCase.assertEquals(1, source.readCount); |
| 1075 // source.generateExceptionOnRead = true; | 1083 // source.generateExceptionOnRead = true; |
| 1076 // do { | 1084 // do { |
| 1077 // _changeSource(source, ""); | 1085 // _changeSource(source, ""); |
| 1086 // // Ensure that the timestamp differs so that analysis engine notices th
e change |
| 1078 // } while (oldTimestamp == _context.getModificationStamp(source)); | 1087 // } while (oldTimestamp == _context.getModificationStamp(source)); |
| 1079 // _analyzeAll_assertFinished(); | 1088 // _analyzeAll_assertFinished(); |
| 1080 // JUnitTestCase.assertEquals(2, source.readCount); | 1089 // JUnitTestCase.assertEquals(2, source.readCount); |
| 1081 // } | 1090 // } |
| 1082 // void test_performAnalysisTask_missingPart() { | 1091 // void test_performAnalysisTask_missingPart() { |
| 1083 // Source source = _addSource("/test.dart", "library lib; part 'no-such-file
.dart';"); | 1092 // Source source = _addSource("/test.dart", "library lib; part 'no-such-file
.dart';"); |
| 1084 // _analyzeAll_assertFinished(); | 1093 // _analyzeAll_assertFinished(); |
| 1085 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); | 1094 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); |
| 1086 // } | 1095 // } |
| 1087 // void test_performAnalysisTask_modifiedAfterParse() { | 1096 // void test_performAnalysisTask_modifiedAfterParse() { |
| 1088 // Source source = _addSource("/test.dart", "library lib;"); | 1097 // Source source = _addSource("/test.dart", "library lib;"); |
| 1089 // int initialTime = _context.getModificationStamp(source); | 1098 // int initialTime = _context.getModificationStamp(source); |
| 1090 // List<Source> sources = new List<Source>(); | 1099 // List<Source> sources = new List<Source>(); |
| 1091 // sources.add(source); | 1100 // sources.add(source); |
| 1092 // _context.analysisPriorityOrder = sources; | 1101 // _context.analysisPriorityOrder = sources; |
| 1093 // _context.parseCompilationUnit(source); | 1102 // _context.parseCompilationUnit(source); |
| 1094 // while (initialTime == JavaSystem.currentTimeMillis()) { | 1103 // while (initialTime == JavaSystem.currentTimeMillis()) { |
| 1095 // Thread.sleep(1); | 1104 // Thread.sleep(1); |
| 1105 // // Force the modification time to be different. |
| 1096 // } | 1106 // } |
| 1097 // _context.setContents(source, "library test;"); | 1107 // _context.setContents(source, "library test;"); |
| 1098 // JUnitTestCase.assertTrue(initialTime != _context.getModificationStamp(sou
rce)); | 1108 // JUnitTestCase.assertTrue(initialTime != _context.getModificationStamp(sou
rce)); |
| 1099 // _analyzeAll_assertFinished(); | 1109 // _analyzeAll_assertFinished(); |
| 1100 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); | 1110 // JUnitTestCase.assertNotNullMsg("performAnalysisTask failed to compute an
element model", _context.getLibraryElement(source)); |
| 1101 // } | 1111 // } |
| 1102 // void test_resolveCompilationUnit_import_relative() { | 1112 // void test_resolveCompilationUnit_import_relative() { |
| 1103 // _context = AnalysisContextFactory.contextWithCore(); | 1113 // _context = AnalysisContextFactory.contextWithCore(); |
| 1104 // Source sourceA = _addSource("/libA.dart", "library libA; import 'libB.dar
t'; class A{}"); | 1114 // Source sourceA = _addSource("/libA.dart", "library libA; import 'libB.dar
t'; class A{}"); |
| 1105 // _addSource("/libB.dart", "library libB; class B{}"); | 1115 // _addSource("/libB.dart", "library libB; class B{}"); |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2186 // PartDirective resultPartDirective = directives[2] as PartDirective; | 2196 // PartDirective resultPartDirective = directives[2] as PartDirective; |
| 2187 // JUnitTestCase.assertEquals(partUri, resultPartDirective.uriContent); | 2197 // JUnitTestCase.assertEquals(partUri, resultPartDirective.uriContent); |
| 2188 // JUnitTestCase.assertSame(partSource, resultPartDirective.source); | 2198 // JUnitTestCase.assertSame(partSource, resultPartDirective.source); |
| 2189 // } | 2199 // } |
| 2190 // void test_getState_invalid_resolutionErrors() { | 2200 // void test_getState_invalid_resolutionErrors() { |
| 2191 // DartEntryImpl entry = new DartEntryImpl(); | 2201 // DartEntryImpl entry = new DartEntryImpl(); |
| 2192 // try { | 2202 // try { |
| 2193 // entry.getState(DartEntry.RESOLUTION_ERRORS); | 2203 // entry.getState(DartEntry.RESOLUTION_ERRORS); |
| 2194 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); | 2204 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2195 // } on IllegalArgumentException catch (exception) { | 2205 // } on IllegalArgumentException catch (exception) { |
| 2206 // // Expected |
| 2196 // } | 2207 // } |
| 2197 // } | 2208 // } |
| 2198 // void test_getState_invalid_verificationErrors() { | 2209 // void test_getState_invalid_verificationErrors() { |
| 2199 // DartEntryImpl entry = new DartEntryImpl(); | 2210 // DartEntryImpl entry = new DartEntryImpl(); |
| 2200 // try { | 2211 // try { |
| 2201 // entry.getState(DartEntry.VERIFICATION_ERRORS); | 2212 // entry.getState(DartEntry.VERIFICATION_ERRORS); |
| 2202 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); | 2213 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2203 // } on IllegalArgumentException catch (exception) { | 2214 // } on IllegalArgumentException catch (exception) { |
| 2215 // // Expected |
| 2204 // } | 2216 // } |
| 2205 // } | 2217 // } |
| 2206 // void test_getStateInLibrary_invalid_element() { | 2218 // void test_getStateInLibrary_invalid_element() { |
| 2207 // DartEntryImpl entry = new DartEntryImpl(); | 2219 // DartEntryImpl entry = new DartEntryImpl(); |
| 2208 // try { | 2220 // try { |
| 2209 // entry.getStateInLibrary(DartEntry.ELEMENT, new TestSource()); | 2221 // entry.getStateInLibrary(DartEntry.ELEMENT, new TestSource()); |
| 2210 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); | 2222 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2211 // } on IllegalArgumentException catch (exception) { | 2223 // } on IllegalArgumentException catch (exception) { |
| 2224 // // Expected |
| 2212 // } | 2225 // } |
| 2213 // } | 2226 // } |
| 2214 // void test_getValue_containingLibraries() { | 2227 // void test_getValue_containingLibraries() { |
| 2215 // Source testSource = new TestSource(); | 2228 // Source testSource = new TestSource(); |
| 2216 // DartEntryImpl entry = new DartEntryImpl(); | 2229 // DartEntryImpl entry = new DartEntryImpl(); |
| 2217 // List<Source> value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); | 2230 // List<Source> value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2218 // EngineTestCase.assertLength(0, value); | 2231 // EngineTestCase.assertLength(0, value); |
| 2219 // entry.addContainingLibrary(testSource); | 2232 // entry.addContainingLibrary(testSource); |
| 2220 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); | 2233 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2221 // EngineTestCase.assertLength(1, value); | 2234 // EngineTestCase.assertLength(1, value); |
| 2222 // JUnitTestCase.assertEquals(testSource, value[0]); | 2235 // JUnitTestCase.assertEquals(testSource, value[0]); |
| 2223 // entry.removeContainingLibrary(testSource); | 2236 // entry.removeContainingLibrary(testSource); |
| 2224 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); | 2237 // value = entry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 2225 // EngineTestCase.assertLength(0, value); | 2238 // EngineTestCase.assertLength(0, value); |
| 2226 // } | 2239 // } |
| 2227 // void test_getValue_invalid_resolutionErrors() { | 2240 // void test_getValue_invalid_resolutionErrors() { |
| 2228 // DartEntryImpl entry = new DartEntryImpl(); | 2241 // DartEntryImpl entry = new DartEntryImpl(); |
| 2229 // try { | 2242 // try { |
| 2230 // entry.getValue(DartEntry.RESOLUTION_ERRORS); | 2243 // entry.getValue(DartEntry.RESOLUTION_ERRORS); |
| 2231 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); | 2244 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2232 // } on IllegalArgumentException catch (exception) { | 2245 // } on IllegalArgumentException catch (exception) { |
| 2246 // // Expected |
| 2233 // } | 2247 // } |
| 2234 // } | 2248 // } |
| 2235 // void test_getValue_invalid_verificationErrors() { | 2249 // void test_getValue_invalid_verificationErrors() { |
| 2236 // DartEntryImpl entry = new DartEntryImpl(); | 2250 // DartEntryImpl entry = new DartEntryImpl(); |
| 2237 // try { | 2251 // try { |
| 2238 // entry.getValue(DartEntry.VERIFICATION_ERRORS); | 2252 // entry.getValue(DartEntry.VERIFICATION_ERRORS); |
| 2239 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); | 2253 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2240 // } on IllegalArgumentException catch (exception) { | 2254 // } on IllegalArgumentException catch (exception) { |
| 2255 // // Expected |
| 2241 // } | 2256 // } |
| 2242 // } | 2257 // } |
| 2243 // void test_getValueInLibrary_invalid_element() { | 2258 // void test_getValueInLibrary_invalid_element() { |
| 2244 // DartEntryImpl entry = new DartEntryImpl(); | 2259 // DartEntryImpl entry = new DartEntryImpl(); |
| 2245 // try { | 2260 // try { |
| 2246 // entry.getValueInLibrary(DartEntry.ELEMENT, new TestSource()); | 2261 // entry.getValueInLibrary(DartEntry.ELEMENT, new TestSource()); |
| 2247 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); | 2262 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2248 // } on IllegalArgumentException catch (exception) { | 2263 // } on IllegalArgumentException catch (exception) { |
| 2264 // // Expected |
| 2249 // } | 2265 // } |
| 2250 // } | 2266 // } |
| 2251 // void test_getValueInLibrary_invalid_resolutionErrors_multiple() { | 2267 // void test_getValueInLibrary_invalid_resolutionErrors_multiple() { |
| 2252 // Source source1 = new TestSource(); | 2268 // Source source1 = new TestSource(); |
| 2253 // Source source2 = new TestSource(); | 2269 // Source source2 = new TestSource(); |
| 2254 // Source source3 = new TestSource(); | 2270 // Source source3 = new TestSource(); |
| 2255 // DartEntryImpl entry = new DartEntryImpl(); | 2271 // DartEntryImpl entry = new DartEntryImpl(); |
| 2256 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); | 2272 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source1, AstFactory.comp
ilationUnit()); |
| 2257 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); | 2273 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source2, AstFactory.comp
ilationUnit()); |
| 2258 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); | 2274 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source3, AstFactory.comp
ilationUnit()); |
| 2259 // try { | 2275 // try { |
| 2260 // entry.getValueInLibrary(DartEntry.ELEMENT, source3); | 2276 // entry.getValueInLibrary(DartEntry.ELEMENT, source3); |
| 2261 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); | 2277 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2262 // } on IllegalArgumentException catch (exception) { | 2278 // } on IllegalArgumentException catch (exception) { |
| 2279 // // Expected |
| 2263 // } | 2280 // } |
| 2264 // } | 2281 // } |
| 2265 // void test_getWritableCopy() { | 2282 // void test_getWritableCopy() { |
| 2266 // DartEntryImpl entry = new DartEntryImpl(); | 2283 // DartEntryImpl entry = new DartEntryImpl(); |
| 2267 // DartEntryImpl copy = entry.writableCopy; | 2284 // DartEntryImpl copy = entry.writableCopy; |
| 2268 // JUnitTestCase.assertNotNull(copy); | 2285 // JUnitTestCase.assertNotNull(copy); |
| 2269 // JUnitTestCase.assertNotSame(entry, copy); | 2286 // JUnitTestCase.assertNotSame(entry, copy); |
| 2270 // } | 2287 // } |
| 2271 // void test_hasInvalidData_false() { | 2288 // void test_hasInvalidData_false() { |
| 2272 // DartEntryImpl entry = new DartEntryImpl(); | 2289 // DartEntryImpl entry = new DartEntryImpl(); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2413 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); | 2430 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2414 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); | 2431 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2415 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); | 2432 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2416 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); | 2433 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2417 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); | 2434 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2418 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); | 2435 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2419 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); | 2436 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2420 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); | 2437 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); |
| 2421 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); | 2438 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2422 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); | 2439 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); |
| 2440 // // The following lines are commented out because we don't currently have
any way of setting the |
| 2441 // // state for data associated with a library we don't know anything about. |
| 2442 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
D_ELEMENT_ERRORS, source)); |
| 2443 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
T_UNIT, source)); |
| 2444 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.HINT
S, source)); |
| 2445 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LUTION_ERRORS, source)); |
| 2446 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LVED_UNIT, source)); |
| 2447 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.VERI
FICATION_ERRORS, source)); |
| 2423 // } | 2448 // } |
| 2424 // void test_recordHintErrorInLibrary() { | 2449 // void test_recordHintErrorInLibrary() { |
| 2425 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one | 2450 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2426 // // library, then verify that the data for the other library is still vali
d. | 2451 // // library, then verify that the data for the other library is still vali
d. |
| 2427 // Source source = new TestSource(); | 2452 // Source source = new TestSource(); |
| 2428 // DartEntryImpl entry = new DartEntryImpl(); | 2453 // DartEntryImpl entry = new DartEntryImpl(); |
| 2429 // entry.recordHintErrorInLibrary(source, new CaughtException(new AnalysisEx
ception(), null)); | 2454 // entry.recordHintErrorInLibrary(source, new CaughtException(new AnalysisEx
ception(), null)); |
| 2430 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); | 2455 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2431 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); | 2456 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.ELE
MENT)); |
| 2432 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); | 2457 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2457 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); | 2482 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2458 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); | 2483 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2459 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); | 2484 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2460 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); | 2485 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2461 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); | 2486 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2462 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); | 2487 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2463 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); | 2488 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2464 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); | 2489 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2465 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); | 2490 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2466 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); | 2491 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2492 // // The following lines are commented out because we don't currently have
any way of setting the |
| 2493 // // state for data associated with a library we don't know anything about. |
| 2494 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
D_ELEMENT_ERRORS, source)); |
| 2495 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
T_UNIT, source)); |
| 2496 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.HINT
S, source)); |
| 2497 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LUTION_ERRORS, source)); |
| 2498 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LVED_UNIT, source)); |
| 2499 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.VERI
FICATION_ERRORS, source)); |
| 2467 // } | 2500 // } |
| 2468 // void test_recordParseInProcess() { | 2501 // void test_recordParseInProcess() { |
| 2469 // DartEntryImpl entry = new DartEntryImpl(); | 2502 // DartEntryImpl entry = new DartEntryImpl(); |
| 2470 // entry.recordParseInProcess(); | 2503 // entry.recordParseInProcess(); |
| 2471 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSE_ERRORS)); | 2504 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSE_ERRORS)); |
| 2472 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSED_UNIT)); | 2505 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
PARSED_UNIT)); |
| 2473 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SOURCE_KIND)); | 2506 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SOURCE_KIND)); |
| 2474 // } | 2507 // } |
| 2475 // void test_recordResolutionError() { | 2508 // void test_recordResolutionError() { |
| 2476 // // Source source = new TestSource(); | 2509 // // Source source = new TestSource(); |
| 2477 // DartEntryImpl entry = new DartEntryImpl(); | 2510 // DartEntryImpl entry = new DartEntryImpl(); |
| 2478 // entry.recordResolutionError(new CaughtException(new AnalysisException(),
null)); | 2511 // entry.recordResolutionError(new CaughtException(new AnalysisException(),
null)); |
| 2479 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); | 2512 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2480 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); | 2513 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2481 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); | 2514 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| 2482 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); | 2515 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.IMP
ORTED_LIBRARIES)); |
| 2483 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); | 2516 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.INC
LUDED_PARTS)); |
| 2484 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); | 2517 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2485 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); | 2518 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2486 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); | 2519 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.L
INE_INFO)); |
| 2487 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); | 2520 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SE_ERRORS)); |
| 2488 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); | 2521 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.PAR
SED_UNIT)); |
| 2489 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); | 2522 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2490 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); | 2523 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SCA
N_ERRORS)); |
| 2491 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); | 2524 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.SOU
RCE_KIND)); |
| 2492 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); | 2525 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.TOK
EN_STREAM)); |
| 2526 // // The following lines are commented out because we don't currently have
any way of setting the |
| 2527 // // state for data associated with a library we don't know anything about. |
| 2528 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
D_ELEMENT_ERRORS, source)); |
| 2529 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
T_UNIT, source)); |
| 2530 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.HINT
S, source)); |
| 2531 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LUTION_ERRORS, source)); |
| 2532 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LVED_UNIT, source)); |
| 2533 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.VERI
FICATION_ERRORS, source)); |
| 2493 // } | 2534 // } |
| 2494 // void test_recordResolutionErrorInLibrary() { | 2535 // void test_recordResolutionErrorInLibrary() { |
| 2495 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one | 2536 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| 2496 // // library, then verify that the data for the other library is still vali
d. | 2537 // // library, then verify that the data for the other library is still vali
d. |
| 2497 // Source source = new TestSource(); | 2538 // Source source = new TestSource(); |
| 2498 // DartEntryImpl entry = new DartEntryImpl(); | 2539 // DartEntryImpl entry = new DartEntryImpl(); |
| 2499 // entry.recordResolutionErrorInLibrary(source, new CaughtException(new Anal
ysisException(), null)); | 2540 // entry.recordResolutionErrorInLibrary(source, new CaughtException(new Anal
ysisException(), null)); |
| 2500 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); | 2541 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(SourceEntry.C
ONTENT)); |
| 2501 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); | 2542 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.ELEME
NT)); |
| 2502 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); | 2543 // JUnitTestCase.assertSame(CacheState.INVALID, entry.getState(DartEntry.EXP
ORTED_LIBRARIES)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 2527 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); | 2568 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.INCLU
DED_PARTS)); |
| 2528 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); | 2569 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_CL
IENT)); |
| 2529 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); | 2570 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.IS_LA
UNCHABLE)); |
| 2530 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); | 2571 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(SourceEntry.LIN
E_INFO)); |
| 2531 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); | 2572 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
_ERRORS)); |
| 2532 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); | 2573 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PARSE
D_UNIT)); |
| 2533 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); | 2574 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.PUBLI
C_NAMESPACE)); |
| 2534 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); | 2575 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SCAN_
ERRORS)); |
| 2535 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); | 2576 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.SOURC
E_KIND)); |
| 2536 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); | 2577 // JUnitTestCase.assertSame(CacheState.ERROR, entry.getState(DartEntry.TOKEN
_STREAM)); |
| 2578 // // The following lines are commented out because we don't currently have
any way of setting the |
| 2579 // // state for data associated with a library we don't know anything about. |
| 2580 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
D_ELEMENT_ERRORS, source)); |
| 2581 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.BUIL
T_UNIT, source)); |
| 2582 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.HINT
S, source)); |
| 2583 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LUTION_ERRORS, source)); |
| 2584 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.RESO
LVED_UNIT, source)); |
| 2585 // // assertSame(CacheState.ERROR, entry.getStateInLibrary(DartEntry.VERI
FICATION_ERRORS, source)); |
| 2537 // } | 2586 // } |
| 2538 // void test_recordScanInProcess() { | 2587 // void test_recordScanInProcess() { |
| 2539 // DartEntryImpl entry = new DartEntryImpl(); | 2588 // DartEntryImpl entry = new DartEntryImpl(); |
| 2540 // entry.recordScanInProcess(); | 2589 // entry.recordScanInProcess(); |
| 2541 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(SourceEntr
y.LINE_INFO)); | 2590 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(SourceEntr
y.LINE_INFO)); |
| 2542 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SCAN_ERRORS)); | 2591 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
SCAN_ERRORS)); |
| 2543 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
TOKEN_STREAM)); | 2592 // JUnitTestCase.assertSame(CacheState.IN_PROCESS, entry.getState(DartEntry.
TOKEN_STREAM)); |
| 2544 // } | 2593 // } |
| 2545 // void test_recordVerificationErrorInLibrary() { | 2594 // void test_recordVerificationErrorInLibrary() { |
| 2546 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one | 2595 // // TODO(brianwilkerson) This test should set the state for two libraries,
record an error in one |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 // } | 2685 // } |
| 2637 // void test_setState_includedParts() { | 2686 // void test_setState_includedParts() { |
| 2638 // state2 = DartEntry.INCLUDED_PARTS; | 2687 // state2 = DartEntry.INCLUDED_PARTS; |
| 2639 // } | 2688 // } |
| 2640 // void test_setState_invalid_element() { | 2689 // void test_setState_invalid_element() { |
| 2641 // DartEntryImpl entry = new DartEntryImpl(); | 2690 // DartEntryImpl entry = new DartEntryImpl(); |
| 2642 // try { | 2691 // try { |
| 2643 // entry.setStateInLibrary(DartEntry.ELEMENT, null, CacheState.FLUSHED); | 2692 // entry.setStateInLibrary(DartEntry.ELEMENT, null, CacheState.FLUSHED); |
| 2644 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); | 2693 // JUnitTestCase.fail("Expected IllegalArgumentException for ELEMENT"); |
| 2645 // } on IllegalArgumentException catch (exception) { | 2694 // } on IllegalArgumentException catch (exception) { |
| 2695 // // Expected |
| 2646 // } | 2696 // } |
| 2647 // } | 2697 // } |
| 2648 // void test_setState_invalid_resolutionErrors() { | 2698 // void test_setState_invalid_resolutionErrors() { |
| 2649 // DartEntryImpl entry = new DartEntryImpl(); | 2699 // DartEntryImpl entry = new DartEntryImpl(); |
| 2650 // try { | 2700 // try { |
| 2651 // entry.setState(DartEntry.RESOLUTION_ERRORS, CacheState.FLUSHED); | 2701 // entry.setState(DartEntry.RESOLUTION_ERRORS, CacheState.FLUSHED); |
| 2652 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); | 2702 // JUnitTestCase.fail("Expected IllegalArgumentException for RESOLUTION_ER
RORS"); |
| 2653 // } on IllegalArgumentException catch (exception) { | 2703 // } on IllegalArgumentException catch (exception) { |
| 2704 // // Expected |
| 2654 // } | 2705 // } |
| 2655 // } | 2706 // } |
| 2656 // void test_setState_invalid_validState() { | 2707 // void test_setState_invalid_validState() { |
| 2657 // DartEntryImpl entry = new DartEntryImpl(); | 2708 // DartEntryImpl entry = new DartEntryImpl(); |
| 2658 // try { | 2709 // try { |
| 2659 // entry.setState(DartEntry.LINE_INFO, CacheState.VALID); | 2710 // entry.setState(DartEntry.LINE_INFO, CacheState.VALID); |
| 2660 // JUnitTestCase.fail("Expected IllegalArgumentException for a state of VA
LID"); | 2711 // JUnitTestCase.fail("Expected IllegalArgumentException for a state of VA
LID"); |
| 2661 // } on IllegalArgumentException catch (exception) { | 2712 // } on IllegalArgumentException catch (exception) { |
| 2713 // // Expected |
| 2662 // } | 2714 // } |
| 2663 // } | 2715 // } |
| 2664 // void test_setState_invalid_verificationErrors() { | 2716 // void test_setState_invalid_verificationErrors() { |
| 2665 // DartEntryImpl entry = new DartEntryImpl(); | 2717 // DartEntryImpl entry = new DartEntryImpl(); |
| 2666 // try { | 2718 // try { |
| 2667 // entry.setState(DartEntry.VERIFICATION_ERRORS, CacheState.FLUSHED); | 2719 // entry.setState(DartEntry.VERIFICATION_ERRORS, CacheState.FLUSHED); |
| 2668 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); | 2720 // JUnitTestCase.fail("Expected IllegalArgumentException for VERIFICATION_
ERRORS"); |
| 2669 // } on IllegalArgumentException catch (exception) { | 2721 // } on IllegalArgumentException catch (exception) { |
| 2722 // // Expected |
| 2670 // } | 2723 // } |
| 2671 // } | 2724 // } |
| 2672 // void test_setState_isClient() { | 2725 // void test_setState_isClient() { |
| 2673 // state2 = DartEntry.IS_CLIENT; | 2726 // state2 = DartEntry.IS_CLIENT; |
| 2674 // } | 2727 // } |
| 2675 // void test_setState_isLaunchable() { | 2728 // void test_setState_isLaunchable() { |
| 2676 // state2 = DartEntry.IS_LAUNCHABLE; | 2729 // state2 = DartEntry.IS_LAUNCHABLE; |
| 2677 // } | 2730 // } |
| 2678 // void test_setState_lineInfo() { | 2731 // void test_setState_lineInfo() { |
| 2679 // state2 = SourceEntry.LINE_INFO; | 2732 // state2 = SourceEntry.LINE_INFO; |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3420 // } | 3473 // } |
| 3421 // void test_setValue_hints() { | 3474 // void test_setValue_hints() { |
| 3422 // _setValue(HtmlEntry.HINTS, <AnalysisError> [new AnalysisError.con1(null,
HintCode.DEAD_CODE, [])]); | 3475 // _setValue(HtmlEntry.HINTS, <AnalysisError> [new AnalysisError.con1(null,
HintCode.DEAD_CODE, [])]); |
| 3423 // } | 3476 // } |
| 3424 // void test_setValue_illegal() { | 3477 // void test_setValue_illegal() { |
| 3425 // HtmlEntryImpl entry = new HtmlEntryImpl(); | 3478 // HtmlEntryImpl entry = new HtmlEntryImpl(); |
| 3426 // try { | 3479 // try { |
| 3427 // entry.setValue(DartEntry.ELEMENT, null); | 3480 // entry.setValue(DartEntry.ELEMENT, null); |
| 3428 // JUnitTestCase.fail("Expected IllegalArgumentException for DartEntry.ELE
MENT"); | 3481 // JUnitTestCase.fail("Expected IllegalArgumentException for DartEntry.ELE
MENT"); |
| 3429 // } on IllegalArgumentException catch (exception) { | 3482 // } on IllegalArgumentException catch (exception) { |
| 3483 // // Expected |
| 3430 // } | 3484 // } |
| 3431 // } | 3485 // } |
| 3432 // void test_setValue_lineInfo() { | 3486 // void test_setValue_lineInfo() { |
| 3433 // _setValue(SourceEntry.LINE_INFO, new LineInfo(<int> [0])); | 3487 // _setValue(SourceEntry.LINE_INFO, new LineInfo(<int> [0])); |
| 3434 // } | 3488 // } |
| 3435 // void test_setValue_parsedUnit() { | 3489 // void test_setValue_parsedUnit() { |
| 3436 // _setValue(HtmlEntry.PARSED_UNIT, new HtmlUnit(null, null, null)); | 3490 // _setValue(HtmlEntry.PARSED_UNIT, new HtmlUnit(null, null, null)); |
| 3437 // } | 3491 // } |
| 3438 // void test_setValue_parseErrors() { | 3492 // void test_setValue_parseErrors() { |
| 3439 // _setValue(HtmlEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError.con1
(null, HtmlWarningCode.INVALID_URI, ["-"])]); | 3493 // _setValue(HtmlEntry.PARSE_ERRORS, <AnalysisError> [new AnalysisError.con1
(null, HtmlWarningCode.INVALID_URI, ["-"])]); |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3997 // BlockFunctionBody body = main.functionExpression.body as BlockFunctionBod
y; | 4051 // BlockFunctionBody body = main.functionExpression.body as BlockFunctionBod
y; |
| 3998 // ExpressionStatement statement = body.block.statements[0] as ExpressionSta
tement; | 4052 // ExpressionStatement statement = body.block.statements[0] as ExpressionSta
tement; |
| 3999 // JUnitTestCase.assertEquals("String;", statement.toSource()); | 4053 // JUnitTestCase.assertEquals("String;", statement.toSource()); |
| 4000 // SimpleIdentifier identifier = statement.expression as SimpleIdentifier; | 4054 // SimpleIdentifier identifier = statement.expression as SimpleIdentifier; |
| 4001 // JUnitTestCase.assertEquals("String", identifier.name); | 4055 // JUnitTestCase.assertEquals("String", identifier.name); |
| 4002 // JUnitTestCase.assertNotNull(identifier.staticElement); | 4056 // JUnitTestCase.assertNotNull(identifier.staticElement); |
| 4003 // TopLevelVariableDeclaration fooDecl = declarations[1] as TopLevelVariable
Declaration; | 4057 // TopLevelVariableDeclaration fooDecl = declarations[1] as TopLevelVariable
Declaration; |
| 4004 // SimpleIdentifier fooName = fooDecl.variables.variables[0].name; | 4058 // SimpleIdentifier fooName = fooDecl.variables.variables[0].name; |
| 4005 // JUnitTestCase.assertEquals("foo", fooName.name); | 4059 // JUnitTestCase.assertEquals("foo", fooName.name); |
| 4006 // JUnitTestCase.assertNotNull(fooName.staticElement); | 4060 // JUnitTestCase.assertNotNull(fooName.staticElement); |
| 4061 // // assert element reference is preserved |
| 4007 // } | 4062 // } |
| 4008 // CompilationUnit _assertTask(String prefix, String removed, String added, St
ring suffix) { | 4063 // CompilationUnit _assertTask(String prefix, String removed, String added, St
ring suffix) { |
| 4009 // String oldCode = EngineTestCase.createSource(["${prefix}${removed}${suffi
x}"]); | 4064 // String oldCode = EngineTestCase.createSource(["${prefix}${removed}${suffi
x}"]); |
| 4010 // String newCode = EngineTestCase.createSource(["${prefix}${added}${suffix}
"]); | 4065 // String newCode = EngineTestCase.createSource(["${prefix}${added}${suffix}
"]); |
| 4011 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); | 4066 // InternalAnalysisContext context = AnalysisContextFactory.contextWithCore(
); |
| 4012 // Source source = new TestSource.con1(new JavaFile("/test.dart"), oldCode); | 4067 // Source source = new TestSource.con1(new JavaFile("/test.dart"), oldCode); |
| 4013 // DartEntryImpl entry = new DartEntryImpl(); | 4068 // DartEntryImpl entry = new DartEntryImpl(); |
| 4014 // CompilationUnit oldUnit = context.resolveCompilationUnit2(source, source)
; | 4069 // CompilationUnit oldUnit = context.resolveCompilationUnit2(source, source)
; |
| 4015 // JUnitTestCase.assertNotNull(oldUnit); | 4070 // JUnitTestCase.assertNotNull(oldUnit); |
| 4016 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source, oldUnit); | 4071 // entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source, oldUnit); |
| (...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6829 // AnalysisCacheTest.dartSuite(); | 6884 // AnalysisCacheTest.dartSuite(); |
| 6830 // DartEntryImplTest.dartSuite(); | 6885 // DartEntryImplTest.dartSuite(); |
| 6831 // HtmlEntryImplTest.dartSuite(); | 6886 // HtmlEntryImplTest.dartSuite(); |
| 6832 // PartitionManagerTest.dartSuite(); | 6887 // PartitionManagerTest.dartSuite(); |
| 6833 // SdkCachePartitionTest.dartSuite(); | 6888 // SdkCachePartitionTest.dartSuite(); |
| 6834 // UniversalCachePartitionTest.dartSuite(); | 6889 // UniversalCachePartitionTest.dartSuite(); |
| 6835 // } | 6890 // } |
| 6836 | 6891 |
| 6837 main() { | 6892 main() { |
| 6838 } | 6893 } |
| OLD | NEW |