newbie question

6 views
Skip to first unread message

J F K

unread,
Jun 27, 2006, 2:39:52 PM6/27/06
to testng...@googlegroups.com
In current release, the testNG will stop running if there was a Junit test case class not found.

I am thinking Is it possible for testNG to take care of building the Junit test cases, and if there was some compiling error for one test case, it will record that error message and switch to next one ?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=35674&messageID=69813#69813

Alexandru Popescu

unread,
Jun 27, 2006, 2:44:49 PM6/27/06
to testng...@googlegroups.com
Hi!

I am not sure I am understanding exactly your question. TestNG is not
compiling Java sources, and it using the information you gave him to
run your tests. If you are telling TestNG to run tests in the class A
and TestNG is not able to load that class than it is normal to signal
you this problem.

hth,

./alex
--
.w( the_mindstorm )p.

J F K

unread,
Jun 27, 2006, 3:34:40 PM6/27/06
to testng...@googlegroups.com
Well, I agree what you said, but in the real world, people may look for something extra.

I am working on a project which is at very early stage, all the developers are creating object classes and junit test cases. And there is one person, which is me, has some extra job, which is to run ALL the junit test cases to make sure these junit test cases working. There are about 3,000+ test classes.

As you can see from time to time, I have to make sure that ALL new test classes are built before I start this testNG command, otherwise this command will just stop. So my expectation is :
1. Once testNG finds one test case class is not available, it builds the class. ( that may be too much for it )
2. OR it finds one test case class is not available, it saves the "class not available " info in this testcase.html and goes to the next test case.

In that way, I may run this testNG command TWICE, and gets all the "FINAL" test results.


---------------------------------------------------------------------
Posted via Jive Forums

http://forums.opensymphony.com/thread.jspa?threadID=35674&messageID=69832#69832

Alexandru Popescu

unread,
Jun 27, 2006, 3:41:41 PM6/27/06
to testng...@googlegroups.com
On 6/27/06, J F K <testng...@opensymphony.com> wrote:
>
> Well, I agree what you said, but in the real world, people may look for something extra.
>
> I am working on a project which is at very early stage, all the developers are creating object classes and junit test cases. And there is one person, which is me, has some extra job, which is to run ALL the junit test cases to make sure these junit test cases working. There are about 3,000+ test classes.
>
> As you can see from time to time, I have to make sure that ALL new test classes are built before I start this testNG command, otherwise this command will just stop. So my expectation is :
> 1. Once testNG finds one test case class is not available, it builds the class. ( that may be too much for it )

TestNG will never do this. TestNG will never become a java compiler;
not even trigger a compilation.

> 2. OR it finds one test case class is not available, it saves the "class not available " info in this testcase.html and goes to the next test case.
>

It is a very serious problem you have manually specified a test class
and it is not found. And you don't really want to continue, because it
may result in a completely screwed test suite.
(say your missing class is the one that rollback your database tests,
if we just continue than you will have a screwed database).

IMO TestNG is behaving correctly and we don't intend to change this
behavior without very solid arguments. Once you included the class it
is your responsibility to make sure it is available or not.

./alex
--
.w( the_mindstorm )p.

Cédric Beust ♔

unread,
Jun 27, 2006, 3:47:35 PM6/27/06
to testng...@googlegroups.com
Hi J,

As you suspect, it's definitely not TestNG's role to compile a class if it's not there.

As for skipping a test when a class cannot be found, I am having a few difficulties getting rid of the suspicion that it's a very dangerous thing to do.

Instead of opting in all 6000 tests regardless of which ones were built, why not only opt in classes that were compiled?

And please don't get me wrong, I'm not one of these fanatics who says "all your tests should always pass" (let alone compile).  I understand that the real world sometimes forces you to do some ugly thing to your testing activity, but don't you think it would be reasonable to ask from someone who causes a source file to stop compiling to either not do that, or at least to comment out the class in testng.xml?

--
Cedric


On 6/27/06, J F K <testng...@opensymphony.com> wrote:
Reply all
Reply to author
Forward
0 new messages