We're using IntelliJ version 14 and are trying to add Jacoco code coverage to our remote Java application project. This is defined under the "Remote" option in the Edit Run/Debug Configuration.
Is there any way to activate Code Coverage for Remote app? There is no "Coverage" tab.
This is not a standard app with a main method.
Thanks
Enabling code coverage requires adding a JVM agent that instruments bytecode to collect coverage information. When you use the Remote configuration, the JVM is not started by IntelliJ IDEA, and therefore there is no way to enable code coverage through the IntelliJ IDEA UI.
You can enable the coverage manually by modifying the VM options used to start your remote process and adding the coverage agent.
Related
Is there a way to force JetBrains IDE startup tasks to be debugged instead of being run?
Specifically, I want to configure WebStorm Settings | Tools | Startup Tasks to automatically perform a JavaScript debug task on IDE startup. The debug task only works by debugging it instead of running it, but it seems that WebStorm performs startup tasks by simply running it. I'm using WebStorm 2022.3.
I'm expecting the task to be performed on startup as if it is executed by clicking the Debug button on the top right of the IDE.
debug mode for startup tasks is not supported right now. However, we have a corresponding feature request on our bug tracker. We would appreciate it if you could upvote the issue to demonstrate additional interest and bring increased awareness to the issue.
can you please describe me how to setup a development environment with intellij IDEA for restcomm-smsc to debug run compile build and doing breakpoints etc.
i am using ubuntu 14.04.
i could run the smsc gateway from the binary package and do the simulator tests but when it comes to do some coding and debugging and building stuff, i cannot creat e the correct development environment for restcomm-smsc source code.
i really appreciate if you can guide me simply how to do it?
Thanks a lot
BR
Gokhan
Do you want to debug application deployed on JBoss? If so you need to simply add/uncomment JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n" in run.sh/standalone.sh.
In intellij Run -> Edit Configurations -> Remote and provide jboss IP and port from JAVA_OPTS.
Here is my scenario.
I have a code base, which is built and deployed as EAR on jBoss server.
I have a separate testing framework.
Now I want to run the classes of that EAR using my testing framework.
The test cases are written in TestNG.
Also I want to know the code coverage of the EAR.
I have used eclEmma to do code coverage for Junits, it was simple as the code and tests are at same place.
How can I use Emma in the case of remote code base. Please help.
EclEmma is Eclipse plugin based on JaCoCo - Java Code Coverage Library. JaCoCo provides various ways for collection of code coverage. In particular you can attach it to the server as a Java agent and request information about coverage remotely. And even import and show it in Eclipse using EclEmma.
I use JProfiler 8.1.4 and I have it integrated with IntelliJ IDEA 14.1.3.
I have a JProfiler session for profiling JBoss using the standalone_jprofiler.bat script like this:
Now, when I want to go to the source code for some method, JProfiler uses a (minimal) internal file viewer instead of using IntelliJ.
I would assume that the source code linking works fine when the profiling is initiated by the IntelliJ plugin, but in my case I don't know what run configuration to create in IntelliJ for standalone_jprofiler.bat.
So finally, my question is: Is it possible to see the code in IntelliJ when the profiling is initiated from the standalone JProfiler application?
One more piece of information: In this case I want the profiling to be activated immediately on startup.
I apologize in advance if this is too simple or silly. I've used JProfiler for just one day and googling didn't yield any relevant answers.
Is it possible to see the code in IntelliJ when the profiling is initiated from the standalone JProfiler application
No, that is not possible, you have to start the profiling session from IDEA to get source code navigation in the IDE.
Another possibility is to save a snapshot in JProfiler and open that snapshot in IDEA (via File->Open File). If the JProfiler plugin is installed in IDEA, the snapshot will then be opened with source code navigation in the IDE.
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.