|
|
|
Re: TestSuite execution problem [message #527420 is a reply to message #527217] |
Thu, 15 April 2010 04:35   |
Eclipse User |
|
|
|
Pascal G wrote on Wed, 14 April 2010 09:55 | Urtzi Odriozola wrote:
> Hi!
>
> I've got a little problem with SWTBot test execution when I wanna
> execute more than one test cases. For that purpose I use a test runner
> given by Ketan:
>
> http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.eclipse.finder.test/src/org/eclipse/swtbot/eclipse/finder/ AllTests.java
>
>
> The point is that I wanna run each TestCase in a clear enviroment
> (workbench) for not being in conflict each individual TestCase with the
> others...
>
> Anyone knows how to run all the TestCases but each one in a clean
> workbench environment?
>
> Thank in advance.
>
> Regards,
> Urtzi
It depends on what you mean by clean workbench... for me, a clean
workbench is one with the proper perspective open and the example
project provided by my plugin open. It strongly depends on your test cases.
To achieve a "clean workbench", simply make sure that every test case
has a proper tearDown() (or @After annotated if you are using JUnit4)
that clean up the mess that the test case just made. Let's take an
example: you have a test case that create a new java project using the
new java project wizard. The tearDown() method should close the wizard
if it's still open (because an error happened and the test case did not
properly finish) and delete the created project. This way, you are back
to the same state you were at the beginning of your test.
Hope this helps.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
Ok, I understand. And yes, definitely you catch out my idea of "clean workbench".
I thought that there was a simpler way of clean up the mess of my TestCases. I think that doing like you said, you do much effort because you have to write a test 2 times (the second one backwards...).
For example, when I run my tests individually, each test starts in a fresh workbench even if they messed the configuration before. But if I run all my test like I explained above, this not happens.
Thank you for your contribution!
|
|
|
Re: TestSuite execution problem [message #527499 is a reply to message #527420] |
Thu, 15 April 2010 09:13  |
Eclipse User |
|
|
|
Urtzi Odriozola wrote:
> I thought that there was a simpler way of clean up the mess of my
> TestCases. I think that doing like you said, you do much effort because
> you have to write a test 2 times (the second one backwards...).
>
That's unit testing for you :P It's not a SWTBot-only problem: every
test cases that modify some kind of persistent state (the UI, a
database, the filesystem) must clean it up afterwards.
It would definitely be better with a simpler way, but it would be kinda
hard to guess what to do to clean up the workbench. Each test case is
unique, so each clean up is unique
My two cents.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
|
|
|
Powered by
FUDForum. Page generated in 0.05225 seconds