generated from JetBrains/intellij-platform-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
44 deletions.
There are no files selected for viewing
88 changes: 44 additions & 44 deletions
88
src/test/kotlin/com/dsoftware/ghmanager/psi/HighlightAnnotatorTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
package com.dsoftware.ghmanager.psi | ||
|
||
import com.intellij.openapi.components.service | ||
import com.intellij.psi.PsiManager | ||
import com.intellij.testFramework.EditorTestUtil | ||
import com.intellij.testFramework.common.initTestApplication | ||
import com.intellij.testFramework.junit5.RunInEdt | ||
import com.intellij.testFramework.rules.ProjectModelExtension | ||
import org.junit.jupiter.api.BeforeEach | ||
import org.junit.jupiter.api.Test | ||
import org.junit.jupiter.api.extension.RegisterExtension | ||
|
||
@RunInEdt(writeIntent = true) | ||
class HighlightAnnotatorTest { | ||
init { | ||
initTestApplication() | ||
} | ||
|
||
@JvmField | ||
@RegisterExtension | ||
protected val projectRule: ProjectModelExtension = ProjectModelExtension() | ||
|
||
@BeforeEach | ||
fun setUp() { | ||
|
||
} | ||
|
||
@Test | ||
fun testAnnotate() { | ||
val workflowContent = HighlightAnnotatorTest::class.java.getResource("/testproject/workflow.yaml")!!.readText() | ||
val workflowFile = | ||
projectRule.baseProjectDir.newVirtualFile(".github/workflows/workflow.yaml", workflowContent.toByteArray()) | ||
val psiManager = projectRule.project.service<PsiManager>() | ||
val answer = """""" | ||
val psiFile = psiManager.findFile(workflowFile) | ||
EditorTestUtil.testFileSyntaxHighlighting(psiFile!!, true, answer) | ||
} | ||
} | ||
|
||
//package com.dsoftware.ghmanager.psi | ||
// | ||
//class FakePsiFile(project: Project, private val filename: String) : | ||
// MockPsiFile(LightVirtualFile(filename), MockPsiManager(project)) { | ||
// override fun getName(): String = filename | ||
//import com.intellij.openapi.components.service | ||
//import com.intellij.psi.PsiManager | ||
//import com.intellij.testFramework.EditorTestUtil | ||
//import com.intellij.testFramework.common.initTestApplication | ||
//import com.intellij.testFramework.junit5.RunInEdt | ||
//import com.intellij.testFramework.rules.ProjectModelExtension | ||
//import org.junit.jupiter.api.BeforeEach | ||
//import org.junit.jupiter.api.Test | ||
//import org.junit.jupiter.api.extension.RegisterExtension | ||
// | ||
// override fun getContainingFile(): PsiFile = this | ||
//} | ||
//@RunInEdt(writeIntent = true) | ||
//class HighlightAnnotatorTest { | ||
// init { | ||
// initTestApplication() | ||
// } | ||
// | ||
// @JvmField | ||
// @RegisterExtension | ||
// protected val projectRule: ProjectModelExtension = ProjectModelExtension() | ||
// | ||
// @BeforeEach | ||
// fun setUp() { | ||
// | ||
// } | ||
// | ||
// @Test | ||
// fun testAnnotate() { | ||
// val workflowContent = HighlightAnnotatorTest::class.java.getResource("/testproject/workflow.yaml")!!.readText() | ||
// val workflowFile = | ||
// projectRule.baseProjectDir.newVirtualFile(".github/workflows/workflow.yaml", workflowContent.toByteArray()) | ||
// val psiManager = projectRule.project.service<PsiManager>() | ||
// val answer = """""" | ||
// val psiFile = psiManager.findFile(workflowFile) | ||
// EditorTestUtil.testFileSyntaxHighlighting(psiFile!!, true, answer) | ||
// } | ||
//} | ||
// | ||
//// | ||
////class FakePsiFile(project: Project, private val filename: String) : | ||
//// MockPsiFile(LightVirtualFile(filename), MockPsiManager(project)) { | ||
//// override fun getName(): String = filename | ||
//// | ||
//// override fun getContainingFile(): PsiFile = this | ||
////} |