mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 08:18:55 +00:00
Actually delete LSP test folder after test
Delete on exit doesn't work if the folder is not empty. Since we don't remove the individual files the folder doesn't get deleted. Signed-off-by: Titouan Vervack <titouan.vervack@sigasi.com>
This commit is contained in:
parent
4f2f3f7022
commit
33534239c5
1 changed files with 11 additions and 4 deletions
|
@ -78,8 +78,10 @@ import org.eclipse.xtext.resource.IResourceServiceProvider
|
|||
import org.eclipse.xtext.util.CancelIndicator
|
||||
import org.eclipse.xtext.util.Files
|
||||
import org.eclipse.xtext.util.Modules2
|
||||
import org.junit.After
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.jupiter.api.AfterEach
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
|
||||
/**
|
||||
|
@ -91,6 +93,8 @@ abstract class AbstractLanguageServerTest implements Endpoint {
|
|||
@Accessors
|
||||
protected val String fileExtension
|
||||
|
||||
protected static val TEST_PROJECT_PATH = "/test-data/test-project"
|
||||
|
||||
@Before @BeforeEach
|
||||
def void setup() {
|
||||
val injector = Guice.createInjector(getServerModule())
|
||||
|
@ -106,11 +110,14 @@ abstract class AbstractLanguageServerTest implements Endpoint {
|
|||
languageServer.supportedMethods()
|
||||
|
||||
// create workingdir
|
||||
root = new File(new File("").absoluteFile, "/test-data/test-project")
|
||||
if (!root.mkdirs) {
|
||||
Files.cleanFolder(root, null, true, false)
|
||||
root = new File(new File("").absoluteFile, TEST_PROJECT_PATH)
|
||||
}
|
||||
|
||||
@After @AfterEach
|
||||
def void cleanup() {
|
||||
if (root.exists) {
|
||||
Files.cleanFolder(root, null, true, true)
|
||||
}
|
||||
root.deleteOnExit
|
||||
}
|
||||
|
||||
protected def Module getServerModule() {
|
||||
|
|
Loading…
Reference in a new issue