File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
adapter/src/test/kotlin/org/javacs/ktda Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ package org.javacs.ktda
2
+
3
+ import java.nio.file.Path
4
+ import java.nio.file.Paths
5
+ import org.eclipse.lsp4j.debug.DisconnectArguments
6
+ import org.javacs.ktda.adapter.KotlinDebugAdapter
7
+ import org.javacs.ktda.jdi.launch.JDILauncher
8
+ import org.junit.AfterClass
9
+
10
+ abstract class DebugAdapterTestFixture (relativeWorkspaceRoot : String ) {
11
+ private val absoluteWorkspaceRoot: Path = Paths .get(DebugAdapterTestFixture ::class .java.getResource(" /$relativeWorkspaceRoot " ).toURI())
12
+ val debugAdapter: KotlinDebugAdapter = JDILauncher ()
13
+ .let (::KotlinDebugAdapter )
14
+ .also { it.launch(mapOf (
15
+ " projectRoot" to absoluteWorkspaceRoot.toString(),
16
+ " mainClass" to " sample.workspace.AppKt"
17
+ )) }
18
+
19
+ @AfterClass private fun closeDebugAdapter () {
20
+ debugAdapter.disconnect(DisconnectArguments ()).join()
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments