Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 292 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Test events were not received" when run tests using Intellij

#1
I have a Kotlin project and when I run my JUnit tests, I can't see tests execution result in IntelliJ and get this message instead:

> test events were not received

I'm using this setup:

macOS Mojave

Intellij CE 2019.2

JDK 11.0.3

Kotlin 1.3.50

Gradle 5.2.1

JUnit 4.12

Can you help me?
Reply

#2
Update to [2019.2.2](

[To see links please register here]

) or later, which contains the fix for the [related issue](

[To see links please register here]

).

A workaround is to run the tests using IntelliJ IDEA instead of Gradle by changing the [delegation option](
).
Reply

#3
For anyone that is still facing this -
check if you have any compiler errors in the `Build` tab.
Reply

#4
For me, the Same issue was occurring, below changes worked for me.
IntelliJ Version I am using: 2019.2.2
In IntelliJ IDE, Go to

File -> Settings ->Build,Execution, Deployment -> Build Tools -> Gradle

here in the `Run test using:` dropdown selected option was: `Gradle(default)` changed it to `IntelliJ IDEA`

[![][1]][1]

[1]:
Reply

#5
I was using facing the same issue even using IntelliJ IDEA 2019.2.4 (top answer said this was fixed on 2019.2.2). Turns out I had to `Invalidate Caches / Restart...` before trying.
Reply

#6
When trying to work out this problem for myself, I discovered JUnit 4 worked, but JUnit 5 reports "Tests were not received." Per [petrikainulainen.net][1] I found my solution.

> Even though Gradle 4.6 (and obviously all newer versions) has a native
> support for JUnit 5, this support is not enabled by default. If we
> want to enable it, we have to ensure that the test task uses JUnit 5
> instead of JUnit 4.

When I added the following code to Gradle, JUnit 5 worked.

test {
useJUnitPlatform()
}


[1]:

[To see links please register here]

Reply

#7
For me, this is helpful to click "Help -> Check for Updates..."

[Help -> Check for Updates...][1]


[1]:
)
Reply

#8
The problem occurred as I used both following plugins at the same time

plugins
{
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
...
}

after deletion of the second one, the tests were found and executed.
Reply

#9
I often have to delete build and out folder to fix this problem ..
Reply

#10
**Answer**

I know of some issues that occur when running Gradle together with the newest JDK versions (13 & 14). If you selected either version 13 or 14 of the JVM as the Gradle JVM try using either 8 or 11.

Switch the Gradle JVM to version 11:

`File -> Settings -> Build Execution, etc -> Built Tools -> Gradle -> Gradle JVM`

**Explanation**

I believe that by default Intellij will use the project SDK:

`Project strcuture -> Project -> Project SDK`

I've had this on several occasions now and picking version 11 of the JVM fixed things for me.

Worth noting is that for most of my project I'm using:
- Lombok
- Jackson
- Lombok plugin (Require annotation processing to be enabled)

I don't remember where I read it but I believe there were some issues with the lombok plugin + gradle + JVM version. I might revisit this answer if I can remember where I found the post about it.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through