import java.io.File;
import java.util.Arrays;
-import junit.framework.Test;
-
import org.eclipse.cdt.core.dom.ast.tag.ITag;
import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IIndexLocationConverter;
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTag;
import org.eclipse.cdt.internal.core.pdom.tag.PDOMTagIndex;
+import junit.framework.Test;
+
// copy/pasted from BTreeTests
public class PDOMTagIndexTests extends BaseTestCase {
+ private File pdomFile;
private PDOM pdom;
public static Test suite() {
protected void setUp() throws Exception {
super.setUp();
- // Create a dummy instance of the PDOM for the various tests to operate
- // upon. Also acquire the PDOM's write lock to simulate the condition
- // under which the tag index is normally accessed.
- File tmpFile = File.createTempFile(getClass().getSimpleName() + '.'
+ pdomFile = File.createTempFile(getClass().getSimpleName() + '.'
+ Double.toString(Math.random()).substring(2), null);
- pdom = new WritablePDOM(tmpFile, new MockIndexLocationConverter(),
+ pdom = new WritablePDOM(pdomFile, new MockIndexLocationConverter(),
LanguageManager.getInstance().getPDOMLinkageFactoryMappings());
pdom.acquireWriteLock(null);
}
@Override
protected void tearDown() throws Exception {
pdom.close();
+ pdomFile.delete();
super.tearDown();
}