Intellij error - test framework quit unexpectedly intellij - intellij-idea

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.
]1

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

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

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/

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.

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.

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

Related

Run Hybris unit test in intellij Idea community edition

i want to run hybris unit test using intellij community edition like how we do it on eclipse.
I don't want to use Hybris intergation plugin as it was failed to defect the unittest that are present in custom directory. when i try to run the test Intellij native build is triggering but not the ant build. and i am resolving the dependencies whenever intellij throws me build fail with those errors.
Can anyone help me to set this up or guide me through what all necessary steps to follow.
I am using latest version of community edition , Junit - 4 & Mockito for writing unit tests.
Thanks in advance.
I was able to Run the tests once i resolved all the errors that was throwing by intellij.
refer the Image here
Once you click on that run button, you get build errors, once you resolve those build errors then automatically that test will run. if it says shorten the command line then
Please refer this article by Intellij, hope this helps.

Grails application is not found after updating to IntelliJ IDEA Ultimate 2016.2

I have updated my IntelliJ IDEA Ultimate to the 2016.2 version.
I had a Grails 3 project and now when I open the IDE I get the following error when trying to run my project:
Error running Grails: My_Project: Grails application is not found
I can still open the terminal and run the project manually, but it seems that IntelliJ IDEA no longer recognises my Grails application. When going to "Edit configurations...", in "Application" it says "[none]" and I can't select anything.
Grails Version: 3.1.9
Groovy Version: 2.4.7
JVM Version: 1.8.0_66
A Simple solution to this is to refresh the gradle projects.
You can do this by popping out the little gradle tab and hitting the "Refresh All Gradle Projects"
I run into the same problem always when i restart intellij. Running grails clean command from the terminal fixed it.
First, re-import the project into IntelliJ 2016.2. Choose the build.gradle file for the import. Use the gradle wrapper or a local gradle installation, where you have given IntelliJ the path to the locally installed Gradle. Let IntelliJ re-index everything. Wait until you see no further indexing on the bottom of the screen.
Second, run the application once, with no edit configuration. After this completes with error, you should be able to choose Run -> Edit Configuration / Application.
Third, you can go into the project pane to the grails-app/init/app-name/Application.groovy file and right-click on that and choose Run. After that, an edit configuration will be created.
Finally, you can try to invalidate cache and restart. (This has nothing to do with Edit Configuration, but sometimes the gradle and/or .idea caches get out of sync.)
I had the same problem after updating to IntelliJ Ultimate 2019.2.
It seems that the "little gradle tab" of the accepted answer no longer exists.
The reason in my case was that the Gradle Plugin had been disabled by the update process.
Resolution: Hit Help > Find Action > Type gradle. You should see a line "Gradle" and a ON-OFF switch at the end of that line.
Enable it and restart IntelliJ solved my problem.

Play Framework with IntelliJ Community Edition 14

I have not managed to compile/debug etc. the current Play Framework (2.3.7) with the Community Edition 14 of IntelliJ. Neither by importing the project, nor by using gen-idea .
Is there any way to get it run or is there just no way to use it ?
Paying > 400 bucks for just this feature is simply too much.
Thanks.
Usually I compile and run through console: activator -> compile/run, but you can compile in Intellij too by running Build -> Make Project, but I never tried running Play in Intellij though.
And for debugging, I run command activator -jvm-debug 9999 run as said in documentation. Then I set up remote debug configuration in Intellij.

Skip tests in IntelliJ using Gradle

Does anyone know how I can skip JUnit tests in IntelliJ when doing a Gradle build like the following command line version? I have searched extensively for a solution but can't find one. I am in the process of converting an existing project to Gradle and need to support many developers that are not familiar with Gradle, some UX, some front end, and some Java. There are many broken Junit tests in the myriad modules and long-term we will fix them. Short term I need all other developers to use the tools they are familiar with to be able to do their job easily.
./gradlew build -x test
The Gradle-Android Compiler settings allow for command-line options but not non-android projects as shown in the IntelliJ settings dialog shown below.
You should be able to run a standard clean build from intellij if it's a gradle project (aka gradle integration in intellij). Then edit the configuration and add at the script parameters : -x test which will run the clean build (or any other task) without running tests.
I am using Intellij IDEA 2019.3 (Community Edition).
You can skip test using following settings.
You can get to this via Gradle panel located at right top corner.
Select task -> Run Configuration -> Right click -> Edit Run Configuration..
From intellij 2021.2 onwards, type the argument directly in Run text

TestNG tests don't start in IntelliJ 13.1.4

I am unable to run or debug any TestNG tests in IntelliJ 13.1.4 on my Mac. When I try to run the test in debug mode, the IDE is hung starting the test - it never completes.
However, I can work with the same test using an older version of IntelliJ (12.1.7).
So far I've tried changing the JDK, replacing the testng jar in ../IntelliJ13/plugins/testng/lib, reimporting all maven dependencies, rebuilding IntelliJ indices.
Any ideas about how to fix my IntelliJ 13.1.4 environment?
I had similar issue - it turns out that I need to config my JVM options and connection used.
Update:
Sadly no, they are internal resources. But the algorithm should be the same (for your case):
goto Run/Debug Configuration
select TestNG
add your Name for the new configuration
select path to your test suite in Suite
in JDK settings tab, find VM options input your connection configs
run/debug for the Run/Debug Configuration - menu arrows
this worked for me.