Questions about IntelliJ IDEA

View: New views
2 Messages — Rating Filter:   Alert me  

Questions about IntelliJ IDEA

by Russel Winder-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have found that there seems to be some issues between compilation and
unit test execution in IntelliJ IDEA, and this must be me just missing
something.  Hopefully something very simple.

I pointed IntelliJ IDEA at my standard installation of Groovy (its a
build of Subversion HEAD of yesterday sometime, so Groovy 1.6)  I then
added Groovy 1.5.6 from my Maven repository as the version of Groovy to
compile against.  This all led to successful compilation for both Main
and Test.  However when I tried to run the tests I always get a problem
of CallSite not being found.  This implies that the IntelliJ IDEA
compiler is using only the jars specified, but the runtime is using the
Groovy plugin installation jar prior to the specified jars.  I can sort
of see how this can be but isn't this an error?  If I replace the
compilation jars with the ones from the Groovy installation then
compilation and execution of unit tests proceeds as expected.

Unfortuantely most of the unit tests fail in IntelliJ IDEA (even though
they pass in all other systems) because the tests appear to be running
on the assumption of a JVM 1.3 whereas compilation was specified to be
to 5.0.  I guess there must be an execution level button I am failing to
find that is causing this disparity between compilation and execution.
The project settings is language level 5.0 which appears to set -source
1.5 but fails to set -target 1.5?
 
On the displays front:

My GTK+ theme specifies panel backgrounds to be a specific colour.  Most
of the IntelliJ IDEA is now obeying this.  However some panels (all ones
with terminal output or code display/editing I think) are still white --
which looks fairly hideous in this theme.  I am guessing that this is a
deep PLAF error in the IntelliJ IDEA code (so I guess I should submit a
bug report), but I worry that I am just missing something.  My
justification for this being an error is that this white background
issue doesn't happen with Eclipse or NetBeans.  My worry that it isn't
is that I am very new to IntelliJ IDEA and don't know it well enough.

Thanks.

--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077


signature.asc (196 bytes) Download Attachment

Re: Questions about IntelliJ IDEA

by Clifton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Russel,

Let me see if I understand. I believe the runtime is controlled by the dependencies tab. There you can set any JDK you need. I had similar problems getting JUnit around my J2ME code. Add or configure your module JDK for runtime on the dependencies tab and it should be picked up by the compiler and test runner. I believe it is there where the old Groovy plugin (I'm not as familiar with the newer JetGroovy plugin) controlled the excution environment. You can change the order of Classpath entries here as well. One other point of customization that might throw you is the "edit run config" dialog. You can actually set any unit test to assume the runtime of any other module in your project. This can cause symptoms similar to what you're seeing. Be careful to make sure the "Use classpath and JDK of Module" dropdown is set to the correct module prior to running.

I follow the practice of iterating with the test runner in the IDE then finally verifying my code under the Maven surefire plugin before committing. If the build fails then the code is wrong. I've had several instances (in both Idea and Eclipse) where things get out of synch which is why it pays to have the absolute tightest build system integration. When I get into trouble like what you're seeing I tend to ignore the failures in the IDE and instead rely on the build until the IDE annoys me enough to sort out the breakdown. Regarding Idea, it may take a little while to get used to but if you hate the mouse and love Java it's indispensable. You can literally write your entire project using hotkeys and intention actions. I believe its code insight, static analysis, and Intellisense are better than all other IDEs. That said it does have its own issues as does every other editor under the sun. Idea's Maven support could be a little better, it's missing an external cmd option as a pre-execute step, and the UI isn't as nice as Eclipse. Netbeans suck at refactoring. Eclipse is too inconsistant, too piggy, too complicated for some simple use cases. (Eg. why do we need a dialog popup with each refactoring action?) Lately I've been getting really comfortable with TextMate on Mac. Groovy support there is nice and the editor is simple. I wouldn't use it yet for any huge enterprise type projects but we'll see what happens after I get more acclimated.
Russel Winder-4 wrote:
I have found that there seems to be some issues between compilation and
unit test execution in IntelliJ IDEA, and this must be me just missing
something.  Hopefully something very simple.

I pointed IntelliJ IDEA at my standard installation of Groovy (its a
build of Subversion HEAD of yesterday sometime, so Groovy 1.6)  I then
added Groovy 1.5.6 from my Maven repository as the version of Groovy to
compile against.  This all led to successful compilation for both Main
and Test.  However when I tried to run the tests I always get a problem
of CallSite not being found.  This implies that the IntelliJ IDEA
compiler is using only the jars specified, but the runtime is using the
Groovy plugin installation jar prior to the specified jars.  I can sort
of see how this can be but isn't this an error?  If I replace the
compilation jars with the ones from the Groovy installation then
compilation and execution of unit tests proceeds as expected.

Unfortuantely most of the unit tests fail in IntelliJ IDEA (even though
they pass in all other systems) because the tests appear to be running
on the assumption of a JVM 1.3 whereas compilation was specified to be
to 5.0.  I guess there must be an execution level button I am failing to
find that is causing this disparity between compilation and execution.
The project settings is language level 5.0 which appears to set -source
1.5 but fails to set -target 1.5?
 
On the displays front:

My GTK+ theme specifies panel backgrounds to be a specific colour.  Most
of the IntelliJ IDEA is now obeying this.  However some panels (all ones
with terminal output or code display/editing I think) are still white --
which looks fairly hideous in this theme.  I am guessing that this is a
deep PLAF error in the IntelliJ IDEA code (so I guess I should submit a
bug report), but I worry that I am just missing something.  My
justification for this being an error is that this white background
issue doesn't happen with Eclipse or NetBeans.  My worry that it isn't
is that I am very new to IntelliJ IDEA and don't know it well enough.

Thanks.

--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077

 
LightInTheBox - Buy quality products at wholesale price