Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsStart SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/24583/#msg_24583
I have an Junit Test Case class for to start with SWTBot for Eclipse
Plugins as http://swtbot.sourceforge.net/users-guide.html.
I have developed an UI to get inputs about my test (log path, ...). When I
execute SWTBot Tests (Junit Test Case class), I execute my UI (Java
Application) and when user click a OK button,I want my UI to invoke to my
Junit Test Case(SWTBot Test) with it configuration(Test Runner, Location,
JRE...-->swtbot.sourceforge.net/users-guide.html.).
Is there any snnipet about this?
Thanks and regards
Luis Miguel]]>Luis Miguel2009-02-26T12:00:25-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/24817/#msg_24817
a Java application is to get the .launch of our SWTBot test configuration
and run from Java application.
If we run a SWTBot test, we will have a file .launch in
Name_workspace\.metadata\.plugins\org.eclipse.debug.core\.la unches.
For example, if we run a SWTBot test with name FooTest, we will have
FooTest.launch.(http://swtbot.sourceforge.net/users-guide.html
-->"Executing SWTBot Tests for Eclipse Plugins").
In Java application, we could get this file and run it.
Someone knows how to get this?
Thanks.
Luis Miguel]]>Luis Miguel2009-02-27T11:05:59-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/24850/#msg_24850
Launch capabilities. If you then, it might be easy to create your own
Launcher by extending or using SWTBot launcher. It is really simple and
you can use SWTBot launcher as example. This way you can configure your
own app and swtbot in one place and launch it.
You can also look at
org.eclipse.debug.internal.ui.launchConfigurations.LaunchCon figurationManager
to see if you can get hold of the launch configuration you need. But
first option might be the easiest and most reliable.
Ketan]]>Ketan Patel2009-02-28T00:09:09-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25055/#msg_25055
a Java application is to get the .launch of our SWTBot test configuration
and run from Java application. If we run a SWTBot test, we will have a
file .launch in
Name_workspace\.metadata\.plugins\org.eclipse.debug.core\.la unches.
For example, if we run a SWTBot test with name FooTest, we will have
FooTest.launch.(http://swtbot.sourceforge.net/users-guide.html
-->"Executing SWTBot Tests for Eclipse Plugins").
In Java application, we could get this file and run it.
Someone knows how to get this?
Thanks.
UI is an User Interface. It is possible that my translation is wrong. My
User Interface has inputs text and a button with OK. When we click a 'OK'
button, my User Interface gets the inputs and invoke to SWTBot Test with
these inputs.
User Interface is a Java appliation and code for invoke to SWTBot Test is
in the event button. I have a SWTBot launcher called FooTest.launch in
Name_workspace\.metadata\.plugins\org.eclipse.debug.core\.la unches.\FooTest.launch
but I do not know how Can I launch it from the event button. Have you got
any example?
Meanwhile I will look
org.eclipse.debug.internal.ui.launchConfigurations.LaunchCon figurationManager
Thanks!
Luis Miguel]]>Luis Miguel2009-03-02T08:45:05-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25096/#msg_25096
..launch file ?
Are you writing SWT Test cases or Eclipse plugin test cases? Are you
trying to get the .launch file to execute from within another java
application?
-- Ketan
On 2/3/09 14:15, Luis Miguel wrote:
> I am researching this and I think the best way to run an SWTBot test
> from a Java application is to get the .launch of our SWTBot test
> configuration and run from Java application. If we run a SWTBot test, we
> will have a file .launch in
> Name_workspace\.metadata\.plugins\org.eclipse.debug.core\.la unches.
> For example, if we run a SWTBot test with name FooTest, we will have
> FooTest.launch.(http://swtbot.sourceforge.net/users-guide.html
> -->"Executing SWTBot Tests for Eclipse Plugins").
>
> In Java application, we could get this file and run it.
>
> Someone knows how to get this?
>
> Thanks.
>
> UI is an User Interface. It is possible that my translation is wrong. My
> User Interface has inputs text and a button with OK. When we click a
> 'OK' button, my User Interface gets the inputs and invoke to SWTBot Test
> with these inputs.
>
> User Interface is a Java appliation and code for invoke to SWTBot Test
> is in the event button. I have a SWTBot launcher called FooTest.launch
> in
> Name_workspace\.metadata\.plugins\org.eclipse.debug.core\.la unches.\FooTest.launch
> but I do not know how Can I launch it from the event button. Have you
> got any example?
>
> Meanwhile I will look
> org.eclipse.debug.internal.ui.launchConfigurations.LaunchCon figurationManager
>
>
> Thanks!
>
> Luis Miguel
>
>]]>Ketan Padegaonkar2009-03-02T09:09:30-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25136/#msg_25136
get the .launch file to execute from within another java application (User
Interface with inputs text and button). When I click on java application,
FooTest.launch should be executed.
Luis Miguel]]>Luis Miguel2009-03-02T09:28:03-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25177/#msg_25177
portion of what the launch configuration does already from your java
application.
If you could describe why you're doing this, I'm sure someone could
recommend a better and simpler way for doing this.
-- Ketan
On 2/3/09 14:58, Luis Miguel wrote:
> I am writing Eclipse plugin test cases (FooTest.launch). I am trying to
> get the .launch file to execute from within another java application
> (User Interface with inputs text and button). When I click on java
> application, FooTest.launch should be executed.
> Luis Miguel
>]]>Ketan Padegaonkar2009-03-02T09:34:29-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25217/#msg_25217
What I would do is:
find a command line that will eclipse and automatically launches the
SWTbot eclipse plug in test.
(I'm highly interested in this, but I have not started seraching for it)
might looks like "eclipse -autoLauchConfiguration mylaunchconfigswtbot"
Then your UI would not launch the whole thing from java, it would launch
this command line.
What about the test inputs then? Just write them in a file before throwing
the command line. You Eclipse swtbot test would know which file to read
and therefore find the input.
Hope this helps.
If you ever find the command line, please post it (or I will post it if
I've got the time to look for it) (I hope there is one, I'm not sure)
Bye
Marc]]>Marc2009-03-02T10:57:12-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25258/#msg_25258
The SWTBot tests do something similar. The command line used by SWTBot
for running its own tests is available in [1]. This would however not
work with the way Luis is running the tests.
I'd agree with your point that it's cheaper, easier and more error proof
if the input is read from a file and read by the tests.
On 2/3/09 16:27, Marc wrote:
> Hi,
>
> What I would do is:
>
> find a command line that will eclipse and automatically launches the
> SWTbot eclipse plug in test.
>
> (I'm highly interested in this, but I have not started seraching for it)
> might looks like "eclipse -autoLauchConfiguration mylaunchconfigswtbot"
>
> Then your UI would not launch the whole thing from java, it would launch
> this command line.
> What about the test inputs then? Just write them in a file before
> throwing the command line. You Eclipse swtbot test would know which file
> to read and therefore find the input.
>
> Hope this helps.
> If you ever find the command line, please post it (or I will post it if
> I've got the time to look for it) (I hope there is one, I'm not sure)
>
> Bye
> Marc
>]]>Ketan Padegaonkar2009-03-02T11:15:58-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25298/#msg_25298
On another thought, you'll need to hack into the SWTBot application
launcher[1] so that it takes in the necessary inputs, and recompile[2]
SWTBot sources with your changes.
On 2/3/09 16:45, Ketan Padegaonkar wrote:
> Hi,
>
> The SWTBot tests do something similar. The command line used by SWTBot
> for running its own tests is available in [1]. This would however not
> work with the way Luis is running the tests.
>
> I'd agree with your point that it's cheaper, easier and more error proof
> if the input is read from a file and read by the tests.
>
> [1] -
> http://dev.eclipse.org/svnroot/technology/org.eclipse.swtbot /trunk/org.eclipse.swtbot.eclipse.junit4.headless/library.xm l
>
>
> -- Ketan
>
> On 2/3/09 16:27, Marc wrote:
>> Hi,
>>
>> What I would do is:
>>
>> find a command line that will eclipse and automatically launches the
>> SWTbot eclipse plug in test.
>>
>> (I'm highly interested in this, but I have not started seraching for it)
>> might looks like "eclipse -autoLauchConfiguration mylaunchconfigswtbot"
>>
>> Then your UI would not launch the whole thing from java, it would launch
>> this command line.
>> What about the test inputs then? Just write them in a file before
>> throwing the command line. You Eclipse swtbot test would know which file
>> to read and therefore find the input.
>>
>> Hope this helps.
>> If you ever find the command line, please post it (or I will post it if
>> I've got the time to look for it) (I hope there is one, I'm not sure)
>>
>> Bye
>> Marc
>>
>]]>Ketan Padegaonkar2009-03-02T11:22:26-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25458/#msg_25458
I looked at the script and it seems interesting.
I've never worked with Ant script (sorry if following question seems
newbie ones, I just need to confirm),
first this is an Ant script, isn't it?
And you can call it with command line like ">ant myscript.xml"
It can be used to test Eclipse Plugin, not just SWT app?
If all of this is real, then we could put the ant command in a .bat file
and set its execution at some date by defining a task.
This is very interesting because it is another step into test automation.
At last, maybe Luis could execute this ant command from inside his java
code and get the test executed.
Bye
Marc
Ketan Padegaonkar wrote:
> Hi,
> The SWTBot tests do something similar. The command line used by SWTBot
> for running its own tests is available in [1]. This would however not
> work with the way Luis is running the tests.
> -- Ketan]]>Marc2009-03-03T14:11:58-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25577/#msg_25577
mention it :)
You need a build in place that can generate your plugins, install it
into a working eclipse instance, and then use the ant scripts to run the
tests.
Googling for "pde test automation" and "pde build" should give you a
good headstart.
-- Ketan
On 3/3/09 19:41, Marc wrote:
> Hi,
>
> I looked at the script and it seems interesting.
> I've never worked with Ant script (sorry if following question seems
> newbie ones, I just need to confirm),
> first this is an Ant script, isn't it?
> And you can call it with command line like ">ant myscript.xml"
>
> It can be used to test Eclipse Plugin, not just SWT app?
>
> If all of this is real, then we could put the ant command in a .bat file
> and set its execution at some date by defining a task.
>
> This is very interesting because it is another step into test automation.
>
>
> At last, maybe Luis could execute this ant command from inside his java
> code and get the test executed.
>
>
> Bye
> Marc
>
>
> Ketan Padegaonkar wrote:
>
>> Hi,
>
>> The SWTBot tests do something similar. The command line used by SWTBot
>> for running its own tests is available in [1]. This would however not
>> work with the way Luis is running the tests.
>
> [...]
>
>> [1] -
> http://dev.eclipse.org/svnroot/technology/org.eclipse.swtbot /trunk/org.eclipse.swtbot.eclipse.junit4.headless/library.xm l
>
>
>> -- Ketan
>
>]]>Ketan Padegaonkar2009-03-03T16:55:49-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/25808/#msg_25808
I am already using ant script to test my rcp automatically.
First, you need to install your test plugins under eclipse plugin dir.
Then,you can run such a parallel task.It contains two threads: execute and
listen.
Execute Task will start your eclipse and execute your test case.
Listen task will collect the test result.
The listener can be downloaded from http://www.eclipse.org/articles/Article-PDEJUnitAntAutomatio n/PDETestExampleProjects-3.3.zip.
This task can run one case each.I wrote a small tool to generate the test
case name list.
Finally, you can use junitreport task to generate the test report.
Ketan, may I contribute a paper about how to automate the swtbot test with
ant?
Do you want my ant script? I can share it with you.]]>hugulas chen2009-03-04T09:44:42-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/26009/#msg_26009
> Marc,
> I am already using ant script to test my rcp automatically.
> First, you need to install your test plugins under eclipse plugin dir.
> Then,you can run such a parallel task.It contains two threads: execute
> and listen.
> Execute Task will start your eclipse and execute your test case.
> Listen task will collect the test result.
> The listener can be downloaded from
> http://www.eclipse.org/articles/Article-PDEJUnitAntAutomatio n/PDETestExampleProjects-3.3.zip.
> Do you want my ant script? I can share it with you.
Could you put this up on the SWTBot Wiki ?
-- Ketan]]>Ketan Padegaonkar2009-03-04T10:47:51-00:00Re: Start SWTbotTest from Java Application
https://www.eclipse.org/forums/index.php/mv/msg/8035/26298/#msg_26298
Thanks for all that details, it is still a bit confusing to me as I'm
completely discovering ant and all of this.
I think I'd greatly appreciate any paper about it.
I going on holydays so I won't be working on it for 10 days. But after
I'll be working on.