Package com.vladsch.plugin.test.util
Class JavaCodeInsightFixtureSpecTestCase
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- com.intellij.testFramework.UsefulTestCase
-
- com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
-
- com.vladsch.plugin.test.util.JavaCodeInsightFixtureSpecTestCase
-
- All Implemented Interfaces:
com.intellij.testFramework.TestIndexingModeSupporter,com.vladsch.flexmark.test.util.SpecExampleProcessor,CodeInsightFixtureSpecTestCase,SpecTest,junit.framework.Test
public abstract class JavaCodeInsightFixtureSpecTestCase extends com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase implements CodeInsightFixtureSpecTestCase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.intellij.testFramework.UsefulTestCase
com.intellij.testFramework.UsefulTestCase.TestDisposable
-
Nested classes/interfaces inherited from interface com.intellij.testFramework.TestIndexingModeSupporter
com.intellij.testFramework.TestIndexingModeSupporter.EmptyIndexSuite, com.intellij.testFramework.TestIndexingModeSupporter.FullIndexSuite, com.intellij.testFramework.TestIndexingModeSupporter.IndexingMode, com.intellij.testFramework.TestIndexingModeSupporter.IndexingModeTestHandler, com.intellij.testFramework.TestIndexingModeSupporter.RuntimeOnlyIndexSuite
-
-
Field Summary
Fields Modifier and Type Field Description @NotNull com.vladsch.flexmark.test.util.spec.SpecExamplemyExampleorg.junit.rules.ExpectedExceptionmyThrown-
Fields inherited from class com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
myFixture
-
Fields inherited from class com.intellij.testFramework.UsefulTestCase
IS_UNDER_SAFE_PUSH, IS_UNDER_TEAMCITY, LOG, OVERWRITE_TESTDATA, runBareTestRule, TEMP_DIR_MARKER
-
Fields inherited from interface com.vladsch.plugin.test.util.cases.CodeInsightFixtureSpecTestCase
BANNER_AFTER_ACTION, BANNER_AST, BANNER_AST_AFTER_ACTION, BANNER_AST_BEFORE_ACTION, BANNER_BEFORE_ACTION, BANNER_CLIPBOARD, BANNER_QUICK_FIXES, BANNER_RANGES, BANNER_SEGMENTS, EXCEPTION_MATCHER, TEST_CARET_MARKUP
-
Fields inherited from interface com.vladsch.plugin.test.util.cases.SpecTest
ADDITIONAL_PROJECT_FILES, ADDITIONAL_PROJECT_FILES_OPTION, CODE_STYLE_SETTINGS, CODE_STYLE_SETTINGS_OPTION, CUSTOM_OPTION, DEBUG_LOG_SETTINGS, DEBUG_LOG_SETTINGS_OPTION, EMBED_TIMED, EXAMPLE_SOURCE_EXTENSION, EXAMPLE_SOURCE_NAME, FAIL, IGNORE, LINE_MARKER_SETTINGS, LINE_MARKER_SETTINGS_OPTION, NO_FILE_EOL, TIMED, TIMED_ITERATIONS, WANT_AST, WANT_QUICK_FIXES, WANT_RANGES
-
-
Constructor Summary
Constructors Constructor Description JavaCodeInsightFixtureSpecTestCase(@Nullable java.util.Map<java.lang.String,? extends com.vladsch.flexmark.util.data.DataHolder> optionMap, @Nullable com.vladsch.flexmark.util.data.DataHolder... defaultOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSuppressedException(@NotNull java.lang.Throwable e)Add a suppressed exceptionvoidafter()booleanannotatedWith(@NotNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)voidassertException(@NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase<?> exceptionCase)voidassertException(@NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase exceptionCase, @Nullable java.lang.String expectedErrorMsg)<T extends java.lang.Throwable>
voidassertNoException(@NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase<T> exceptionCase)voidassertNoThrowable(@NotNull java.lang.Runnable closure)voidbefore()com.intellij.psi.PsiFilecreateLightFile(com.intellij.openapi.fileTypes.FileType fileType, java.lang.String text)Create a light file for the given textcom.intellij.psi.PsiFilecreateLightFile(java.lang.String fileName, com.intellij.lang.Language language, java.lang.String text)Create a light file for the given textvoiddefaultRunBare(@NotNull com.intellij.util.ThrowableRunnable<java.lang.Throwable> testRunnable)<T extends com.intellij.openapi.Disposable>
TdisposeOnTearDown(T disposable)@NotNull com.vladsch.flexmark.util.data.DataHoldergetDefaultOptions()Get default options for the testscom.intellij.openapi.editor.ex.EditorExgetEditor()Returns the editor currently opened in the in-memory editor.com.intellij.psi.PsiElementFactorygetElementFactory()@NotNull com.vladsch.flexmark.test.util.spec.SpecExamplegetExample()Get the current spec examplecom.intellij.psi.PsiFilegetFile()Returns the file currently loaded into the in-memory editor.com.intellij.testFramework.fixtures.CodeInsightTestFixturegetFixture()@NotNull java.lang.StringgetHomePath()@NotNull com.intellij.openapi.module.ModulegetModule()Get Module for the testjava.lang.StringgetName()com.intellij.openapi.project.ProjectgetProject()com.intellij.psi.impl.PsiManagerExgetPsiManager()Get PsiManager for the test@NotNull com.intellij.testFramework.fixtures.TempDirTestFixturegetTempDirFixture()@NotNull java.lang.StringgetTestDirectoryName()@NotNull java.lang.StringgetTestName(boolean lowercaseFirstLetter)@NotNull com.intellij.openapi.DisposablegetTestRootDisposable()@NotNull org.junit.rules.ExpectedExceptiongetThrown()booleanisIconRequired()booleanisPerformanceTest()booleanisStressTest()com.intellij.openapi.diagnostic.LoggerLOG()Get logger for the testcom.vladsch.flexmark.util.data.DataHolderoptions(@NotNull java.lang.String option)booleanrunInDispatchThread()booleanshouldContainTempFiles()booleanshouldRunTest()voidtest_case()protected voidtuneFixture(com.intellij.testFramework.builders.JavaModuleFixtureBuilder moduleBuilder)-
Methods inherited from class com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
getBasePath, getIndexingMode, getTestDataPath, setIndexingMode, setUp, tearDown, toAddSourceRoot
-
Methods inherited from class com.intellij.testFramework.UsefulTestCase
addTmpFileToKeep, asOuterRule, assertContainsElements, assertContainsElements, assertContainsOrdered, assertContainsOrdered, assertDoesntContain, assertDoesntContain, assertDoesntExist, assertEmpty, assertEmpty, assertEmpty, assertEmpty, assertExists, assertInstanceOf, assertNoException, assertNotEmpty, assertNullOrEmpty, assertOneElement, assertOneElement, assertOneOf, assertOrderedCollection, assertOrderedCollection, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertOrderedEquals, assertSameElements, assertSameElements, assertSameElements, assertSameElements, assertSameLines, assertSameLines, assertSameLinesWithFile, assertSameLinesWithFile, assertSameLinesWithFile, assertSameLinesWithFile, assertSize, assertSize, assertThrows, assertThrows, assertUnorderedCollection, assertUnorderedCollection, checkShouldRunTest, clearDeclaredFields, clearFields, disposeRootDisposable, doPostponedFormatting, edt, getTestName, invokeSetUp, invokeTearDown, printThreadDump, refreshAndFindFile, refreshRecursively, runBare, runBare, runTest, runTestRunnable, setupTempDir, toString, toString, toString, waitForAppLeakingThreads, wrapTestRunnable
-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, run, run, setName, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vladsch.plugin.test.util.cases.CodeInsightFixtureSpecTestCase
addFullSpecExample, appendDefaultExampleOptions, beforeDoHighlighting, checkExample, closeOpenFile, collectAndCheckHighlighting, collectAndCheckHighlighting, create, createExampleSpecRenderer, createImageFile, defaultTestCase, executeAction, executeAction, finalizeRenderer, fullTestSpecComplete, fullTestSpecStarting, getAvailableIntentionsWithRanges, getCaretOffset, getHostFile, getResultTextWithMarkup, getResultTextWithMarkup, getSpecExampleRenderer, initializeRenderer, renderSpecTestAst, resolveIconName
-
-
-
-
Method Detail
-
before
public void before() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
after
public void after() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
tuneFixture
protected void tuneFixture(com.intellij.testFramework.builders.JavaModuleFixtureBuilder moduleBuilder) throws java.lang.Exception- Overrides:
tuneFixturein classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase- Throws:
java.lang.Exception
-
getName
public java.lang.String getName()
- Overrides:
getNamein classjunit.framework.TestCase
-
options
public final com.vladsch.flexmark.util.data.DataHolder options(@NotNull @NotNull java.lang.String option)- Specified by:
optionsin interfacecom.vladsch.flexmark.test.util.SpecExampleProcessor
-
test_case
public final void test_case()
-
getFile
public final com.intellij.psi.PsiFile getFile()
Description copied from interface:CodeInsightFixtureSpecTestCaseReturns the file currently loaded into the in-memory editor.- Specified by:
getFilein interfaceCodeInsightFixtureSpecTestCase- Returns:
- the file currently loaded into the in-memory editor.
-
getEditor
public final com.intellij.openapi.editor.ex.EditorEx getEditor()
Description copied from interface:CodeInsightFixtureSpecTestCaseReturns the editor currently opened in the in-memory editor. to make it same as LightPlatformCodeInsightTestCase- Specified by:
getEditorin interfaceCodeInsightFixtureSpecTestCase- Returns:
- editor currently opened in the in-memory editor.
-
getDefaultOptions
@NotNull public final @NotNull com.vladsch.flexmark.util.data.DataHolder getDefaultOptions()
Description copied from interface:CodeInsightFixtureSpecTestCaseGet default options for the tests- Specified by:
getDefaultOptionsin interfaceCodeInsightFixtureSpecTestCase- Returns:
- default options
-
getFixture
public final com.intellij.testFramework.fixtures.CodeInsightTestFixture getFixture()
- Specified by:
getFixturein interfaceCodeInsightFixtureSpecTestCase
-
LOG
public final com.intellij.openapi.diagnostic.Logger LOG()
Description copied from interface:CodeInsightFixtureSpecTestCaseGet logger for the test- Specified by:
LOGin interfaceCodeInsightFixtureSpecTestCase- Returns:
- Logger
-
getExample
@NotNull public final @NotNull com.vladsch.flexmark.test.util.spec.SpecExample getExample()
Description copied from interface:CodeInsightFixtureSpecTestCaseGet the current spec example- Specified by:
getExamplein interfaceCodeInsightFixtureSpecTestCase- Returns:
- spec example
-
getThrown
@NotNull public final @NotNull org.junit.rules.ExpectedException getThrown()
- Specified by:
getThrownin interfaceCodeInsightFixtureSpecTestCase
-
getElementFactory
public final com.intellij.psi.PsiElementFactory getElementFactory()
- Overrides:
getElementFactoryin classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
-
getTempDirFixture
@NotNull public final @NotNull com.intellij.testFramework.fixtures.TempDirTestFixture getTempDirFixture()
- Specified by:
getTempDirFixturein interfaceCodeInsightFixtureSpecTestCase
-
getProject
public final com.intellij.openapi.project.Project getProject()
- Specified by:
getProjectin interfaceCodeInsightFixtureSpecTestCase- Overrides:
getProjectin classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
-
getPsiManager
public final com.intellij.psi.impl.PsiManagerEx getPsiManager()
Description copied from interface:CodeInsightFixtureSpecTestCaseGet PsiManager for the test- Specified by:
getPsiManagerin interfaceCodeInsightFixtureSpecTestCase- Overrides:
getPsiManagerin classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase- Returns:
- PsiManager
-
createLightFile
public final com.intellij.psi.PsiFile createLightFile(com.intellij.openapi.fileTypes.FileType fileType, java.lang.String text)Description copied from interface:CodeInsightFixtureSpecTestCaseCreate a light file for the given text- Specified by:
createLightFilein interfaceCodeInsightFixtureSpecTestCase- Parameters:
fileType- file typetext- file text- Returns:
- PsiFile
-
createLightFile
public final com.intellij.psi.PsiFile createLightFile(java.lang.String fileName, com.intellij.lang.Language language, java.lang.String text)Description copied from interface:CodeInsightFixtureSpecTestCaseCreate a light file for the given text- Specified by:
createLightFilein interfaceCodeInsightFixtureSpecTestCase- Parameters:
fileName- file namelanguage- languagetext- file text- Returns:
- PsiFile
-
getModule
@NotNull public final @NotNull com.intellij.openapi.module.Module getModule()
Description copied from interface:CodeInsightFixtureSpecTestCaseGet Module for the test- Specified by:
getModulein interfaceCodeInsightFixtureSpecTestCase- Overrides:
getModulein classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase- Returns:
- Module
-
addSuppressedException
public final void addSuppressedException(@NotNull @NotNull java.lang.Throwable e)Description copied from interface:CodeInsightFixtureSpecTestCaseAdd a suppressed exception- Specified by:
addSuppressedExceptionin interfaceCodeInsightFixtureSpecTestCase- Overrides:
addSuppressedExceptionin classcom.intellij.testFramework.UsefulTestCase- Parameters:
e- exception to add
-
shouldContainTempFiles
public final boolean shouldContainTempFiles()
- Specified by:
shouldContainTempFilesin interfaceCodeInsightFixtureSpecTestCase- Overrides:
shouldContainTempFilesin classcom.intellij.testFramework.UsefulTestCase
-
isIconRequired
public final boolean isIconRequired()
- Specified by:
isIconRequiredin interfaceCodeInsightFixtureSpecTestCase- Overrides:
isIconRequiredin classcom.intellij.testFramework.UsefulTestCase
-
getTestRootDisposable
@NotNull public final @NotNull com.intellij.openapi.Disposable getTestRootDisposable()
- Specified by:
getTestRootDisposablein interfaceCodeInsightFixtureSpecTestCase- Overrides:
getTestRootDisposablein classcom.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase
-
shouldRunTest
public final boolean shouldRunTest()
- Specified by:
shouldRunTestin interfaceCodeInsightFixtureSpecTestCase- Overrides:
shouldRunTestin classcom.intellij.testFramework.UsefulTestCase
-
defaultRunBare
public final void defaultRunBare(@NotNull @NotNull com.intellij.util.ThrowableRunnable<java.lang.Throwable> testRunnable) throws java.lang.Throwable- Specified by:
defaultRunBarein interfaceCodeInsightFixtureSpecTestCase- Overrides:
defaultRunBarein classcom.intellij.testFramework.UsefulTestCase- Throws:
java.lang.Throwable
-
runInDispatchThread
public final boolean runInDispatchThread()
- Specified by:
runInDispatchThreadin interfaceCodeInsightFixtureSpecTestCase- Overrides:
runInDispatchThreadin classcom.intellij.testFramework.UsefulTestCase
-
disposeOnTearDown
@NotNull public final <T extends com.intellij.openapi.Disposable> T disposeOnTearDown(@NotNull T disposable)- Specified by:
disposeOnTearDownin interfaceCodeInsightFixtureSpecTestCase- Overrides:
disposeOnTearDownin classcom.intellij.testFramework.UsefulTestCase
-
getTestName
@NotNull public final @NotNull java.lang.String getTestName(boolean lowercaseFirstLetter)
- Specified by:
getTestNamein interfaceCodeInsightFixtureSpecTestCase- Overrides:
getTestNamein classcom.intellij.testFramework.UsefulTestCase
-
getTestDirectoryName
@NotNull public final @NotNull java.lang.String getTestDirectoryName()
- Specified by:
getTestDirectoryNamein interfaceCodeInsightFixtureSpecTestCase- Overrides:
getTestDirectoryNamein classcom.intellij.testFramework.UsefulTestCase
-
isPerformanceTest
public final boolean isPerformanceTest()
- Specified by:
isPerformanceTestin interfaceCodeInsightFixtureSpecTestCase- Overrides:
isPerformanceTestin classcom.intellij.testFramework.UsefulTestCase
-
isStressTest
public final boolean isStressTest()
- Specified by:
isStressTestin interfaceCodeInsightFixtureSpecTestCase- Overrides:
isStressTestin classcom.intellij.testFramework.UsefulTestCase
-
assertException
public final void assertException(@NotNull @NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase<?> exceptionCase)- Overrides:
assertExceptionin classcom.intellij.testFramework.UsefulTestCase
-
assertException
public final void assertException(@NotNull @NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase exceptionCase, @Nullable @Nullable java.lang.String expectedErrorMsg)- Overrides:
assertExceptionin classcom.intellij.testFramework.UsefulTestCase
-
assertNoException
public final <T extends java.lang.Throwable> void assertNoException(@NotNull @NotNull com.intellij.testFramework.exceptionCases.AbstractExceptionCase<T> exceptionCase) throws T extends java.lang.Throwable- Overrides:
assertNoExceptionin classcom.intellij.testFramework.UsefulTestCase- Throws:
T extends java.lang.Throwable
-
assertNoThrowable
public final void assertNoThrowable(@NotNull @NotNull java.lang.Runnable closure)- Specified by:
assertNoThrowablein interfaceCodeInsightFixtureSpecTestCase- Overrides:
assertNoThrowablein classcom.intellij.testFramework.UsefulTestCase
-
annotatedWith
public final boolean annotatedWith(@NotNull @NotNull java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)- Specified by:
annotatedWithin interfaceCodeInsightFixtureSpecTestCase- Overrides:
annotatedWithin classcom.intellij.testFramework.UsefulTestCase
-
getHomePath
@NotNull public final @NotNull java.lang.String getHomePath()
- Specified by:
getHomePathin interfaceCodeInsightFixtureSpecTestCase- Overrides:
getHomePathin classcom.intellij.testFramework.UsefulTestCase
-
-