user1298426
user1298426

Reputation: 3717

Intellij error - test framework quit unexpectedly intellij

I have been trying to run junit test but facing this issue constantly. I tried to look for answers on the internet but nothing helped.

enter image description here]1

enter image description here

Upvotes: 16

Views: 33433

Answers (8)

Alin Pop
Alin Pop

Reputation: 471

For me it was because two tests had the same name and namespace.

What actually happened: deleting a folder to which a class was pointing, convinced(?) PHPStorm to create a copy of the folder of the class.

Upvotes: -1

chill appreciator
chill appreciator

Reputation: 422

JUnit 5 and/or Intellij needs an extra dependency to be able to run tests:

<dependency>
    <groupId>org.junit.platform</groupId>
    <artifactId>junit-platform-launcher</artifactId>
    <version>1.9.2</version>
    <scope>test</scope>
</dependency>

Upvotes: 0

Murat Yıldız
Murat Yıldız

Reputation: 12032

If there is an error e.g.

"CommandLineWrapper is ill-suited for launching apps on Java 9+..."

Then, try the following workaround in IntelliJ IDEA:

Run -> Edit configurations -> select the failed running config -> Shorten command line: @argfile (Java 9+) -> OK

Upvotes: 8

Benoy Prakash
Benoy Prakash

Reputation: 545

For IntelliJ 2019 and above go to :
Settings-> Build,Execution,Deployment -> Build Tools -> Maven -> Running Tests and Uncheck argLine

Upvotes: 6

User42
User42

Reputation: 1

For me also, the problem was that I made a change in the dependecies and the dependecy updated was incompatible in the SBT project.

Upvotes: 0

Peter Lamberg
Peter Lamberg

Reputation: 8641

For me the problem was that I had some incompatible/old dependencies in my SBT project.

I updated the versions of every 3rd party in the SBT config and running ZIO tests in IntelliJ started working.

Upvotes: 0

mmmcho
mmmcho

Reputation: 259

I had previously installed zulu and Oracle Java and then switched between the two quite a bit. I ended up having many JDKs

Here's what helped me.

In intelliJ, go to Run, the Edit Configurations. In the Run/Debug Configurations window, under Build and run section, select 'Java Bundled'.

To make sure this applies for all tests, click on the edit template icon (the spanner), select JUnit and then in the Build and run section select 'java Bundled'

Make sure all the configurations under JUnit has 'java Bundled' as well

Click Apply and Ok. Try to run the tests now and it should probably work.

Upvotes: 1

user3198259
user3198259

Reputation: 174

I had same issue but it has been resolved by updating the Intellij latest version 2020.3. Now i am able to run the test without any error. Please check below link for latest Intellij versions https://www.jetbrains.com/idea/download/

Upvotes: 0

Related Questions