Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Can't run Kotlin tests with Junit run configuration (used to work)
Can't run Kotlin tests with Junit run configuration (used to work) [message #1809664] Fri, 19 July 2019 14:46 Go to next message
L C is currently offline L CFriend
Messages: 9
Registered: January 2019
Junior Member
Hi,

Have a weird issue where a Junit Run Configuration that was running my Junit tests for months just stopped working and now it can no longer see/find the test.KotlinTestsRunner class (see the enclosed pics for more details). Seems like it's a Kotlin classpath issue (Java tests run just fine, see below) but the task's Dependencies tab contains the Kotlin build directories where Kotlin main and test classes are located:
   ../Kgt-4/build/classes/kotlin/main
   ../Kgt-4/build/classes/kotlin/test

Eclipse says it "Can not find test class 'test.KotlinTestsRunner' in project 'Kgt-4' (see the enclosed pic) but the test.KotlinTestsRunner is there:
$ ls -l Kgt-4/build/classes/kotlin/test/test/KotlinTestsRunner.class 
-rw-r--r-- 1 luser luser 762 Jul 21 13:02 Kgt-4/build/classes/kotlin/test/test/KotlinTestsRunner.class

Strangely, Eclipse can find and run my Java tests in test.JavaTestsRunner class with the same Junit configuration (the only difference is the test class name, obviously) without any issues. Here's how the command line looks like in this case:
/usr/lib/jvm/java-11-openjdk-amd64/bin/java -ea -Dfile.encoding=ANSI_X3.4-1968 -classpath /home/luser/Work/Kgt-4/build/classes/kotlin/main:/home/luser/Work/Kgt-4/build/classes/kotlin/test:/home/luser/Work/Kgt-4/build/classes/java/main:/home/luser/Work/Kgt-4/build/classes/java/test:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.41/e24bd38de28a326cce8b1f0d61e809e9a92dad6a/kotlin-stdlib-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.41/2ecf4aa059427d7186312fd1736afedf7972e7f7/kotlin-stdlib-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-junit/1.3.41/2ec43deb5225811cb0fd63385b7f9382a78cd225/kotlin-test-junit-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test/1.3.41/98efd6e69ef6f877b086dfd7894a4c36fe5d5736/kotlin-test-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-annotations-common/1.3.41/f57e03dea3d1a81b5e1b3cdcf4eb2710a3fac173/kotlin-test-annotations-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-common/1.3.41/744000c1a0ef654706ce3367a10543590dab9246/kotlin-test-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/home/luser/.eclipse/org.eclipse.platform_4.12.0_297942815_linux_gtk_x86_64/configuration/org.eclipse.osgi/403/0/.cp:/home/luser/.eclipse/org.eclipse.platform_4.12.0_297942815_linux_gtk_x86_64/configuration/org.eclipse.osgi/402/0/.cp org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 39669 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames test.JavaTestsRunner

$ ls -l Kgt-4/build/classes/java/test/test/JavaTestsRunner.class 
-rw-r--r-- 1 luser luser 666 Jul 21 13:02 Kgt-4/build/classes/java/test/test/JavaTestsRunner.class


The issue appeared first on 2019-3R, I then moved to 2019-6R but the issue is still there.

Any ideas? Thanks

[Updated on: Mon, 22 July 2019 12:40]

Report message to a moderator

Re: Can't run Kotlin tests with Junit run configuration (used to work) [message #1809748 is a reply to message #1809664] Mon, 22 July 2019 13:05 Go to previous messageGo to next message
L C is currently offline L CFriend
Messages: 9
Registered: January 2019
Junior Member
What's strange, somehow this Junit run configuration used to work for me for Kotlin tests in the past. But something has changed either in Eclipse configuration or whatever and I can't get it to work again.

Any ideas? Thanks

Re: Can't run Kotlin tests with Junit run configuration (used to work) [message #1810081 is a reply to message #1809748] Tue, 30 July 2019 11:41 Go to previous message
L C is currently offline L CFriend
Messages: 9
Registered: January 2019
Junior Member
Filed a bug. In case if anyone is interested here's the link:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=549471
Previous Topic:Plugin creation
Next Topic:BIRT 2.5.1 (BMC version)
Goto Forum:
  


Current Time: Fri Aug 23 08:42:07 GMT 2019

Powered by FUDForum. Page generated in 0.03155 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top