OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012, the Dart project authors. | 2 * Copyright (c) 2012, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 //System.out.println("test_performAnalysisTask_stress: " + i); | 1488 //System.out.println("test_performAnalysisTask_stress: " + i); |
1489 break; | 1489 break; |
1490 } | 1490 } |
1491 } | 1491 } |
1492 ChangeNotice[] notice = context.performAnalysisTask().getChangeNotices(); | 1492 ChangeNotice[] notice = context.performAnalysisTask().getChangeNotices(); |
1493 if (notice != null) { | 1493 if (notice != null) { |
1494 fail("performAnalysisTask failed to terminate after analyzing all sources"
); | 1494 fail("performAnalysisTask failed to terminate after analyzing all sources"
); |
1495 } | 1495 } |
1496 } | 1496 } |
1497 | 1497 |
| 1498 @Override |
| 1499 protected void tearDown() throws Exception { |
| 1500 context = null; |
| 1501 super.tearDown(); |
| 1502 } |
| 1503 |
1498 private Source addSource(String fileName, String contents) { | 1504 private Source addSource(String fileName, String contents) { |
1499 Source source = new FileBasedSource(createFile(fileName)); | 1505 Source source = new FileBasedSource(createFile(fileName)); |
1500 ChangeSet changeSet = new ChangeSet(); | 1506 ChangeSet changeSet = new ChangeSet(); |
1501 changeSet.addedSource(source); | 1507 changeSet.addedSource(source); |
1502 context.applyChanges(changeSet); | 1508 context.applyChanges(changeSet); |
1503 context.setContents(source, contents); | 1509 context.setContents(source, contents); |
1504 return source; | 1510 return source; |
1505 } | 1511 } |
1506 | 1512 |
1507 private TestSource addSourceWithException(String fileName) { | 1513 private TestSource addSourceWithException(String fileName) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1582 context.applyChanges(changeSet); | 1588 context.applyChanges(changeSet); |
1583 } | 1589 } |
1584 | 1590 |
1585 private void setIncrementalAnalysisCache(AnalysisContextImpl context2, | 1591 private void setIncrementalAnalysisCache(AnalysisContextImpl context2, |
1586 IncrementalAnalysisCache incrementalCache) throws Exception { | 1592 IncrementalAnalysisCache incrementalCache) throws Exception { |
1587 Field field = AnalysisContextImpl.class.getDeclaredField("incrementalAnalysi
sCache"); | 1593 Field field = AnalysisContextImpl.class.getDeclaredField("incrementalAnalysi
sCache"); |
1588 field.setAccessible(true); | 1594 field.setAccessible(true); |
1589 field.set(context2, incrementalCache); | 1595 field.set(context2, incrementalCache); |
1590 } | 1596 } |
1591 } | 1597 } |
OLD | NEW |