Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jubula-rc-dev] Extending guidancer.concrete.TabbedPane for SWT/RCP

Hi all
 
I'm trying to extend the "guidancer.concrete.TabbedPane" to read the title of a tab. (And do some substring on the title)
What I got/did sofar:
 
Created update site and built toolkit with it. Installed extended toolkit into Jubula thru Help - Install New Software ...
Exported the tester class fragment with Eclipse Export Wizard and placed it into the plugins directory of my application under test which is based on the Eclipse Scout framework.
 
TestStep for component type "Tabbed Component" offers me my action type "Store tab title into variable" including the needed/declared parameters.
Running the test results in an action error "Operation not supported by the selected toolkit".
Stacktrace:
ERROR o.e.j.r.c.c.AbstractCapTestCommand - implementation class method not found
java.lang.NoSuchMethodException: No such accessible method: rcStoreTitleOfTabByIndex() on object: org.eclipse.jubula.rc.common.tester.TabbedPaneTester
 at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:278) ~[org.apache.commons.beanutils.jar:na]
 at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:225) ~[org.apache.commons.beanutils.jar:na]
 at org.eclipse.jubula.rc.common.commands.MethodInvoker.invoke(MethodInvoker.java:64) ~[org.eclipse.jubula.rc.common.jar:na]
 at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.execute(AbstractCapTestCommand.java:240) ~[org.eclipse.jubula.rc.common.jar:na]
 at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:844) [org.eclipse.jubula.communication.jar:na]
 at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:402) [org.eclipse.jubula.communication.jar:na]
 at org.eclipse.jubula.communication.connection.Connection.access$2(Connection.java:391) [org.eclipse.jubula.communication.jar:na]
 at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:454) [org.eclipse.jubula.communication.jar:na]
 
 
===================================================
 
Toolkit:
=====
 
ComponentConfiguration.xml
---------------------------------
 <toolkitComponent type="ch.ucc.uwb.TabbedPanTitle">
  <extends>guidancer.concrete.TabbedPane</extends>
        <action name="MyCompSystem.StoreTitleOfTabByIndex">
   <method>rcStoreTitleOfTabByIndex</method>
   <param name="CompSystem.Variable">
                <type>guidancer.datatype.Variable</type>
            </param>
   <param name="MyCompSystem.TabIndex">
    <type>java.lang.Integer</type>
   </param>
   <param name="MyCompSystem.Direction">
    <type>java.lang.String</type>
    <defaultValue>l2r</defaultValue>
    <valueSet>
     <element name="MyCompSystem.Left2Right" value="l2r" />
     <element name="MyCompSystem.Right2Left" value="r2l" />
    </valueSet>
   </param>
   <param name="MyCompSystem.BeginIndex">
    <type>java.lang.Integer</type>
    <defaultValue>0</defaultValue>
   </param>
   <param name="MyCompSystem.EndIndex">
    <type>java.lang.Integer</type>
   </param>
            <postExecutionCommand>org.eclipse.jubula.client.core.businessprocess.TestExecution$VariableStorerCmd</postExecutionCommand>
  </action>
 </toolkitComponent>
 
 
 
 <toolkitComponent type="ch.ucc.uwb.TabFolderTitle" visible="false">
  <extends>org.eclipse.swt.widgets.TabFolder</extends>
  <testerClass>org.eclipse.jubula.rc.swt.tester.TabbedPaneCustTester</testerClass>
  <!-- <componentClass name="org.eclipse.swt.widgets.TabFolder" />-->
 </toolkitComponent>
 
 <toolkitComponent type="ch.ucc.uwb.CTabFolderTitle" visible="false">
  <extends>org.eclipse.swt.custom.CTabFolder</extends>
  <testerClass>org.eclipse.jubula.rc.swt.tester.TabbedPaneCustTester</testerClass>
  <!-- <componentClass name="org.eclipse.swt.widgets.CTabFolder" />-->
 </toolkitComponent>
 
plugin.xml
<plugin>
   <extension
         point="org.eclipse.jubula.toolkit.common.toolkitsupport">
      <toolkit
            IToolkitProvider="ch.ucc.uwb.jubula.extension.rcp.toolkit.provider.RcpExtensionProvider"
            depends="com.bredexsw.guidancer.RcpToolkitPlugin"
            includes="null"
            isUserToolkit="true"
            level="toolkit"
            name="exampleRcpToolkitExtension"
            order="11"
            toolkitID="com.bredexsw.guidancer.exampleRcpToolkitExtension">
      </toolkit>
   </extension>
</plugin>
 
MANIFEST.MF
----------------
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: ch.ucc.uwb.jubula.extension.rcp.toolkit;singleton:=true
Bundle-Version: 2.2.0.qualifier
Bundle-Activator: ch.ucc.uwb.jubula.extension.rcp.toolkit.Activator
Bundle-Vendor: %Bundle-Provider.0
Require-Bundle:  org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
 org.eclipse.jubula.tools;bundle-version="[2.2.0,2.3.0)",
 org.eclipse.jubula.toolkit.common;bundle-version="[2.2.0,2.3.0)",
 org.eclipse.jubula.toolkit.provider.rcp;bundle-version="[2.2.0,2.3.0)",
 org.eclipse.swt;bundle-version="[3.6.1,4.0.0)";resolution:=optional
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
 
And the provider class and i18n properties
===================================================
 
Feature:
======
 
feature.xml
-------------
<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="ch.ucc.uwb.jubula.extension.rcp.feature"
      label="Jubula Example - Toolkit Extension - RCP"
      version="2.2.0.qualifier"
      provider-name="Eclipse Jubula">
 
   <description url=""http://www.eclipse.org/jubula">http://www.eclipse.org/jubula">
      Example Jubula Toolkit Extension - RCP
   </description>
 
   <copyright url=""http://www.eclipse.org/jubula">http://www.eclipse.org/jubula">
      Copyright (c) 2004, 2012 BREDEX GmbH.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License
v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
BREDEX GmbH - initial API and implementation and/or initial documentation
   </copyright>
 
   <license url=""http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html">
      %license
   </license>
 
   <plugin
         id="ch.ucc.uwb.jubula.extension.rcp.toolkit"
         download-size="0"
         install-size="0"
         version="0.0.0"
         unpack="false"/>
 
</feature>
===================================================
 
Tester/Remote Control fragment:
=====================
 
Class TabbedPaneCustTester
---------------------------------
package org.eclipse.jubula.rc.swt.tester;
public class TabbedPaneCustTester extends TabbedPaneTester {
 
 public static final String LEFT_2_RIGHT = "l2r";
 public static final String RIGHT_2_LEFT = "r2l";
 
 public String rcStoreTitleOfTabByIndex(int index, String direction,
   int beginIndex, int endIndex) throws StepExecutionException {
  int tabIndex = IndexConverter.toImplementationIndex(index);
  String tabTitle = getTabPane().getTitleofTab(tabIndex);
 
  if (null == direction) {
   direction = LEFT_2_RIGHT;
  }
  if (LEFT_2_RIGHT.equalsIgnoreCase(direction)) {
   return tabTitle.substring(beginIndex, endIndex);
 
  } else if (RIGHT_2_LEFT.equalsIgnoreCase(direction)) {
   int length = tabTitle.length();
   return tabTitle.substring(length - endIndex, length - beginIndex);
  } else {
   throw new StepExecutionException(
     "Invalid direction. Valid values are 'l2r' left to right or 'r2l' right to left.",
     new TestErrorEvent(
       TestErrorEvent.ID.IMPL_CLASS_ACTION_ERROR));
  }
 }
 
}
 
Class UwbExtensionAdapterFactory
----------------------------------------
package org.eclipse.jubula.rc.common.adapter;
public class UwbExtensionAdapterFactory extends SWTAdapterFactory {
 
 @Override
 public Object getAdapter(Class class1, Object obj) {
  return super.getAdapter(class1, obj);
 }
 
 @Override
 public Class[] getSupportedClasses() {
  return super.getSupportedClasses();
 }
 
}
 
MANIFEST.MF
----------------
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extension
Bundle-SymbolicName: ch.ucc.uwb.jubula.rc.common
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: Card Center AG
Fragment-Host: org.eclipse.jubula.rc.rcp.swt;bundle-version="2.2.0.201310100933"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: lib/org.eclipse.jubula.rc.common_2.2.0.201310100933.jar,
 lib/org.eclipse.jubula.rc.swt_2.2.0.201310100933.jar,
 lib/org.eclipse.jubula.tools_2.2.0.201310100933.jar,
 .,
 lib/org.eclipse.jubula.rc.rcp.swt_2.2.0.201310100933.jar,
 lib/org.eclipse.jubula.rc.swt.jar
Import-Package: org.eclipse.swt.widgets
 
===================================================
 
Update site:
========
 
site.xml
---------
<site>
   <feature url="" id="ch.ucc.uwb.jubula.extension.rcp.feature" version="2.2.0.201403110920">
      <category name="ch.ucc.uwb.jubula.extensions"/>
   </feature>
   <category-def name="ch.ucc.uwb.jubula.extensions" label="UWB Jubula extensions"/>
</site>
===================================================
 
 
Thanks for any help, solving this problem.
Daniele

Based on previous e-mail correspondence with you and/or an agreement reached with you, we consider ourselves authorized to contact you via unsecured e-mail.

Warning:

(a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality, potential manipulation of contents and/or sender's address, incorrect recipient (misdirection), viruses etc. We assume no responsi-bility for any loss or damage resulting from the use of e-mails. We recommend in particular that you do NOT SEND ANY SENSITIVE INFORMATION, that you do not include details of the previous message in any reply, and that you enter e-mail address(es) manually every time you write an e-mail.

(b) As a matter of principle, we do NOT accept any ORDERS, revocations of orders or authorizations, blocking of credit cards, etc., sent by e-mail. Should such an e-mail nevertheless be received, we are not obliged to act on or respond to the e-mail.

Please notify us immediately if you received this e-mail by mistake or if you do not wish to receive any further e-mail correspondence. If you have received this e-mail by mistake, please completely delete it (and any attachments) and do not forward it or inform any other person of its contents.


Back to the top