Why Don't My IntelliJ Code Breakpoints Work? - intellij-idea

When I run my tests on debug, the debugger stops on the test breakpoints, but not in the code itself. Why is that?
I have tried:
Rebooting my machine
Updating IntelliJ to the latest version
Restarting the software and clearing the cache
Deleting the debugger configurations
None of that works.
I also notice that my System.out.println doesn't print to the console in neither the test nor the application code. Not sure if this is related.

Related

Weird behaviour when trying to debug class in IntelliJ

Since receiving a new laptop from my new employer, the debugger has been behaving differently to previous experiences (been using IntelliJ on macOs and Windows for years)
I invoke the debugger by creating and running a "Remote JVM debug configuration". When I run the java command to run the code, I provided some parameters so debugging would work.
Previous / preferable behavior: The debugger will open my .java file and stop at the breakpoint.
New behaviour: The debugger will open the .class file (decompiled version of the .class from the .jar file) and stop at the breakpoint.
How do I get back the old behavior back?

Intellij - work-around for IDE not building module on Run/Debug

I have a pretty large project, of which the Selenium/Cucumber part is integrated, and belongs to me.
No, after upgrading to Intelij 2022, I find that things have changed to the worse. Since I only bother about the module containin cucumber/selenium tests, I have been used to just clicking Run or Debug on each Run/Debug configuration to get my changes built, and the Cucumber/Selenium tests run locally on my computer.
This doesn't work anymore, and absolutely 100% of all help/support I have found on the net is unhelpful. The problem is that when I make a change in the code and click Run or Debug, the module (cucumber, where all the Cucumber/selenium tests resides) is not built. So, it keeps running the previously built code when I'm working on debugging/fixing tests.
The solution has been to first build the module containing the tests, then run/debug the test(s). Even though the run/debug configuration DOES have "Build" before launch. But this is tiresome, and a total waste of time.
So, what I'm wondering is: Can I tailer a terminal command to do all this? That is, build a specified module, then Run or Debug a Cucumber test.
Any help/hints are appreciated. I'm experiencting the usual "me" problem, where it seems that everyone else in the world has something working, while the same solutions doesn't work for me.
EDIT:
I tried the solution offered below in the comments: Deleted the .idea folder, reimported all Maven modules and reconfigured the project. It seemed to work on the first run, but then it went back to not building before launch.
You can try to change Select Run/Debug configuration in idea. Change Build to Build Project. It worked for me.

How to prevent idea test output files when running JUnit Tests in IntelliJ?

When I'm running my unit tests right now (they are very intensive, lots out console output and run for a long time)... I noticed that my disk space was disappearing.
Turns out there are a few files being created
I'm not really sure what is causing this: IntelliJ, the IntelliJ Junit plugin or the console somehow. I don't think it is the console because after I noticed this problem, I installed a different console and the problem still occurs. I googled but couldn't find information about these files.
Anyone know how I can disable this?

Gradle project sync failed with no event log

I have a libGDX project generated by the gdx-setup.jar tool, including core, android, desktop, and html modules. I hadn't touched any of the gradle files, and my build has worked fine for some weeks.
This morning when I opened IntelliJ IDEA (build 135.1230), it offered to update the Scala plugin, so I accepted and restarted, before trying to open the project. My libGDX project doesn't use Scala at all: I have the plugin for other work. When I tried to open the project, I got the infamous "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly" message. Clicking "Try again" thinks for a bit before showing the same message. The Event Log window contains no output, and the Messages window says:
Error: (of class java.lang.String)
The Scala plugin isn't the only thing that might have changed: I've rebooted the (Ubuntu) machine since the project last worked, so it's possible that some package updates might have only just had an effect.
Following the advice of others, I've tried editing the root gradle.properties to change org.gradle.configureondemand to false, and that made no difference. I've tried performing "Build → Clean Project" and "Invalidate and Restart", with the same effect. I've also tried running git clean -X and reimporting the Gradle project into IDEA, but I just get a "Resolve error" dialog with the same message as above.
Running a build command like
./gradlew android:assemble
from a shell still works fine: only IntelliJ IDEA has a problem.
Even if you've never seen this particular problem, I'd appreciate any tips on where to start debugging it. The error message doesn't exactly give me a lot to go on.

Intellij complains about fork mode when running tests with code cover

I want to get information about how much the tests cover in our application. When I try to run all tests with coverage Intellij complains about the current fork mode. See image below.
The strange thing is that in the selected Run/Debug Configuration that I have the Fork mode is already set to none. Intellij still encourage me to change the Fork mode to none.
I am using Intellij 13.0.1, this is a feature that have been around for long, so I am missing something obvious, right?
Does anyone know what the problem might be?
IDEA-118572 unable to run JUnit tests with code coverage - fork mode is required