mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fixed a race condition in test.
This commit is contained in:
parent
7f394792a4
commit
f4081e6fc9
1 changed files with 8 additions and 7 deletions
|
@ -81,7 +81,7 @@ public class BasicSearchTest extends BaseUITestCase {
|
|||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
if(fCProject != null) {
|
||||
if (fCProject != null) {
|
||||
fCProject.getProject().delete(true, NPM);
|
||||
}
|
||||
super.tearDown();
|
||||
|
@ -255,14 +255,13 @@ public class BasicSearchTest extends BaseUITestCase {
|
|||
Object node = nodeElements[0];
|
||||
if (!(node instanceof IStatus))
|
||||
node = nodeElements[1];
|
||||
if (node instanceof IStatus)
|
||||
{
|
||||
if (node instanceof IStatus) {
|
||||
IStatus firstRootNode = (IStatus) node;
|
||||
assertEquals(IStatus.WARNING, firstRootNode.getSeverity());
|
||||
// can't really verify text in case message is localized...
|
||||
}
|
||||
else
|
||||
} else {
|
||||
fail("can't get status");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// must NOT have the IStatus
|
||||
|
@ -334,14 +333,16 @@ public class BasicSearchTest extends BaseUITestCase {
|
|||
IFile file = fCProject.getProject().getFile(new Path("references.cpp"));
|
||||
file.setContents(new ByteArrayInputStream(newContent.getBytes()), IResource.FORCE, NPM);
|
||||
runEventQueue(1000);
|
||||
assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor()));
|
||||
IIndexManager indexManager = CCorePlugin.getIndexManager();
|
||||
indexManager.update(new ICElement[] {fCProject}, IIndexManager.UPDATE_ALL);
|
||||
assertTrue(indexManager.joinIndexer(360000, new NullProgressMonitor()));
|
||||
|
||||
assertOccurences(query, 2);
|
||||
|
||||
String newContent2= "void bar() {foo(); foo();}";
|
||||
file.setContents(new ByteArrayInputStream(newContent2.getBytes()), IResource.FORCE, NPM);
|
||||
Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, null);
|
||||
assertTrue(CCorePlugin.getIndexManager().joinIndexer(360000, new NullProgressMonitor()));
|
||||
assertTrue(indexManager.joinIndexer(360000, new NullProgressMonitor()));
|
||||
|
||||
assertOccurences(query, 3);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue