Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to junit-test a plug-in
how to junit-test a plug-in [message #50319] Tue, 27 May 2003 18:45 Go to next message
Eclipse UserFriend
Originally posted by: n.czempin.printcom.deutschepost.de

I am trying to unit-test the ui part of a plug-in that I\'m developing.

I have taken the following steps:
1. Downloaded the Eclipse source \"eclipse-SDK-2.1-win32.zip\"
2. Downloaded the junit tests for Eclipse
\"eclipse-junit-tests-I20030327.zip\"
3. Followed the document
\" http://download2.eclipse.org/downloads/drops/R-2.1-200303272 130/automatedtesting.html\"
and successfully managed to unit-test Eclipse.
4. Followed the document
\" http://download2.eclipse.org/downloads/drops/R-2.1-200303272 130/testframework.html\"
but cannot get any of my ui tests to work.

I have finally got to the point where ant launches a test-eclipse, but I
get the error message:

<failure message=\"No tests found in
de.printcom.gui.aps.tests.AllTests\"
type=\"junit.framework.AssertionFailedError\">junit.framework.AssertionFailedError:
No tests found in de.printcom.gui.aps.tests.AllTests
at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.jav a:313)
[...]

I have tried the following:
a) Creating a class that statically returns a TestSuite (which has
TestCases added),
b) Deriving a class from TestSuite (and adding TestCases in the
constructor) in a similar fashion as some of the Eclipse tests,
c) Deriving AllTests.java from TestCase.

I can successfully run Junit for non-plugin classes, but for e. g.
MYPerspective I need to launch another Eclipse.

With the same setup, I can get the Eclipse tests to run.

I have triple-checked plug-in dependencies and the .class files in the
test-plug-in jar.

I can provide details of or complete xml files, etc., if it helps you help
me.

What am I doing wrong?
Re: how to junit-test a plug-in [message #50459 is a reply to message #50319] Tue, 27 May 2003 19:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: chaves.inf.ufsc.br.nospam

You should not need to run the Eclipse tests if you are not
changing/replacing any Eclipse plug-in implementation.

To run plug-in unit tests, an excelent tool is the PDE JUnit plug-in,
available in the JDT/UI page:

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt- ui-home/plugins/org.eclipse.jdt.junit/index.html

Just install the right version of the plug-in (unpack it in your plugins
directory) and re-run Eclipse. There will be a new launch configuration
type called "JUnit Plug-in Test". It is similar to the "Run-time
Workbench" launch configuration (in a sense that it starts a new instance
of Eclipse) dedicated to JUnit.

Just create a launch configuration for your test case (headless or UI
mode), run it and voilá...

HTH

Rafael
Re: how to junit-test a plug-in [message #50515 is a reply to message #50459] Tue, 27 May 2003 19:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: n.czempin.printcom.deutschepost.de

Wow, works like charm, thanks for your help!

I actually found this independently just before you sent your message, by
going through the deprecated tools newsgroup and discovering this:
http://groups.yahoo.com/group/contributingtoeclipse/files
and the current version, 030410.pdf

I didn't run the Eclipse tests to change any Eclipse plug-ins, but via the
regular Eclipse.org documentation, I found nothing else.
Also, I wanted to look at some code to see how other people did their UI
tests, and what better place to look than Eclipse itself? It's also a lot
of fun to watch Eclipse steer itself with dummy projects etc :-)
Also, I may later have to strip down the platform somewhat, and I can't
wait for 3.0 for that, so I'll need some tests for anything I change in my
version.

Again, thanks for your help.

I am still somewhat uneasy about the fact that the other method didn't
work, but since I can do what I want now, I guess, I'll ignore that :-)

chaves@inf.ufsc.br.nospam wrote:

> You should not need to run the Eclipse tests if you are not
> changing/replacing any Eclipse plug-in implementation.

> To run plug-in unit tests, an excelent tool is the PDE JUnit plug-in,
> available in the JDT/UI page:

>
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/jdt- ui-home/plugins/org.eclipse.jdt.junit/index.html

> Just install the right version of the plug-in (unpack it in your plugins
> directory) and re-run Eclipse. There will be a new launch configuration
> type called "JUnit Plug-in Test". It is similar to the "Run-time
> Workbench" launch configuration (in a sense that it starts a new instance
> of Eclipse) dedicated to JUnit.

> Just create a launch configuration for your test case (headless or UI
> mode), run it and voilá...

> HTH

> Rafael
Re: how to junit-test a plug-in [message #51634 is a reply to message #50515] Wed, 28 May 2003 12:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: boris.litvak.lycos.com

Hi Nicolai,

As far as I remember from PDE Junit source, the main difference is that it
needs to build the plugin registry and do some other Eclipse platform
related things.
I.e, roughly said, when PDE Junit is launched, it launches Eclipse.
Junit itself cannot do it.

If anybody knows/thinks I'm wrong/right, please respond.

Developer.
Re: how to junit-test a plug-in [message #54809 is a reply to message #50515] Thu, 29 May 2003 19:32 Go to previous messageGo to next message
Tom Roche is currently offline Tom RocheFriend
Messages: 160
Registered: July 2009
Senior Member
Nicolai CZempin wrote:
> Also, I wanted to look at some code to see how other people did
> their UI tests, and what better place to look than Eclipse itself?

Since you've looked at this recently, could you answer a question:
what/how much UI testing is being done currently?

The last time I looked at their automated tests (~Dec 02), the only
"UI testing" I saw did not involve _interaction with_ the UI. E.g. a
test could programmatically create a project, and one could then see
appropriate changes in the UI, but there was no clicking or typing in
the UI. (In case that request seems nonsensical to you, note that
blackbox testing of SWT (as well as AWT) UIs can be done using RobotJ,
and whitebox testing of AWT UIs can be done with several open-source
tools. See

http://www.superlinksoftware.com/cgi-bin/jugwiki.pl?TestingG UIs

) Furthermore I remember reading (but I saved no links <sigh/>)
test scenarios that indicated that "real" UI testing (i.e. involving
interaction with the UI, not just watching it draw in response to
programmatic changes) was done manually.

Has any of the above changed? If so, I'd appreciate any examples you
might have noticed.

Something you already know, but I'll put in this post anyway (for the
benefit of searchers/lurkers): one can (currently) find information
regarding Eclipse's automated tests by

* choose a build or drop from

http://download.eclipse.org/downloads/

* scroll/search to "JUnit Plugin Tests and Automated Testing
Framework" for downloads and install/use info. Alternately, just
append automatedtesting.html to the drop directory, e.g.

http://download.eclipse.org/downloads/drops/R-2.1-2003032721 30/automatedtesting.html

for the 2.1 final.
Re: how to junit-test a plug-in [message #55506 is a reply to message #54809] Fri, 30 May 2003 09:49 Go to previous message
Eclipse UserFriend
Originally posted by: nczempin.printcom.deutschepost.de

Tom Roche wrote:

> Nicolai Czempin wrote:
> > Also, I wanted to look at some code to see how other people did
> > their UI tests, and what better place to look than Eclipse itself?

> Since you've looked at this recently, could you answer a question:
> what/how much UI testing is being done currently?

Well, I haven't looked at it in sufficient detail to answer this. And just
by watching the UI tests fly by doesn't help, it goes to quickly to
determine whether there's actually any clicking. I haven't seen any "press
button x" commands, but there are "getViewer().setSelection(x)" type tests.

What I do know is that there are still a bunch of manual tests specified.

To the contrary, it does not seem nonsensical, I have a definite need for
both whitebox and black box testing. Last time I did this, I used
WinRunner and was very satisfied. However, I shall be looking for OSS
alternatives, and RobotJ and Abbot and the likes are definitely on my
to-do list.

For now, I have to stick with downcasting to look at internals (deadline
pressure, WISCY). Once I have satisfied a few management needs, I will
spend some more time to evaluate those tools.

> The last time I looked at their automated tests (~Dec 02), the only
> "UI testing" I saw did not involve _interaction with_ the UI. E.g. a
> test could programmatically create a project, and one could then see
> appropriate changes in the UI, but there was no clicking or typing in
> the UI. (In case that request seems nonsensical to you, note that
> blackbox testing of SWT (as well as AWT) UIs can be done using RobotJ,
> and whitebox testing of AWT UIs can be done with several open-source
> tools. See
Previous Topic:Switching to the right (final) perspective (newWizards)
Next Topic:[ANN] First Release of Input Simplifying Plug-In
Goto Forum:
  


Current Time: Sat Aug 10 07:22:20 GMT 2024

Powered by FUDForum. Page generated in 0.03306 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top