Eclipse and tests

8 views
Skip to first unread message

Russel Winder

unread,
Oct 27, 2005, 9:46:12 AM10/27/05
to TestNG Users
So far, I haven't really got into suite specification using XML files, I
tend to just run all the tests always using a classfileset in the
build.xml and run with Ant. Looking for the first time at Eclipse and
the plugin, there doesn't seen to be an equivalent of the Ant technique.
The plugin seems to require a suite XML file to run more than one class
file as a test. Is this right or have I just missed something?

--
Russel.
====================================================
Dr Russel Winder +44 20 7585 2200
41 Buckmaster Road +44 7770 465 077
London SW11 1EN, UK rus...@russel.org.uk
signature.asc

Cédric Beust ♔

unread,
Oct 27, 2005, 10:52:52 AM10/27/05
to testng...@googlegroups.com
On 10/27/05, Russel Winder <rus...@russel.org.uk> wrote:
So far, I haven't really got into suite specification using XML files, I
tend to just run all the tests always using a classfileset in the
build.xml and run with Ant.  Looking for the first time at Eclipse and
the plugin, there doesn't seen to be an equivalent of the Ant technique.
The plugin seems to require a suite XML file to run more than one class
file as a test.  Is this right or have I just missed something?

No, you are correct.   It was a matter of keeping the launch dialog as simple as possible, which is why it only covers launching

- A method
- A class
- A group
- A testng.xml

That's already a lot of cases :-)

How would you envision being able to specify a set of classes with Eclipse?

--
Cédric

Russel Winder

unread,
Oct 27, 2005, 12:05:01 PM10/27/05
to testng...@googlegroups.com
On Thu, 2005-10-27 at 07:52 -0700, Cédric Beust ♔ wrote:
>
> No, you are correct. It was a matter of keeping the launch dialog as
> simple as possible, which is why it only covers launching
>
> - A method
> - A class
> - A group
> - A testng.xml
>
> That's already a lot of cases :-)

Indeed. This is not a problem really I just wanted to make sure I
hadn't missed something.

> How would you envision being able to specify a set of classes with
> Eclipse?

Not sure really and I hesitate to suggest anything as I am new to
Eclipse (other than writing some J2ME programs) and really don't know
anything about Eclipse plug-ins.

I used the classfileset as it seemed the easiest way of using globbing
to specify files. I think in XML files you actually have to list them
all or ensure all the tests are in the same package and name it.
Perhaps it might be possible to reflect this in the plug-in, i.e.
specifying a list of classes or a package name.
signature.asc

Alexandru Popescu

unread,
Oct 28, 2005, 4:14:35 AM10/28/05
to testng...@googlegroups.com
#: Cédric Beust ♔ changed the world a bit at a time by saying on 10/27/2005 4:52 PM :#
I would say that Cedric is half wrong :-). There is a way to run multiple classes on the same
package: right click at a package level and than Run As -> TestNG test.

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


Russel Winder

unread,
Oct 28, 2005, 11:25:03 AM10/28/05
to testng...@googlegroups.com
On Fri, 2005-10-28 at 10:14 +0200, Alexandru Popescu wrote:

> I would say that Cedric is half wrong :-). There is a way to run multiple classes on the same
> package: right click at a package level and than Run As -> TestNG test.

Cool. Well almost. All my tests are in the default package some in
directory X and some in subdirectory X/Y. These get shown separately by
Eclipse (which is fine). If I do what you suggest on either I get:

Exception in thread "main" org.testng.TestNGException:
Cannot find class in classpath: .TestRecord
at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:44)
at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:77)
at org.testng.TestRunner.initMethods(TestRunner.java:256)
at org.testng.TestRunner.init(TestRunner.java:192)
at org.testng.TestRunner.init(TestRunner.java:164)
at org.testng.TestRunner.<init>(TestRunner.java:120)
at org.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:81)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:356)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:160)
at org.testng.SuiteRunner.run(SuiteRunner.java:126)
at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)

which seems to indicate an errant full stop (.). The code compiles fine
in Eclipse so I think all the build paths and build classpaths are
right.
signature.asc

Alexandru Popescu

unread,
Oct 28, 2005, 12:42:49 PM10/28/05
to testng...@googlegroups.com
#: Russel Winder changed the world a bit at a time by saying on 10/28/2005 5:25 PM :#
> On Fri, 2005-10-28 at 10:14 +0200, Alexandru Popescu wrote:
>
>> I would say that Cedric is half wrong :-). There is a way to run multiple classes on the same
>> package: right click at a package level and than Run As -> TestNG test.
>
> Cool. Well almost. All my tests are in the default package some in
> directory X and some in subdirectory X/Y. These get shown separately by
> Eclipse (which is fine). If I do what you suggest on either I get:
>
> Exception in thread "main" org.testng.TestNGException:
> Cannot find class in classpath: .TestRecord
> at org.testng.xml.XmlClass.getSupportClass(XmlClass.java:44)
> at org.testng.internal.Utils.xmlClassesToClasses(Utils.java:77)
> at org.testng.TestRunner.initMethods(TestRunner.java:256)
> at org.testng.TestRunner.init(TestRunner.java:192)
> at org.testng.TestRunner.init(TestRunner.java:164)
> at org.testng.TestRunner.<init>(TestRunner.java:120)
> at org.testng.eclipse.runner.RemoteTestNG$2.newTestRunner(RemoteTestNG.java:81)
> at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:356)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:160)
> at org.testng.SuiteRunner.run(SuiteRunner.java:126)
> at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:99)
> at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
>
> which seems to indicate an errant full stop (.). The code compiles fine
> in Eclipse so I think all the build paths and build classpaths are
> right.

Looks like a bug. Never tested it with default packages. Gonna try it and fix it soon.
Reply all
Reply to author
Forward
0 new messages