Run unit tests without building wars, ears, etc?

Hi all,

Short question: when I run my unit tests, IntelliJ starts to build all kind of artifacts, like wars, ears, etc. How can I prevent this from happening? It's very time consuming, and even happens when no changes have been made to the class files (like running a different test in a unit test)

Thanks,

Erik

Btw, I tried turning off 'Make', but than it doesn't even compile anymore. That's not what I'm looking for.

7 comments
Comment actions Permalink

Hello Erik,

Hi all,

Short question: when I run my unit tests, IntelliJ starts to build all
kind of artifacts, like wars, ears, etc. How can I prevent this from
happening? It's very time consuming, and even happens when no changes
have been made to the class files (like running a different test in a
unit test)


Probably your test run configuration has Before launch / Make option = On.
You can set it Off.

Another story is that when nothing is modified under your source roots, Make
should just output "All files are up-to-date" and do nothing more. For me
it does so. E.g. I have one web facet with the option to generate a .war
and include compiled classes. When java files are up-to-date, make does not
repack the .war. Is it different for you with similar project layout?

Alexander.


0
Comment actions Permalink

Hi Alexander,

Like I mentioned in my previous post, I have Make option turned on. When I turn it off, my classes do not get compiled. The annoyance is that when I change something in my production code, IntelliJ will regenerate all my war's, ears, etc, copy all my dependencies, resources, etc, which just takes a long time! I'd like to make a code change, run a unit test, and continue. Now it's run a unit test, wait untill all the wars etc have been created (which can take somewhere between 15 seconds and a minute), and continue. When all my Java files are up to date, this doesn't happen, but why should I run my unit tests if I didn't change anything, and why should I want a .war file when I'm only running the tests?

I'd like to have a split between 'make' and 'compile', so that when I run my tests, my code gets compiled, but my project isn't 'maked/made'. This would save me really a lot of time!

0
Comment actions Permalink

On Mon, 01 Sep 2008 13:06:03 +0200, Erik Pragt <no_reply@jetbrains.com>
wrote:

Hi Alexander,

>

Like I mentioned in my previous post, I have Make option turned on. When
I turn it off, my classes do not get compiled. The annoyance is that
when I change something in my production code, IntelliJ will regenerate
all my war's, ears, etc, copy all my dependencies, resources, etc, which
just takes a long time! I'd like to make a code change, run a unit test,
and continue. Now it's run a unit test, wait untill all the wars etc
have been created (which can take somewhere between 15 seconds and a
minute), and continue. When all my Java files are up to date, this
doesn't happen, but why should I run my unit tests if I didn't change
anything, and why should I want a .war file when I'm only running the
tests?

>

I'd like to have a split between 'make' and 'compile', so that when I
run my tests, my code gets compiled, but my project isn't 'maked/made'.
This would save me really a lot of time!


From facet JavaEE (ear) and Web (war) you can go to Java EE Build Settings
and turn off creation of ear/war.

0
Comment actions Permalink

Hi Ronny,

I thought of that, but I'm using the ears, since I'm running JBoss from within IntelliJ. Without the ears/wars it's not really handy.. And maybe if it would have been one project, I could turn it on/off, but I have more than 30 modules, of which 3 ears and 5 wars + 5 EJB packages, and I'm not going to turn each of them on/off during each test run! I'm just suprised that there seems to be no easy way to toggle them off. I'm also surprised that IntelliJ creates the war/ears when running Unit tests, but that might be handy for some, I'm not sure. If there's not option to turn it off, I'm creating a JIRA. Jetbrains, any suggestions on this?

0
Comment actions Permalink

On Sun, 07 Sep 2008 22:05:18 +0200, Erik Pragt <no_reply@jetbrains.com>
wrote:

And maybe if it would have been one project, I could turn it on/off, but
I have more than 30 modules, of which 3 ears and 5 wars + 5 EJB
packages, and I'm not going to turn each of them on/off during each test
run! I'm just suprised that there seems to be no easy way to toggle them
off.


There really should be a way to tell IDEA not to create ears/wars during
test runs.
However, in the newest Diana EAP each Facet type now has a "All Facet" tab
where you can turn on and off creation of ears/wars for all Facets of a
given type. That might help you.

0
Comment actions Permalink

Hello Erik,

EP> I'm just suprised that there seems to be no easy way to
EP> toggle them off. I'm also surprised that IntelliJ creates the
EP> war/ears when running Unit tests, but that might be handy for some,
EP> I'm not sure. If there's not option to turn it off, I'm creating a
EP> JIRA. Jetbrains, any suggestions on this?

I'm in the same boat, I have to agree it's annoying and time consuming. I'd
say the war/ear building should be tied to the deployment step, so I'd rather
have that performed only before deploying/running the app server run config.

Maybe "make" should be split in a compile make and an j2ee-make (that would
include the normal make plus j2ee validation and packaging). Then one would
be able to set the first for the unit test run configs (or other non-j2ee
run configs) while the full thing is tied to j2ee run configs.

My 2c,
Andrei

P.S. Please post the jira number here, so we can vote for it.


0
Comment actions Permalink

Hi all,

I just created the jira for it, I was just wondering if I missed something before creating one. You can vote here:

http://www.jetbrains.net/jira/browse/IDEA-19557

0

Please sign in to leave a comment.