13 comments

Yeah, I have. Actually, I was using it with the last build, not realizing
it hadn't been "officially" made a feature yet. Works fine so far.

Hello Anders,

Has anyone tried using JUnit 4.0 with any versions of IDEA yet?



0

Good to hear.

Did you replace the junit.jar in IDEA_HOME/lib with the 4.0 version, or just use the 4.0 jar in your project?

0

I usually add junit.jar to my project. And as I read in IDEA in Action, JUnit is included in IDEA but you must add it to prject by hand.

0

Hello Anders,

This may be useful:
http://blogs.jetbrains.com/idea/2006/03/running-junit-4-tests-in-intellij-idea-51/

Best regards,
Alexandra Rusina
-


JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

Has anyone tried using JUnit 4.0 with any versions of IDEA yet?



0

Hello Alexandra,

This may be useful:

Not quite :)
We've just released EAP build with JUnit 4 support.

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


0

Yeah, what he said. Just added Junit 4 jar to my project. Didn't touch
idea's libs.

Hello Anders,

Good to hear.

Did you replace the junit.jar in IDEA_HOME/lib with the 4.0 version,
or just use the 4.0 jar in your project?



0

Did find one glitch though. I had a @Before and @After method, both of which
were static. When I ran the class, the run tab console would show "process
finished with exit code 0", but it hadn't actually run the tests yet. The
test icons in the tree to the left are all yellow, and the statistics table
just shows ]]> for everything.

Making the before and after methods not static fixed it.

Hello Anders,

Has anyone tried using JUnit 4.0 with any versions of IDEA yet?



0

Great -- thanks for all the input.

0

This problem also occurs if you forget to make @BeforeClass or @AfterClass methods NOT static.

0

As near as I can tell from the docs, @Before and @After methods need to be non-static, while @BeforeClass and @AfterClass methods need to be static, and all of them need to be public void. I'm updating the various IG JUnit inspections to cover 4.0, and I'll certainly add these restrictions.

One thing I would like, however, is a bit of polish on handling the @Ignore annotation. Currently, any test marked @Ignore is ignored. That's all fine and correct, but it would be better if the @Ignore annotation was itself ignored, if I choose to run a single test method (by doing Ctrl-Shift-F10 in the method body, for instance). This fits the use case of marking a failing test case as @Ignore until you get a chance to work on it, and simply seems nicer. Not a big deal, though.

--Dave Griffith

0

Quote from Anders's post

;)

0

Alexandra Rusina (JetBrains) wrote on 07/04/06 20:23:

This may be useful:
http://blogs.jetbrains.com/idea/2006/03/running-junit-4-tests-in-intellij-idea-51/


Whilst theres all this work on JUnit 4 support - can someone help out us
TestNG folks and allow me to build TestNG for Demetra.

A recent change to the OpenAPI is conflicting with the JUnit plugin (who
we're, erm, "borrowing" some classes from - these would REALLLLLLLY be
helpful to move to the real OpenAPI as well).

I've entered the details at:

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

Basically - the RuntimeConfiguration.clone() method returns a
RuntimeConfiguration whilst ModuleBasedConfiguration.clone() returns
Object and gives conflicts when using a subclass of
ModuleBasedConfiguration.

Hopefully this can get worked out for the next EAP then I can give folks
a TestNG update :)

0

Fixed

--
regards,
--
Alexey Kudravtsev
Software Developer
JetBrains, Inc, http://www.jetbrains.com
"Develop with pleasure!"

"Andrew Timberlake" <andrew@andrewtimberlake.com> wrote in message
news:14845735.1144510295148.JavaMail.itn@is.intellij.net...

This problem also occurs if you forget to make @BeforeClass or @AfterClass
methods NOT static.



0

Please sign in to leave a comment.