Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » SWTbot and XMind
SWTbot and XMind [message #558730] Tue, 14 September 2010 08:47 Go to next message
Eclipse UserFriend
Originally posted by: wycieruch.gmail.com

Hi,
It's my first post on this newsgroup so hello everybody :)

I have an issue with SWTbot, which I was going to use to test my
application based on Xmind. And Xmind is GEF based mind map editor.

I installed SWTbot for GEF plugin and I wrote my first test class.
However when I want to get access to the gef editor I get un error. The
label of the editor is ok and everything is like in tutorial. I'm sure
that editor was found by SWTbot but in the end I got null pointer
exception. Can somebody tell me what is wrong?

My eclipse version: 3.5
My SWTbot version: 2.0

Thanks for any help
Marek.

package com.nglogic.xmindlook.testing.tests;

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEdito r;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(SWTBotJunit4ClassRunner.class)
public class MyFirstTest {

private static SWTWorkbenchBot bot;
private static SWTGefBot gefBot;
@BeforeClass
public static void beforeClass() throws Exception {
bot = new SWTWorkbenchBot();
gefBot = new SWTGefBot();
}


@Test
public void canCreateANewJavaProject() throws Exception {
//the line below gives un error
SWTBotGefEditor editor = gefBot.gefEditor("Workbook 1");
}


@AfterClass
public static void sleep() {
bot.sleep(2000);
}

}
Re: SWTbot and XMind [message #558735 is a reply to message #558730] Tue, 14 September 2010 09:02 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi Marek,

Can you give us the stacktrace ?

Thanks,

Mariot


Marek Adamek a écrit :
> Hi,
> It's my first post on this newsgroup so hello everybody :)
>
> I have an issue with SWTbot, which I was going to use to test my
> application based on Xmind. And Xmind is GEF based mind map editor.
>
> I installed SWTbot for GEF plugin and I wrote my first test class.
> However when I want to get access to the gef editor I get un error. The
> label of the editor is ok and everything is like in tutorial. I'm sure
> that editor was found by SWTbot but in the end I got null pointer
> exception. Can somebody tell me what is wrong?
>
> My eclipse version: 3.5
> My SWTbot version: 2.0
>
> Thanks for any help
> Marek.
>
> package com.nglogic.xmindlook.testing.tests;
>
> import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
> import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
> import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEdito r;
> import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
> import org.junit.AfterClass;
> import org.junit.BeforeClass;
> import org.junit.Test;
> import org.junit.runner.RunWith;
>
> @RunWith(SWTBotJunit4ClassRunner.class)
> public class MyFirstTest {
>
> private static SWTWorkbenchBot bot;
> private static SWTGefBot gefBot;
> @BeforeClass
> public static void beforeClass() throws Exception {
> bot = new SWTWorkbenchBot();
> gefBot = new SWTGefBot();
> }
>
>
> @Test
> public void canCreateANewJavaProject() throws Exception {
> //the line below gives un error
> SWTBotGefEditor editor = gefBot.gefEditor("Workbook 1");
> }
>
>
> @AfterClass
> public static void sleep() {
> bot.sleep(2000);
> }
>
> }
Re: SWTbot and XMind [message #559175 is a reply to message #558735] Wed, 15 September 2010 20:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wycieruch.gmail.com

This is a multi-part message in MIME format.
--------------000102030803010306060308
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Mariot,

The trace is in the attached text file.

Regards,
Marek

W dniu 2010-09-14 11:02, Mariot Chauvin pisze:
> Hi Marek,
>
> Can you give us the stacktrace ?
>
> Thanks,
>
> Mariot
>
>
> Marek Adamek a écrit :
>> Hi,
>> It's my first post on this newsgroup so hello everybody :)
>>
>> I have an issue with SWTbot, which I was going to use to test my
>> application based on Xmind. And Xmind is GEF based mind map editor.
>>
>> I installed SWTbot for GEF plugin and I wrote my first test class.
>> However when I want to get access to the gef editor I get un error. The
>> label of the editor is ok and everything is like in tutorial. I'm sure
>> that editor was found by SWTbot but in the end I got null pointer
>> exception. Can somebody tell me what is wrong?
>>
>> My eclipse version: 3.5
>> My SWTbot version: 2.0
>>
>> Thanks for any help
>> Marek.
>>
>> package com.nglogic.xmindlook.testing.tests;
>>
>> import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
>> import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
>> import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEdito r;
>> import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
>> import org.junit.AfterClass;
>> import org.junit.BeforeClass;
>> import org.junit.Test;
>> import org.junit.runner.RunWith;
>>
>> @RunWith(SWTBotJunit4ClassRunner.class)
>> public class MyFirstTest {
>>
>> private static SWTWorkbenchBot bot;
>> private static SWTGefBot gefBot;
>> @BeforeClass
>> public static void beforeClass() throws Exception {
>> bot = new SWTWorkbenchBot();
>> gefBot = new SWTGefBot();
>> }
>>
>>
>> @Test
>> public void canCreateANewJavaProject() throws Exception {
>> //the line below gives un error
>> SWTBotGefEditor editor = gefBot.gefEditor("Workbook 1");
>> }
>>
>>
>> @AfterClass
>> public static void sleep() {
>> bot.sleep(2000);
>> }
>>
>> }


--------------000102030803010306060308
Content-Type: text/plain;
name="trace.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="trace.txt"

b3JnLmVjbGlwc2Uuc3d0LlNXVEV4Y2VwdGlvbjogRmFpbGVkIHRvIGV4ZWN1 dGUgcnVubmFi
bGUgKGphdmEubGFuZy5OdWxsUG9pbnRlckV4Y2VwdGlvbikNCglhdCBvcmcu ZWNsaXBzZS5z
d3QuU1dULmVycm9yKFNXVC5qYXZhOjM4ODQpDQoJYXQgb3JnLmVjbGlwc2Uu c3d0LlNXVC5l
cnJvcihTV1QuamF2YTozNzk5KQ0KCW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LmVxdWlub3gu bGF1bmNoZXIu
TWFpbi5ydW4oTWFpbi5qYXZhOjEzMTEpDQoJYXQgb3JnLmVjbGlwc2UuZXF1 aW5veC5sYXVu
Y2hlci5NYWluLm1haW4oTWFpbi5qYXZhOjEyODcpDQoNCg==
--------------000102030803010306060308--
Re: SWTbot and XMind [message #559289 is a reply to message #559175] Thu, 16 September 2010 09:35 Go to previous messageGo to next message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
Hi Marek,

I assume this line throws the Exception : "final Control control = graphicalViewer.getControl();"
It means that in your case "editor.getAdapter(GraphicalViewer.class)" returns null, which is not expected.
Could you confirm this, or at least give me the version of SWTBot you use ?

Thanks,

Mariot


Marek Adamek a écrit :
> Hi Mariot,
>
> The trace is in the attached text file.
>
> Regards,
> Marek
>
> W dniu 2010-09-14 11:02, Mariot Chauvin pisze:
>> Hi Marek,
>>
>> Can you give us the stacktrace ?
>>
>> Thanks,
>>
>> Mariot
>>
>>
>> Marek Adamek a écrit :
>>> Hi,
>>> It's my first post on this newsgroup so hello everybody :)
>>>
>>> I have an issue with SWTbot, which I was going to use to test my
>>> application based on Xmind. And Xmind is GEF based mind map editor.
>>>
>>> I installed SWTbot for GEF plugin and I wrote my first test class.
>>> However when I want to get access to the gef editor I get un error. The
>>> label of the editor is ok and everything is like in tutorial. I'm sure
>>> that editor was found by SWTbot but in the end I got null pointer
>>> exception. Can somebody tell me what is wrong?
>>>
>>> My eclipse version: 3.5
>>> My SWTbot version: 2.0
>>>
>>> Thanks for any help
>>> Marek.
>>>
>>> package com.nglogic.xmindlook.testing.tests;
>>>
>>> import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
>>> import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
>>> import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEdito r;
>>> import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
>>> import org.junit.AfterClass;
>>> import org.junit.BeforeClass;
>>> import org.junit.Test;
>>> import org.junit.runner.RunWith;
>>>
>>> @RunWith(SWTBotJunit4ClassRunner.class)
>>> public class MyFirstTest {
>>>
>>> private static SWTWorkbenchBot bot;
>>> private static SWTGefBot gefBot;
>>> @BeforeClass
>>> public static void beforeClass() throws Exception {
>>> bot = new SWTWorkbenchBot();
>>> gefBot = new SWTGefBot();
>>> }
>>>
>>>
>>> @Test
>>> public void canCreateANewJavaProject() throws Exception {
>>> //the line below gives un error
>>> SWTBotGefEditor editor = gefBot.gefEditor("Workbook 1");
>>> }
>>>
>>>
>>> @AfterClass
>>> public static void sleep() {
>>> bot.sleep(2000);
>>> }
>>>
>>> }
>
Re: SWTbot and XMind [message #630183 is a reply to message #559289] Thu, 30 September 2010 22:41 Go to previous message
Eclipse UserFriend
Originally posted by: wycieruch.gmail.com

Hi Mariot.

I am so sorry I made you waiting for the response so long. I should have
done it earlier - sorry once again.

You were right. The method editor.getAdapter(GraphicalViewer.class)
returns null. I will let the XMind team know about this issue. Thanks a lot!

Sincerely,
Marek.

W dniu 2010-09-16 11:35, Mariot Chauvin pisze:
> Hi Marek,
>
> I assume this line throws the Exception : "final Control control = graphicalViewer.getControl();"
> It means that in your case "editor.getAdapter(GraphicalViewer.class)" returns null, which is not expected.
> Could you confirm this, or at least give me the version of SWTBot you use ?
>
> Thanks,
>
> Mariot
>
>
> Marek Adamek a écrit :
>> Hi Mariot,
>>
>> The trace is in the attached text file.
>>
>> Regards,
>> Marek
>>
>> W dniu 2010-09-14 11:02, Mariot Chauvin pisze:
>>> Hi Marek,
>>>
>>> Can you give us the stacktrace ?
>>>
>>> Thanks,
>>>
>>> Mariot
>>>
>>>
>>> Marek Adamek a écrit :
>>>> Hi,
>>>> It's my first post on this newsgroup so hello everybody :)
>>>>
>>>> I have an issue with SWTbot, which I was going to use to test my
>>>> application based on Xmind. And Xmind is GEF based mind map editor.
>>>>
>>>> I installed SWTbot for GEF plugin and I wrote my first test class.
>>>> However when I want to get access to the gef editor I get un error. The
>>>> label of the editor is ok and everything is like in tutorial. I'm sure
>>>> that editor was found by SWTbot but in the end I got null pointer
>>>> exception. Can somebody tell me what is wrong?
>>>>
>>>> My eclipse version: 3.5
>>>> My SWTbot version: 2.0
>>>>
>>>> Thanks for any help
>>>> Marek.
>>>>
>>>> package com.nglogic.xmindlook.testing.tests;
>>>>
>>>> import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
>>>> import org.eclipse.swtbot.eclipse.gef.finder.SWTGefBot;
>>>> import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEdito r;
>>>> import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
>>>> import org.junit.AfterClass;
>>>> import org.junit.BeforeClass;
>>>> import org.junit.Test;
>>>> import org.junit.runner.RunWith;
>>>>
>>>> @RunWith(SWTBotJunit4ClassRunner.class)
>>>> public class MyFirstTest {
>>>>
>>>> private static SWTWorkbenchBot bot;
>>>> private static SWTGefBot gefBot;
>>>> @BeforeClass
>>>> public static void beforeClass() throws Exception {
>>>> bot = new SWTWorkbenchBot();
>>>> gefBot = new SWTGefBot();
>>>> }
>>>>
>>>>
>>>> @Test
>>>> public void canCreateANewJavaProject() throws Exception {
>>>> //the line below gives un error
>>>> SWTBotGefEditor editor = gefBot.gefEditor("Workbook 1");
>>>> }
>>>>
>>>>
>>>> @AfterClass
>>>> public static void sleep() {
>>>> bot.sleep(2000);
>>>> }
>>>>
>>>> }
>>
Previous Topic:Would you like to contribute a testimonial?
Next Topic:Eclipse UI unit testing with SWTBot
Goto Forum:
  


Current Time: Fri Apr 19 13:17:33 GMT 2024

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

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

Back to the top