Doesn't TeamCity support JUnit 4? I just added a test case that doesn't extend TestCase and TeamCity tells me there are no tests found in my class.
TeamCity's build agent uses junit-3.8.1 (it's jar is located at buildAgent/plugins/ant/lib directory). You can try to replace it with junit-4.jar, I think this should solve the problem.
Hope this helps, KIR
-- Kirill Maximov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
Do you mean put junit-4.1.jar in the same directory or remove junit-3.8.1.jar and put junit-4.1.jar or rename junit-4.1.jar as junit-3.8.1.jar or ... ? R
Do you mean put junit-4.1.jar in the same directory or remove junit-3.8.1.jar and put junit-4.1.jar or rename junit-4.1.jar as junit-3.8.1.jar or ... ?
I mean remove junit-3.8.1.jar and add junit-4.1.jar. No need to rename.
R
-- Kirill Maximov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
Unfortunately it doesn't work because it seems the old test runner is being used which doesn't understand pure 4.1 tests. I keep getting "No tests found". I've filed a bug: http://www.jetbrains.net/jira/browse/TW-1007
Unfortunately it doesn't work because it seems the old test runner is being used which doesn't understand pure 4.1 tests. I keep getting "No tests found". I've filed a bug: http://www.jetbrains.net/jira/browse/TW-1007
How do you run your tests from Ant? In fact, default junit task in ant cannot find JUnit4 tests.
It looks like Ant's JUnit runner cannot recognize JUnit4 tests.
KIR
-- Kirill Maximov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
I'm using Idea to run my tests locally and the lpr runner (not ant) on the server. I suppose it doesn't work because you do a .lpr->ant file conversion behind the scenes. R
I'm using Idea to run my tests locally and the lpr runner (not ant) on the server. I suppose it doesn't work because you do a .lpr->ant file conversion behind the scenes.
Well, you're right here. There is such conversion. Looks like we have to write a JUnit4 ant runner :-o
We'll consider whan can be done here. Thanks for the report.
Kind regards, KIR
-- Kirill Maximov Software Developer JetBrains, Inc. http://www.jetbrains.com "Develop with pleasure!"
If you don't want to mess about with the bundled ant, you can switch to ant 1.7 on a per build configuration basis - just install ant 1.7 to some other directory and then set the Ant Home field on the build config to point to this install.
We do this and can run both Junit 3 & 4 unit tests.
This also means you don't have to keep changing the bundled ant everytime a new version of TC is released.
Robert Gibson wrote:
TeamCity's build agent uses junit-3.8.1 (it's jar is located at
buildAgent/plugins/ant/lib directory). You can try to replace it with junit-4.jar,
I think this should solve the problem.
Hope this helps,
KIR
--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Do you mean put junit-4.1.jar in the same directory or remove
junit-3.8.1.jar and put junit-4.1.jar or rename junit-4.1.jar as
junit-3.8.1.jar or ... ?
R
Robert Gibson wrote:
I mean remove junit-3.8.1.jar and add junit-4.1.jar. No need to rename.
--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Unfortunately it doesn't work because it seems the old test runner is
being used which doesn't understand pure 4.1 tests. I keep getting "No
tests found". I've filed a bug: http://www.jetbrains.net/jira/browse/TW-1007
Thanks,
R
Robert Gibson wrote:
How do you run your tests from Ant? In fact, default junit task in ant cannot
find JUnit4 tests.
It looks like Ant's JUnit runner cannot recognize JUnit4 tests.
KIR
--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
I'm using Idea to run my tests locally and the lpr runner (not ant) on
the server. I suppose it doesn't work because you do a .lpr->ant file
conversion behind the scenes.
R
Robert Gibson wrote:
Well, you're right here. There is such conversion.
Looks like we have to write a JUnit4 ant runner :-o
We'll consider whan can be done here. Thanks for the report.
Kind regards,
KIR
--
Kirill Maximov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"
Kirill Maximov (JetBrains) wrote:
That's pretty obvious from the ugly output :-/
http://www.jetbrains.net/jira/browse/TW-1019
The 1.7 beta Ant ]]> task available from CVS can handle both JUnit
3.8.x and JUnit 4.0 tests.
R
Is there a temporary workaround for this? All our tests are JUnit4, and this limitation really prevents us from using TeamCity effectively.
Jon Nichols wrote:
Yes, there is a workaround. Check out
http://www.jetbrains.net/jira/browse/TW-1007
--
Alexey Gopachenko
JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
If you don't want to mess about with the bundled ant, you can switch to ant 1.7 on a per build configuration basis - just install ant 1.7 to some other directory and then set the Ant Home field on the build config to point to this install.
We do this and can run both Junit 3 & 4 unit tests.
This also means you don't have to keep changing the bundled ant everytime a new version of TC is released.