Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Jubula » Extend jubula with a self-written RCP Plugin(Jubula enables the adding of own function for getting parameter values )
Extend jubula with a self-written RCP Plugin [message #927998] Sun, 30 September 2012 07:04 Go to next message
Marco Franke is currently offline Marco FrankeFriend
Messages: 10
Registered: April 2012
Location: Bremen
Junior Member
Good morning,

I read the tutorial how I can implement own functions for setting values to paramters in jubula.

In this tutorial, the author describes that you have to implement the interface IFunctionEvaluator and to spefify the extension org.eclipse.jubula.client.core.functions. Nothing more.

My question is now, how can I add this project to jubula. In the example, the author exported the project as a jar and copy it to the plugin directory. But the information is missing how I can export it. What is the main function/ running configuration.

Furthermore, his integrating approach (copy the jar) doesn't work. The function is not there. The syntax validator say, that there is no function with this name.

Can somebody help me.....
Re: Extend jubula with a self-written RCP Plugin [message #928124 is a reply to message #927998] Sun, 30 September 2012 10:14 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Hi Marco,

you have to extend every Eclipse RCP application by writing a plug-in. Since it seems that you have no experience in this you should start by reading Lars Vogels excellent tutorials. Once you defined the plug-in correctly (depenedencies, extension and runtime) and added it to Jubula it will work.

Achim
Re: Extend jubula with a self-written RCP Plugin [message #928407 is a reply to message #928124] Sun, 30 September 2012 15:44 Go to previous messageGo to next message
Marco Franke is currently offline Marco FrankeFriend
Messages: 10
Registered: April 2012
Location: Bremen
Junior Member
Hi,
you are right I have not a loft of experience in plugin developement. For that reason, I used a tutorial (eclispe.org/index.php/blog_article_en/items/using-data-cohesion-for-better-test-cases.html)(this is the wrong link. You have to replace eclispe.org through bredex.de), but the tutorial doesn't explain in detail to create a *.jar.

First, I used the orginial plugin of the tutorial(just downloaded it) and it doesn't work. The tutorial said, the plugin, as *.jar, has to be copied into the plugin folder of jubula. In consequence, I took the jar, copied it, restartet Jubula, but Jubula dindn't care.

Second, I used my own developed plugin and follow the same steps of deploying but it doesn't work.

The question is now, which requirements has to be satisfied that jubula use the plugin. Second, why jubula gives no exception if the plugin is not valid. In Eclipse, the syntax and so on are correct.

Thanks for your hint that I should read tutorials. Smile

Has somenody else tried the above mentioned tutorial to extend jubula which an own function?
Re: Extend jubula with a self-written RCP Plugin [message #930507 is a reply to message #927998] Tue, 02 October 2012 11:35 Go to previous messageGo to next message
Alejo Abdala is currently offline Alejo AbdalaFriend
Messages: 22
Registered: September 2012
Location: Argentina
Junior Member
Hi, I did manage to use my own plugins (both accessibility and functions) for Jubula. I recommend that you read "EXTEND.pdf" that ships with Jubula Standalone.

Edit: just checking, both the EXTEND and UserManual have information on developing accessibility plugins, not much on functions though. But it is quite easy, just set the target platform to your jubula installation plugins folder, build a plugin project and a feature project that includes that plugin. Deploy the feature project as "Deployable features". This will create a folder with an update site. From Jubula, go to "Install new software", point to that update site and install its contents. (Uncheck the "Group items by category" checkbox).
Just one thing I've come across (that I don't know certainly if it was the cause of the function not showing): create one extension for each function you declare. Declaring several functions in the same extension didn't work for me. (At the same time, the classes that implemented IFunctionEvaluators were inner classes, so, either that or the multiple-functions-per-extension issue was blocking me). But keeping things simple works Smile

For functions, what I'm doing is exporting the feature project as an update site and installing it into Jubula as you would with any plugin (Help->Install New Software).

Related with this issue: does Jubula take the evaluator attribute of the extension into account? I wrote a plugin that checks something with the running jobs of the RCP but it just isn't working, because even though I defined that the 'evaluator' is the AUT, the jobs that it is seeing are the ones running in Jubula. Any hints on this side?

Thanks!

[Updated on: Tue, 02 October 2012 12:08]

Report message to a moderator

Re: Extend jubula with a self-written RCP Plugin [message #930528 is a reply to message #930507] Tue, 02 October 2012 11:56 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

Quote:

Related with this issue: does Jubula take the evaluator attribute of the extension into account? I wrote a plugin that checks something with the running jobs of the RCP but it just isn't working, because even though I defined that the 'evaluator' is the AUT, the jobs that it is seeing are the ones running in Jubula. Any hints on this side?


The parameter is there for future use. Sorry for the confusion. This should have been documented but obviously was forgotten. For now the function is always executed in the client context. Feel free to file a bug against Jubula Documentation and an enhancement request against Jubula Core.

Thanks for your input

Achim
Re: Extend jubula with a self-written RCP Plugin [message #930546 is a reply to message #930528] Tue, 02 October 2012 12:17 Go to previous messageGo to next message
Alejo Abdala is currently offline Alejo AbdalaFriend
Messages: 22
Registered: September 2012
Location: Argentina
Junior Member
Thanks Achim. Just a small one more: is there a way of knowing the RCP's workspace directory? (I'm setting it through the -data param in the aut configuration, but I'd like to use it in my tests forseeing that they could be run in different environments)
Re: Extend jubula with a self-written RCP Plugin [message #930711 is a reply to message #930546] Tue, 02 October 2012 15:09 Go to previous messageGo to next message
Achim Loerke is currently offline Achim LoerkeFriend
Messages: 376
Registered: July 2009
Location: Braunschweig, Germany
Senior Member

There is no support in Jubula to get the workspace location from an AUT. That would be a scenario for a function running in the AUT. You can set a variable (using Application.storeValue) with the location and use it in your tests. This would require some maintenance when you change the location, but only in one place.

Achim
Re: Extend jubula with a self-written RCP Plugin [message #931524 is a reply to message #930507] Wed, 03 October 2012 09:34 Go to previous messageGo to next message
Marco Franke is currently offline Marco FrankeFriend
Messages: 10
Registered: April 2012
Location: Bremen
Junior Member
Good morning,

I tried your way. I create a Feature Project. In this, I added my Plugin project. It contains one additional class:

public class GetDataSetValueFunctionEvaluator implements IFunctionEvaluator{

@Override
public String evaluate(String[] arg0) throws InvalidDataException {
// TODO Auto-generated method stub
return "Marco";
}

}

My project contains the following functions description:

?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.jubula.client.core.functions">
<function
class="org.eclipse.jubula.marco2.GetDataSetValueFunctionEvaluator"
evaluator="local"
name="getMarco2">
<parameter
name="DataSetName"
type="string">
</parameter>
<parameter
name="EntryKey"
type="string">
</parameter>
<parameter
name="ColumnName"
type="string">
</parameter>
</function>
</extension>

</plugin>

I exported the feature project and could install it with (Jubula-> Install new Software). After jubula has restarted (no errors), I open an existing jubula project and wanted to set my function as a value of a paramter. To this purpose, I insert the char ? + and the shortcut (control+ space) and got a list of avaible functions. My function wasn't contained.

Where is my problem? I have no idea, because there is no exception in the whole process.
Re: Extend jubula with a self-written RCP Plugin [message #932458 is a reply to message #931524] Thu, 04 October 2012 05:52 Go to previous messageGo to next message
Marco Franke is currently offline Marco FrankeFriend
Messages: 10
Registered: April 2012
Location: Bremen
Junior Member
Good morning,

I have already tried the implementation of an own function (for setting a parameter value) for jubula in different ways. All above mentioned ways didn't work for my jubula version(Version: 1.2.1). The mentioned workaround to insert a function to jubula (copy *.jar and adapt the configuration file manually) works only sometimes and not in general. At any time, there were any exception or any cue whereby I could understand the problem. Now, I don't use the jubula stand alone edition but the eclipse Juno Testing Edition. All self written functions, which didn't work in Jubula, are working in Eclipse Juno Testing Edition now. I changed nothing in the implementation or the way of exporting my functions.

Thanks Alejo Abdala for the help to export the self written function as a feature. It's a nice way to integrate the functions easily.

I have already wasted a lof of hours in this issue.
Re: Extend jubula with a self-written RCP Plugin [message #1186109 is a reply to message #930507] Thu, 14 November 2013 13:40 Go to previous message
Alok Shukla is currently offline Alok ShuklaFriend
Messages: 8
Registered: November 2013
Junior Member
Hi Alejo
Can you help me with the code and links which u have gone through.
Thanks in Advance
Alok
Previous Topic:Extend Jubula
Next Topic:RAP Support
Goto Forum:
  


Current Time: Thu Apr 25 15:40:40 GMT 2024

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

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

Back to the top