Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Extend Jubula
Extend Jubula [message #756170] Fri, 11 November 2011 11:41 Go to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hello Community,

I'm trying to extend Jubula for a few days now, I tried various things now, but I don't get it.

I tried to extend Jubela to access the org.eclipse.ui.forms.widgets.ImageHyperlink.
I'd like to know if anyone has successfully made an extension in Jubula and has some Tips for me.

I know this isn't much Information, sorry for this. Confused

I hope anyone is able to help me.

Regards
Marc
Re: Extend Jubula [message #757717 is a reply to message #756170] Mon, 21 November 2011 10:48 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hello again,

Because nobody was able to help me so far I tried a bit more and I'm now at the point were Jubula recognizes my ImageHyperlink.
Now the problem is that there is an Configuration Error each time I try to perform an action on it. There is a log File under User/.jubula/logs named rc_rcp.log and in there I find the error Message :
An error occured: 
org.eclipse.jubula.rc.common.exception.UnsupportedComponentException: component 'org.eclipse.ui.forms.widgets.ImageHyperlink' is not supported: implementation class 'org.eclipse.jubula.extension.rc.rcp.implclasses.ImageHyperlinkImplClass' not found


I did everything as described by the extension API, but I think there has to be a little trick in extending RCP-AUTs.
At least I like to know if the file is at the right place "instalationFolder/server/lib/extImplClasses" and how to alter which configuration File so that jubula is aware of my tester class.

I hope anyone is able to help me with this informations.

Regards
Marc
Re: Extend Jubula [message #757747 is a reply to message #757717] Mon, 21 November 2011 13:17 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Marc,

The trick for the RCP extension is to write and deploy a fragment with the "org.eclipse.jubula.rc.rcp"-bundle as its host. The class must be located in the package "org.eclipse.jubula.rc.swt.implclasses".

We are working on a dedicated RCP extension example at the moment, which demonstrates the various ways of extending the RCP toolkit. I assume that this will be made available at the latest with or around SR2.

Hope this information helps you with your extension!

Best regards,
Alex
Re: Extend Jubula [message #757754 is a reply to message #757747] Mon, 21 November 2011 13:56 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hi Alex,

Thanks that helps alot, but I have one more question where should I put the deployd fragment?

Regards,
Marc
Re: Extend Jubula [message #757769 is a reply to message #757754] Mon, 21 November 2011 15:20 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi Marc,

Put it in the plugins folder for your AUT.

Best regards,
Alex
Re: Extend Jubula [message #757770 is a reply to message #757769] Mon, 21 November 2011 15:22 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hi Alex,

I tried, do I have to alter any config-File?

Regards,
Marc
Re: Extend Jubula [message #759600 is a reply to message #757770] Tue, 29 November 2011 10:23 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Hi,

I am also trying to extend a rcp application, especially the org.eclipse.swt.widgets.Canvas

What I have done so far:
* Made a new toolkit plugin which is nearly similar to the org.eclipse.jubula.examples.extension.swing.toolkit except some individual configurations, like it extends from com.bredexsw.guidancer.RcpToolkitPlugin
** Created a ComponentConfiguration.xml with an entry for the Canvas
* Made a fragment with org.eclipse.jubula.rc.rcp as host plugin which contains the CanvasImplClass under the package org.eclipse.jubula.rc.swt.implclasses

After the creation part i put the toolkit plugin into the JubulaInstallationPath/jubula/plugins and the fragment into the plugin folder of my AUT.

Now when starting Jubula and the AUT, I can map the Canvas and even create a new Action for the public method i created in the CanvasImplClass (or which I specified in the ComponentConfiguration.xml). But when I run the test which contains the new action, I get a Configuration Error. I also get this when drag and dropping the Canvas with the DnD-Action from unbound_modules_concrete_[5.2] -> Actions (basic) -> Drag&Drop -> ub_grc_dragAndDrop. In the log file I get the following warning: WARN o.e.jubula.client.core.ClientTest - No Basic Tester Class is defined for the Toolkit with ID 'com.bredexsw.guidancer.RcpToolkitPlugin'. No Simple Component Extensions will be added.

So I guess there must be something wrong with the fragment, since it can not find the ImplClass at runtime.

Any Ideas? Wink

Regards
Re: Extend Jubula [message #759617 is a reply to message #759600] Tue, 29 November 2011 11:16 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra SchladebeckFriend
Messages: 1613
Registered: July 2009
Senior Member
Hi,

The log message Quote:
WARN o.e.jubula.client.core.ClientTest - No Basic Tester Class is defined for the Toolkit with ID 'com.bredexsw.guidancer.RcpToolkitPlugin'. No Simple Component Extensions will be added.
doesn't have anything to do with the extension you have written. It is related to a different extension mechanism that was shortly available, but is no longer used. We have a product backlog entry to remove the log entries etc.

Based on that, I'd guess that the Configuration Error may actually be a problem in the Implementation Class.

Hope that helps a little!
Alex
Re: Extend Jubula [message #759631 is a reply to message #759617] Tue, 29 November 2011 12:07 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Since i cannot really find the error in the ImplClass, I show you, how it looks like:

package org.eclipse.jubula.rc.swt.implclasses;

import org.eclipse.jubula.rc.common.implclasses.Verifier;

public class CanvasImplClass extends ControlImplClass {
	
	public void verifyControlData(String key, String expectedValue) {
		Object data = getComponent().getData(key);
		if (data != null) {
			Verifier.equals(expectedValue, data.toString());
		} else {
			Verifier.equals(expectedValue, "");
		}
	}
	
}


Every feedback is welcome.

Regards.
Re: Extend Jubula [message #759840 is a reply to message #759631] Wed, 30 November 2011 09:32 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hi Tommy,

Take a look at the log User/.jubula/logs named rc_rcp.log. If theres an UnsupportedComponentException for your Canvas then Jubula doesn't know theres a Testerclass for it.

Regards,
Marc
Re: Extend Jubula [message #759876 is a reply to message #759840] Wed, 30 November 2011 12:54 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Finally it's running now, at least somehow.

First of all: Thanks for the hint with the (hidden) log-file, this one helped a lot.

We did not get a UnsupportedComponentException, so our class has been found. On strict search, we found a org.eclipse.swt.SWTException: Invalid thread access involving our public method in the ImplClass. So we made a syncExec on the display of the component, so it looks like this now:

package org.eclipse.jubula.rc.swt.implclasses;

import org.eclipse.jubula.rc.common.implclasses.Verifier;

public class CanvasImplClass extends ControlImplClass {
	
	public void verifyControlData(final String key, final String expectedValue) {
		final Control component = getComponent();
		component.getDisplay().syncExec(new Runnable() {
			@Override
			public void run() {
				Object data = component.getData(key);
				if (data != null) {
					Verifier.equals(expectedValue, data.toString());
				} else {
					Verifier.equals(expectedValue, "");
				}
			}
		});
	}
	
}


That fixed the org.eclipse.swt.SWTException: Invalid thread access.

Now we still get the Configuration error, but the log file says: org.eclipse.jubula.rc.common.exception.StepVerifyFailedException: Expected 'xyz' but was ''

Now I'd like to know, how you can make this a simple Check Error, like the checks in the unbound_xyz-libraries.

Regards.
Re: Extend Jubula [message #759878 is a reply to message #759876] Wed, 30 November 2011 13:03 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 13
Registered: August 2011
Junior Member
Hi Tommy,

I don't know about your specific problem, but looking at the standard implclasses of Jubula helped me out a lot.
Try to look for a component with similiar behavior, these classes are well documented so maybe you find something.

Regards,
Marc
Re: Extend Jubula [message #759891 is a reply to message #759876] Wed, 30 November 2011 13:47 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Tommy R wrote on Wed, 30 November 2011 13:54




				if (data != null) {
					Verifier.equals(expectedValue, data.toString());
				} else {
					Verifier.equals(expectedValue, "");
				}

}



The Verifier will throw an Exception if its condition is not met. Since your expected value is "xyz" and your real value is "" (from data==null oder from the actual value) this counts as an verification error.
Re: Extend Jubula [message #759904 is a reply to message #759891] Wed, 30 November 2011 14:13 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Ok, the problem was, that the verification (Verifier.equals(...)) was handled inside of the runnable, which did not work. We now use the getEventThreadQueuer().invokeAndWait to get the control data and after that we use the Verifier (outside of the runnable) like it was done in the LabelImplClass for example.

Thanks at all for the help.

Regards,
Tommy

[Updated on: Wed, 30 November 2011 14:13]

Report message to a moderator

Re: Extend Jubula [message #760858 is a reply to message #759904] Mon, 05 December 2011 13:19 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Hi,

since I can imagine that a lot of people have problems with extending RCP applications for Jubula, I'd like to announce a blog article my workmate has written after solving our problems with the help in this forum:

http://www.subshell.com/en/subshell/blog/Extending-Jubula-For-Custom-SWT-Controls-In-RCP-Applications100.html

This one is a step-by-step tutorial on how to extend RCP applications to handle any control.

I hope you enjoy it.

Regards,
Tommy

[Updated on: Mon, 05 December 2011 15:20]

Report message to a moderator

Re: Extend Jubula [message #1034456 is a reply to message #760858] Fri, 05 April 2013 12:56 Go to previous messageGo to next message
Sascha Neuhausen is currently offline Sascha NeuhausenFriend
Messages: 2
Registered: April 2013
Junior Member
Is there a new version for 2.0 available?
Re: Extend Jubula [message #1036320 is a reply to message #1034456] Mon, 08 April 2013 08:23 Go to previous messageGo to next message
Tommy R is currently offline Tommy RFriend
Messages: 32
Registered: October 2011
Location: Hamburg
Member
Sascha Neuhausen wrote on Fri, 05 April 2013 08:56
Is there a new version for 2.0 available?


Hi Sascha,

sorry to disappoint you, but we are not doing our gui tests with Jubula anymore (management decision). Therefore we are not going to update the guide to Jubula 2.0 in the near future.

Greetings
Tommy
Re: Extend Jubula [message #1186010 is a reply to message #756170] Thu, 14 November 2013 12:13 Go to previous message
Alok Shukla is currently offline Alok ShuklaFriend
Messages: 8
Registered: November 2013
Junior Member
Hi Marc
Have you been successful in extending Jubula.?Can you help me with the links,code or anything in this regard.
Thanks in Advance

Alok
Previous Topic:Set Test Parameters with Jenkins at startup of test
Next Topic:Extend jubula with a self-written RCP Plugin
Goto Forum:
  


Current Time: Thu Mar 28 22:59:43 GMT 2024

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

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

Back to the top