Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Creating a custom JFace based extension(Questions on how to create a custom extension based on a custom jface.Viewer implementation)
Creating a custom JFace based extension [message #1777229] Mon, 27 November 2017 09:25 Go to next message
Gilles Iachelini is currently offline Gilles IacheliniFriend
Messages: 8
Registered: November 2017
Junior Member
Hello everyone,

I am trying to create a custom extension to make a jface.Viewer based implementation testable through Jubula. This component basically uses all the benefits of the jface.Viewer API and combines it with a simple Canvas, on which I do some rendering (drawing lines, etc.). I'd like to make this custom component being testable with Jubula.

I have a plug-in implementing the the toolkit extension, where I define my IToolkitProvider.
It also contains the ComponentConfiguration.xml, which looks like:
    <toolkitComponent type="country.company.project.MyViewer" visible="true">
        <realizes>org.eclipse.jface.viewers.Viewer</realizes>
        <testerClass>some.package.MyViewerTester</testerClass>        
        <action name="UserExtension.rcverifytest">
            <method>rcverifytest</method>
            <param name="UserExtension.rcverifytest.test">
                <type>java.lang.String</type>
            </param>
        </action>
    </toolkitComponent>


Is it correct to use the "realizes" tag along with the base/parent class of my custom implementation?

To establish my Adapter and Factory I created a fragment bundle, which contains both: Adapter and AdapterFactory.
The package I used is: org.eclipse.jubula.ext.rc.common.adapter

My Factory looks like:

public class GraphViewerAdapterFactory implements IAdapterFactory {

private static final Class[] ADAPTABLE_TYPES = new Class[]{
MyViewer.class
};

@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Class adaptableType, Object adaptableObject) {
if (adaptableType.isAssignableFrom(IComponent.class)){
return new MyViewerAdapter(adaptableObject);
}
return null;
}

@Override
public Class[] getSupportedClasses() {
return ADAPTABLE_TYPES;
}
}


In the adapter itself I simply cast the parameter (adaptableObject) to MyViewer and redirect all the calls from
the base class AbstractComponentAdapter/interface IWidgetComponent.

These two bundles are referenced by a feature bundle, which is part of an updatesite, which can be used to install the extension.
But the part in the documentation "3.4 Addressing custom controls via the client" is beyond my comprehension.
Where do I put the org.eclipse.jubula.toolkit.ToolkitInfo Implementation?
Where do I put my org.eclipse.jubula.client.AUTAgent extends Remote Implementation? Is there an extension point I am missing? And what is a CAPBuilder?

Thanks for taking the time to read this post.

//g
Re: Creating a custom JFace based extension [message #1777295 is a reply to message #1777229] Tue, 28 November 2017 09:02 Go to previous messageGo to next message
Marvin Mueller is currently offline Marvin MuellerFriend
Messages: 255
Registered: March 2012
Senior Member
Hello Gilles,

The Component Configuration seems to be a little bit wrong. We have two things which we must keep in mind. First of all JFace component wrap most of the time a normal SWT component. So Jubula could only map the SWT component. Secondly, the realizes is the name of our internal Component names. Since you are writing a new component which is not a e.g. list or other component we have functionality for you use there "guidancer.abstract.Widget".
The rest of your implementations looks good.

With your last questions. I think you are mixing up extensions for API and for Jubula itself.[1] The chapter you are describing is only for the jubula API if you want to write test in Java.

with regards
Marvin Mueller

[1] http://help.eclipse.org/oxygen/topic/org.eclipse.jubula.client.ua.help/content/html/developerManual/toolkitExtension/ch03s04.html
Re: Creating a custom JFace based extension [message #1778023 is a reply to message #1777295] Fri, 08 December 2017 09:40 Go to previous messageGo to next message
minhang kang is currently offline minhang kangFriend
Messages: 8
Registered: December 2017
Junior Member
@Marvin Mueller
hi,Marvin Mueller,I post a topic in Nov.7th,but I still haven't seen my post in forum.After submiting successfully,system prompts it need to be verified by the administrator.How long does it to be seen and replied?
I'm looking forward to your reply,thanks.
Re: Creating a custom JFace based extension [message #1779979 is a reply to message #1778023] Tue, 16 January 2018 09:55 Go to previous messageGo to next message
Stuart Ledwich is currently offline Stuart LedwichFriend
Messages: 10
Registered: November 2010
Junior Member
Hello Gilles,
I am looking to do a very similar thing to what you have described in this post. I was wondering if you managed to get any further with this or not. Happy to share any help/thoughts on this to try to find a resolution. Thanks
Regards,
Stuart.
Re: Creating a custom JFace based extension [message #1780477 is a reply to message #1779979] Tue, 23 January 2018 06:31 Go to previous messageGo to next message
Gilles Iachelini is currently offline Gilles IacheliniFriend
Messages: 8
Registered: November 2017
Junior Member
Hi Stuart,

I have adopted the proposed changes from Marvin, but wasn't able to see my extension in action yet.
Re: Creating a custom JFace based extension [message #1797039 is a reply to message #1780477] Wed, 24 October 2018 11:29 Go to previous message
Markus Tiede is currently offline Markus TiedeFriend
Messages: 10
Registered: July 2009
Location: Braunschweig, Germany
Junior Member

IMHO a correct(er) ComponentConfiguration.xml would look like this

<toolkitComponent type="country.company.project.MyViewerForITETypeSystem" visible="true">
        <realizes>guidancer.abstract.Widget</realizes>
        <componentClass>exact.fqn.of.instance.at.runtime.in.aut.context</componentClass > <!-- e.g. the Canvas --> 
        <testerClass>some.package.MyViewerTester</testerClass>        
        <action name="UserExtension.rcVerifyTest">
            <method>rcVerifyTest</method>
            <param name="UserExtension.rcVerifyTest.test">
                <type>java.lang.String</type>
            </param>
        </action>
    </toolkitComponent>
Previous Topic:Second time running automation, Not able to click on OK button
Next Topic:Jubula evaluation
Goto Forum:
  


Current Time: Sat Nov 09 01:51:55 GMT 2024

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

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

Back to the top