Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Restarting Eclipse under test
Restarting Eclipse under test [message #1064873] Fri, 21 June 2013 09:42 Go to next message
Asgeir Sognefest is currently offline Asgeir Sognefest
Messages: 6
Registered: June 2013
Junior Member
Hi,
I am using SWTBot to install a plug-in, and then restarting Eclipse. After the restart I want to continue testing (if plugin was correctly installed), but the test restarts and the plug-in is not installed anymore.

Is there any way around this? So I can continue testing after restart.

Thanks Smile
Re: Restarting Eclipse under test [message #1065265 is a reply to message #1064873] Tue, 25 June 2013 03:44 Go to previous messageGo to next message
pawan garia is currently offline pawan garia
Messages: 24
Registered: February 2013
Junior Member
Hi Asgeir Sognefest

is it possible in SWTBOT to restart eclipse ???

R u able to do the restart and start..
Re: Restarting Eclipse under test [message #1065420 is a reply to message #1064873] Tue, 25 June 2013 11:51 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael Istria
Messages: 744
Registered: July 2009
Location: Grenoble, France
Senior Member
As SWTBot starts inside Eclipse, it's not possible to have a test which
deals with the "Restart" process. When you restart, Eclipse stops, then
your SWTBot launcher stops, and Eclipse restart in its vanilla form,
without your SWTBot test being started.
What you can try instead of a restart is to separate your test suite in
2 pieces: one before restart and one after. You run your "before
restart" suite normally. When it ends, the uitestapplication will close
Eclipse, and then you run your "after restart" suite using the
uitestapplication again.

HTH
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Re: Restarting Eclipse under test [message #1066401 is a reply to message #1065420] Tue, 02 July 2013 08:53 Go to previous messageGo to next message
Asgeir Sognefest is currently offline Asgeir Sognefest
Messages: 6
Registered: June 2013
Junior Member
Okay, I see.

Thanks Smile
Re: Restarting Eclipse under test [message #1069654 is a reply to message #1064873] Tue, 16 July 2013 06:09 Go to previous messageGo to next message
pawan garia is currently offline pawan garia
Messages: 24
Registered: February 2013
Junior Member
Hi Mickael,
I tried Using the Restart Functionality With SWTBOT in my Product and Found Some thing unusual, Following is My Test. So Every Time i Run this class File Swtbot is Running the Fist TestCase and Restart Eclipse and Start the Same Testcase again and Again...
It is Not Running the Second TestCase.

@Test
public void opennewSchedule() throws Exception
{
SWTWorkbenchBot bot = new SWTWorkbenchBot();
bot.Click();
bot.menu("File").menu("Restart").click();
}

@Test
public void opennewSchedule2() throws Exception
{
SWTWorkbenchBot bot = new SWTWorkbenchBot();
bot.menu("File").menu("Open").click();

}
Re: Restarting Eclipse under test [message #1069661 is a reply to message #1069654] Tue, 16 July 2013 06:22 Go to previous message
Mickael Istria is currently offline Mickael Istria
Messages: 744
Registered: July 2009
Location: Grenoble, France
Senior Member
On 07/16/2013 12:09 PM, pawan garia wrote:
> Hi Mickael,
> I tried Using the Restart Functionality With SWTBOT in my Product and
> Found Some thing unusual, Following is My Test. So Every Time i Run this
> class File Swtbot is Running the Fist TestCase and Restart Eclipse and
> Start the Same Testcase again and Again... It is Not Running the Second
> TestCase.

The restart functionality cannot be tested with SWTBot because "Restart"
will just restart Eclipse with the exact same options and won't continue
a Test Suite.
If you want to run a sequence of tests separated by restart, this has to
be implemented in the way you run those tests (Tycho Surefire, Bash,
Ant...) to actually run sequentially different test suites.
Just let the test suite run and close by itself, without using Restart.

--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
Previous Topic:Not able to find swtbot plugin
Next Topic:Require-Bundle org.hamcrest
Goto Forum:
  


Current Time: Wed Aug 27 15:23:31 EDT 2014

Powered by FUDForum. Page generated in 0.11902 seconds