Hi all,
I am trying to run a unit test for jvmTest in IDEA 2019.3 for Kotlin multiplatform library
My jvmTest class directory as follows is jvmTest/kotlin/sample/DummyTest and content of DummyTest is as follows
package sample;
import org.junit.Test;
public class DummyTest {
@Test
public void test1(){
System.out.println("here");
}
}
Then I configure the junit as follows
Then I try to run the test by right click on the test file in the IDEA but it fails with
Process finished with exit code 1
Class not found: “sample.DummyTest”
Please see my build.gradle file
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
}
repositories {
mavenCentral()
}
group 'com.example'
version '0.0.1'
apply plugin: 'maven-publish'
kotlin {
jvm()
js {
browser {
}
nodejs {
}
}
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
macosX64("macos")
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmMain {
dependencies {
implementation kotlin('stdlib-jdk8')
}
}
jvmTest {
dependencies {
implementation kotlin('test')
implementation kotlin('test-junit')
}
}
jsMain {
dependencies {
implementation kotlin('stdlib-js')
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
}
}
macosMain {
}
macosTest {
}
}
}
Could someone please point what am I doing wrong