Allow RelaxNG tests to run on their own classpath; drop unneeded cleanup code

This commit is contained in:
Roman Shevchenko
2012-05-23 20:45:51 +04:00
parent 323faf9868
commit 9eb02e318a
@@ -37,6 +37,7 @@ import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiReference;
import com.intellij.testFramework.ExpectedHighlightingData;
import com.intellij.testFramework.PlatformTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.builders.EmptyModuleFixtureBuilder;
@@ -51,42 +52,21 @@ import org.intellij.plugins.testUtil.IdeaCodeInsightTestCase;
import org.intellij.plugins.testUtil.ResourceUtil;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import static com.intellij.openapi.util.io.FileUtil.delete;
/**
* Created by IntelliJ IDEA.
* User: sweinreuter
* Date: 25.07.2007
*/
public abstract class HighlightingTestBase extends UsefulTestCase implements IdeaCodeInsightTestCase {
private static final File ourTempPath;
private static final String JAVA_IO_TMPDIR = "java.io.tmpdir";
static {
// IDEA leaves bazillions of "ideaXXXX.ipr" files and "unitTestXXXX.tmp" directories in the temp directory
ourTempPath = new File(new File(System.getProperty(JAVA_IO_TMPDIR, "/tmp")), "test" + System.identityHashCode(Object.class));
ourTempPath.mkdirs();
try {
System.setProperty(JAVA_IO_TMPDIR, ourTempPath.getCanonicalPath());
Runtime.getRuntime().addShutdownHook(new Thread("Cleanup Temp") {
@Override
public void run() {
delete(ourTempPath);
}
});
} catch (IOException e) {
throw new RuntimeException(e);
}
}
protected CodeInsightTestFixture myTestFixture;
@SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors")
protected HighlightingTestBase() {
PlatformTestCase.initPlatformLangPrefix();
}
protected void setUp() throws Exception {
super.setUp();
final IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();