Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Ensuring preconditions before SWTBot test run
Ensuring preconditions before SWTBot test run [message #639806] Wed, 17 November 2010 16:24 Go to next message
Phil  is currently offline Phil
Messages: 2
Registered: November 2010
Junior Member
Hi all,

I've got a simple RCP application that has a view with a tree on it. The tree is populated on load from the database. When I run a SWTBot test, I'd like to ensure that the database is emptied and filled with test data before the test is run, so that the tree is populated with known data and my test runs are consistent.

Is there a way to do this?

I've already tried running my database clean/test data code in an @BeforeClass annotated method but it seems that when my SWTBot test runs, the application has already started and the tree is already populated, so my database code has effect.
Re: Ensuring preconditions before SWTBot test run [message #640312 is a reply to message #639806] Sat, 20 November 2010 05:19 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
This is currently not supported. SWTBot tests run after the workbench is
loaded.

You may try putting your test data and 'refreshing' your tree view
before every test as a workaround.

--
Ketan
ketan.padegaonkar.name | eclipse.org/swtbot | @ketanpkr

On 11/18/10 2:54 AM, Phil wrote:
> Hi all,
>
> I've got a simple RCP application that has a view with a tree on it. The
> tree is populated on load from the database. When I run a SWTBot test,
> I'd like to ensure that the database is emptied and filled with test
> data before the test is run, so that the tree is populated with known
> data and my test runs are consistent.
>
> Is there a way to do this?
>
> I've already tried running my database clean/test data code in an
> @BeforeClass annotated method but it seems that when my SWTBot test
> runs, the application has already started and the tree is already
> populated, so my database code has effect.
Re: Ensuring preconditions before SWTBot test run [message #640460 is a reply to message #640312] Mon, 22 November 2010 03:37 Go to previous message
Phil  is currently offline Phil
Messages: 2
Registered: November 2010
Junior Member
Thanks for getting back to me Ketan, I thought this might be the case.
Previous Topic:Running Another Java Class Main method from SWTBot Test
Next Topic:[GEF] Mouse Events should be triggered on FigureCanvas
Goto Forum:
  


Current Time: Tue Jul 22 03:22:42 EDT 2014

Powered by FUDForum. Page generated in 0.06015 seconds