Commit 946330a8 authored by Dmitry Jemerov's avatar Dmitry Jemerov
Browse files

Some javadoc and cleanup for IdeaTestExecutionPolicy

parent 6208453e
Branches unavailable Tags unavailable
No related merge requests found
Showing with 29 additions and 3 deletions
+29 -3
...@@ -13,10 +13,15 @@ import com.intellij.psi.PsiFile; ...@@ -13,10 +13,15 @@ import com.intellij.psi.PsiFile;
import com.intellij.testFramework.TestModeFlagListener; import com.intellij.testFramework.TestModeFlagListener;
import com.intellij.testFramework.TestModeFlags; import com.intellij.testFramework.TestModeFlags;
import com.intellij.testFramework.UsefulTestCase; import com.intellij.testFramework.UsefulTestCase;
import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
/** /**
* Allows to customize the test execution environment for the entire test execution without modifying the source code
* of tests. To specify a test execution policy, set the system property "idea.test.execution.policy" to the FQ name
* of a class implementing this interface.
*
* @author yole * @author yole
*/ */
public abstract class IdeaTestExecutionPolicy implements TestModeFlagListener { public abstract class IdeaTestExecutionPolicy implements TestModeFlagListener {
...@@ -24,9 +29,26 @@ public abstract class IdeaTestExecutionPolicy implements TestModeFlagListener { ...@@ -24,9 +29,26 @@ public abstract class IdeaTestExecutionPolicy implements TestModeFlagListener {
TestModeFlags.addListener(this); TestModeFlags.addListener(this);
} }
public abstract void setUp(Project project, Disposable testRootDisposable, String testDataPath); /**
public abstract TempDirTestFixture createTempDirTestFixture(); * Performs the setup required in this test execution mode.
public abstract boolean runInDispatchThread(); */
public void setUp(Project project, Disposable testRootDisposable, String testDataPath) {
}
/**
* Creates the fixture for working with temporary files.
*/
public TempDirTestFixture createTempDirTestFixture() {
return new LightTempDirTestFixtureImpl(true);
}
/**
* If true, the test method is invoked in the EDT. Otherwise, it runs on the test runner thread.
*/
public boolean runInDispatchThread() {
return true;
}
public void testFileConfigured(@NotNull PsiFile file) { public void testFileConfigured(@NotNull PsiFile file) {
} }
......
...@@ -6,6 +6,10 @@ import java.lang.annotation.Retention; ...@@ -6,6 +6,10 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/**
* Marks a test as not applicable to a given test execution policy. If the value of this annotation
* matches the {@link IdeaTestExecutionPolicy#getName()} of the current test execution policy, the test will be skipped.
*/
@Target(ElementType.TYPE) @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface SkipWithExecutionPolicy { public @interface SkipWithExecutionPolicy {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment