Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » GEF and SWTBot
GEF and SWTBot [message #12942] Thu, 08 January 2009 12:15 Go to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Hi list,

I read the bug (http://swtbot.org/bugzilla/show_bug.cgi?id=113) for test
GEF elements. Can I get some examples which test a gef palette ?

I ask this because when I want to operate on a button, I write
bot.button....
I don't know similar instruction to operate on a palette after read this
GEF plugins.

Thanks in advance
Re: GEF and SWTBot [message #12973 is a reply to message #12942] Thu, 08 January 2009 12:34 Go to previous messageGo to next message
David Green is currently offline David Green
Messages: 135
Registered: July 2009
Senior Member
Brice Laurel wrote:
> Hi list,
>
> I read the bug (http://swtbot.org/bugzilla/show_bug.cgi?id=113) for test
> GEF elements. Can I get some examples which test a gef palette ?
>
> I ask this because when I want to operate on a button, I write
> bot.button....
> I don't know similar instruction to operate on a palette after read this
> GEF plugins.
>
> Thanks in advance
>

The attachment to the referenced bug contains some classes that are not
in SWTBot (to my knowledge). If you use the classes in the attachment
you can do something like this:

GraphicalEditor editor = ....
editor.activateTool("Create Foobars");

That should do it! Of course after activating a tool, typically you
would need to click on an edit part. Here's a sample:

editor.activateTool("Create Entity");
editor.mainEditPart().click();
Re: GEF and SWTBot [message #14018 is a reply to message #12973] Mon, 12 January 2009 10:36 Go to previous messageGo to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Hi David,

I uses plugin net.sf.swtbot.eclipse.gef. But When I want to close my
graphical editor, I write the code below

Workspace workspace = ResourcesPlugin.getWorkspace();
IFile file = workspace.getRoot().getFileForLocation(new
Path("myFilePath"));
GraphicalEditor editor = new GraphicalEditor(file);
editor.close();

But I have this error in my console

Exception in thread "WorkbenchTestable"
java.lang.IllegalArgumentException: No Classloader found for plug-in
swtbot2.jasmine
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getClassLoader(RemotePluginTestRunner.java:77)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getTestClassLoader(RemotePluginTestRunner.java:71)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
at
net.sf.swtbot.eclipse.ui.TestApplication.runTests(TestApplic ation.java:122)
at
org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
at java.lang.Thread.run(Thread.java:595)
dispose (View)


I dont't understand how ?

Thanks in advance for your help.
Re: GEF and SWTBot [message #14023 is a reply to message #14018] Mon, 12 January 2009 17:16 Go to previous messageGo to next message
David Green is currently offline David Green
Messages: 135
Registered: July 2009
Senior Member
Brice,

Looks like you've got a classpath problem. This looks like more of a
general "how do I set up my test runner classpath" question. I
recommend starting here:
http://wiki.eclipse.org/SWTBot/UsersGuide#Executing_SWTBot_T ests_for_Eclipse_Plugins

If that doesn't help perhaps Ketan can answer.

David

Brice Laurel wrote:
> Exception in thread "WorkbenchTestable"
> java.lang.IllegalArgumentException: No Classloader found for plug-in
> swtbot2.jasmine
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getClassLoader(RemotePluginTestRunner.java:77)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getTestClassLoader(RemotePluginTestRunner.java:71)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
>
> at
> net.sf.swtbot.eclipse.ui.TestApplication.runTests(TestApplic ation.java:122)
> at
> org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
>
> at java.lang.Thread.run(Thread.java:595)
> dispose (View)
>
>
> I dont't understand how ?
>
> Thanks in advance for your help.
>
Re: GEF and SWTBot [message #14034 is a reply to message #14023] Tue, 13 January 2009 06:12 Go to previous messageGo to next message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
David,

I don't think is the classpath. I configure my classpath likes in the
user's guide. My tab's dependency includes :

-net.sf.swtbot.finder (1.2.0)
-net.sf.swtbot.eclipse.finder (1.2.0)
-net.sf.swtbot.eclipse.ui (1.2.0)
-org.junit (3.8.2)
-org.apache.commons.collections (3.2.0)
-org.apache.log4j (1.2.13)
-MyAppli (1.1.2)
-net.sf.swtbot.eclipse.gef (1.0.0)

My tests runs well. But after I write the code below :

IWorkspace workspace = ResourcesPlugin.getWorkspace();
IFile file = workspace.getRoot().getFileForLocation(new
Path("myFilePath"));
GraphicalEditor editor = new GraphicalEditor(file);
editor.close();

I have this error on console

Exception in thread "WorkbenchTestable"
java.lang.IllegalArgumentException: No Classloader found for plug-in
swtbot1.jasmine
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getClassLoader(RemotePluginTestRunner.java:77)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getTestClassLoader(RemotePluginTestRunner.java:71)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
at
net.sf.swtbot.eclipse.ui.TestApplication.runTests(TestApplic ation.java:112)
at
org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
at java.lang.Thread.run(Thread.java:595)



I delete these code, but I have the same error. Is the other way to get an
IFile's instance? I need this to instanciate an GraphicalEditor.

Thanks for help.
Re: GEF and SWTBot [message #14050 is a reply to message #14034] Tue, 13 January 2009 07:46 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan Padegaonkar
Messages: 873
Registered: July 2009
Senior Member
You might want to add eclipse resources plugin, and perhaps even GEF.
But this is a problem that is hard to diagnose over email.

You'll need to figure out most of these dependencies on your own. The
blog entry[1] talks about this particular problem. The forum entry [2]
seems to suggest that you may be using JUnit 4.


[1] -
http://johnkaplansfirsteclipsecontribution.blogspot.com/2005 /09/could-be-coding-but-still-cant-get.html
[2] -
http://www.eclipse.org/newsportal/article.php?id=23561&g roup=eclipse.tools.jdt

-- Ketan

On 13/1/09 16:42, Brice Laurel wrote:
> David,
>
> I don't think is the classpath. I configure my classpath likes in the
> user's guide. My tab's dependency includes :
>
> -net.sf.swtbot.finder (1.2.0)
> -net.sf.swtbot.eclipse.finder (1.2.0)
> -net.sf.swtbot.eclipse.ui (1.2.0)
> -org.junit (3.8.2)
> -org.apache.commons.collections (3.2.0)
> -org.apache.log4j (1.2.13)
> -MyAppli (1.1.2)
> -net.sf.swtbot.eclipse.gef (1.0.0)
>
> My tests runs well. But after I write the code below :
>
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IFile file = workspace.getRoot().getFileForLocation(new
> Path("myFilePath"));
> GraphicalEditor editor = new GraphicalEditor(file);
> editor.close();
>
> I have this error on console
>
> Exception in thread "WorkbenchTestable"
> java.lang.IllegalArgumentException: No Classloader found for plug-in
> swtbot1.jasmine
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getClassLoader(RemotePluginTestRunner.java:77)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getTestClassLoader(RemotePluginTestRunner.java:71)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
>
> at
> net.sf.swtbot.eclipse.ui.TestApplication.runTests(TestApplic ation.java:112)
> at
> org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
>
> at java.lang.Thread.run(Thread.java:595)
>
>
>
> I delete these code, but I have the same error. Is the other way to get
> an IFile's instance? I need this to instanciate an GraphicalEditor.
> Thanks for help.
>
Re: GEF and SWTBot [message #14118 is a reply to message #14034] Tue, 13 January 2009 11:46 Go to previous messageGo to next message
David Green is currently offline David Green
Messages: 135
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------040806060000050603060809
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Brice,

Try turning on tracing with OSGi options enabled. See this article for
more details about tracing:
http://wiki.eclipse.org/FAQ_How_do_I_use_the_platform_debug_ tracing_facility%3F


I've attached the options that I normally use for this kind of issue.

David

Brice Laurel wrote:
> David,
>
> I don't think is the classpath. I configure my classpath likes in the
> user's guide. My tab's dependency includes :
>
> -net.sf.swtbot.finder (1.2.0)
> -net.sf.swtbot.eclipse.finder (1.2.0)
> -net.sf.swtbot.eclipse.ui (1.2.0)
> -org.junit (3.8.2)
> -org.apache.commons.collections (3.2.0)
> -org.apache.log4j (1.2.13)
> -MyAppli (1.1.2)
> -net.sf.swtbot.eclipse.gef (1.0.0)
>
> My tests runs well. But after I write the code below :
>
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IFile file = workspace.getRoot().getFileForLocation(new
> Path("myFilePath"));
> GraphicalEditor editor = new GraphicalEditor(file);
> editor.close();
>
> I have this error on console
>
> Exception in thread "WorkbenchTestable"
> java.lang.IllegalArgumentException: No Classloader found for plug-in
> swtbot1.jasmine
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getClassLoader(RemotePluginTestRunner.java:77)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.getTestClassLoader(RemotePluginTestRunner.java:71)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lass(RemoteTestRunner.java:683)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadC lasses(RemoteTestRunner.java:425)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:445)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
>
> at
> net.sf.swtbot.eclipse.ui.TestApplication.runTests(TestApplic ation.java:112)
> at
> org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(Work benchTestable.java:68)
>
> at java.lang.Thread.run(Thread.java:595)
>
>
>
> I delete these code, but I have the same error. Is the other way to get
> an IFile's instance? I need this to instanciate an GraphicalEditor.
> Thanks for help.
>


--------------040806060000050603060809
Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0";
name="options.properties"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="options.properties"

#### Debugging options for org.eclipse.osgi

# Turn on general debugging for org.eclipse.osgi
org.eclipse.osgi/debug=true
# Prints out class loading debug information
org.eclipse.osgi/debug/loader=false
# Prints out event (FrameworkEvent/BundleEvent/ServiceEvent) and listener debug information
org.eclipse.osgi/debug/events=false
# Prints out OSGi service debug information (registration/getting/ungetting etc.)
org.eclipse.osgi/debug/services=false
# Prints out bundle manifest parsing debug information
org.eclipse.osgi/debug/manifest=false
# Prints out LDAP filter debug information
org.eclipse.osgi/debug/filter=false
# Prints out security (PermissionAdmin service) debug information
org.eclipse.osgi/debug/security=false
# Prints out start level service debug information
org.eclipse.osgi/debug/startlevel=false
# Prints out package admin service debug information
org.eclipse.osgi/debug/packageadmin=true
# Prints out timing information for bundle activation
org.eclipse.osgi/debug/bundleTime=false
# Debug the loading of message bundles
org.eclipse.osgi/debug/messageBundles=false

# Eclipse adaptor options
org.eclipse.osgi/eclipseadaptor/debug = false
org.eclipse.osgi/eclipseadaptor/debug/location = false
org.eclipse.osgi/eclipseadaptor/debug/platformadmin=false
org.eclipse.osgi/eclipseadaptor/debug/platformadmin/resolver =false
org.eclipse.osgi/eclipseadaptor/converter/debug = false

### OSGi resolver options
# Turns on debugging for the resolver
org.eclipse.osgi/resolver/debug = true
# Prints out wiring information after the resolver has completed the resolve process
org.eclipse.osgi/resolver/wiring = true
# Prints out Import-Package information
org.eclipse.osgi/resolver/imports = true
# Prints out Require-Bundle information
org.eclipse.osgi/resolver/requires = true
# Prints out debug information form the "uses" clause
org.eclipse.osgi/resolver/uses = true
# Prints out cycle information
org.eclipse.osgi/resolver/cycles = true
# Prints out Eclipse-GenericRequire information
org.eclipse.osgi/resolver/generics = false

#### Profile settings
org.eclipse.osgi/profile/startup = false
org.eclipse.osgi/profile/benchmark = false
org.eclipse.osgi/profile/debug = false

# Override the default implemenation
org.eclipse.osgi/profile/impl = org.eclipse.osgi.internal.profile.DefaultProfileLogger

# Append all profile messages to the filename specified
org.eclipse.osgi/defaultprofile/logfilename =

# Output all profile log messages synchronously to the jvm console.
# By default, all log messages are cached until the log buffer is
# requested.
org.eclipse.osgi/defaultprofile/logsynchronously = false

# Specify the size of the default profile implementation log buffer.
org.eclipse.osgi/defaultprofile/buffersize = 256

#### Monitoring settings
# monitor class loading
org.eclipse.osgi/monitor/classes=false

# monitor bundle activation
org.eclipse.osgi/monitor/activation=true

# monitor resource bundle (*.properties) loading
org.eclipse.osgi/monitor/resources=false


#### Trace settings
# trace class loading - snapshot the execution stack when a class is loaded
org.eclipse.osgi/trace/classLoading=false

# trace location - file in which execution traces are written
org.eclipse.osgi/trace/filename=runtime.traces

# trace filters - Java properties file defining which classes should
# be traced (if trace/classLoading is true)
# File format:
# plugins=<comma separated list of plugins whose classes to trace>
# packages=<comma separated list of package prefixes of classes to trace>
# Note that there may be many 'plugins' and 'packages' lines in one file.
#org.eclipse.osgi/trace/filters=trace.properties

# trace bundle activation - snapshot the execution stack when a bundle is activated
org.eclipse.osgi/trace/activation=true

--------------040806060000050603060809--
Re: GEF and SWTBot [message #14151 is a reply to message #14118] Wed, 14 January 2009 07:23 Go to previous message
Brice Laurel is currently offline Brice Laurel
Messages: 72
Registered: July 2009
Member
Thanks David,

I delete the plugins net.sf.swtbot.eclipse.gef on my tab's dependency, and
my tests run well. I thinks I missing something when I create the jar with
Eclipse.

Now I copy the package net.sf.swtbot.eclipse.gef in my workpace. T run my
test well. I write the code below

Iworkspace workspace = RessourcesPlugin.getWorkspace();
IFile file = workspace.getRoot().getFileForLocation(new
Path("MyGraphEditor"));
GraphicalEditor editor = new GraphicalEditor(file);
editor.close();

When I run this test, the system say that it doesn't find this widget
while this editor is open.

Is there another way to have an IFile's object? I need this to instantiate
a GraphicalEditor

I have read your blog http://greensopinion.blogspot.com/ but I can't solve
my problem.

Thanks in advance for your help.
Previous Topic:An example of opening an Eclipse perspective using SWTBot
Next Topic:SWTBot at EclipseCon 2009
Goto Forum:
  


Current Time: Fri Aug 29 16:31:56 EDT 2014

Powered by FUDForum. Page generated in 0.14603 seconds