Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Create an action for Application
Create an action for Application [message #1403182] Tue, 22 July 2014 08:36 Go to next message
Déborah D is currently offline Déborah DFriend
Messages: 44
Registered: June 2014
Member
Hi,

I try to create a new action for Application.
But i don't know what is the toolkitComponent type for Application (to complete ComponentConfiguration.xml)

In the example (JSlider), the toolkitComponent type is javax.swing.JSlider.

Thanks to your help.

Déborah
Re: Create an action for Application [message #1403189 is a reply to message #1403182] Tue, 22 July 2014 09:36 Go to previous messageGo to next message
Déborah D is currently offline Déborah DFriend
Messages: 44
Registered: June 2014
Member
I don't know what do it put in node <extends>.

Someone can help me, please?

Thanks
Re: Create an action for Application [message #1403667 is a reply to message #1403189] Fri, 25 July 2014 07:39 Go to previous messageGo to next message
Déborah D is currently offline Déborah DFriend
Messages: 44
Registered: June 2014
Member
Hi,

<?xml version="1.0" encoding="ISO-8859-1"?>
<compSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ComponentConfiguration.xsd">
	<configVersion>
		<majorVersion>1</majorVersion>
		<minorVersion>36</minorVersion>
	</configVersion>

	<!-- Concrete components -->

	<toolkitComponent type="..." visible="true">
		<realizes>...</realizes>
		<!-- <extends>...</extends> -->
		
		<testerClass>...</testerClass>
		<componentClass name="..." />
		
	</toolkitComponent>
</compSystem>


I tried several ways to fill nodes, but none works.

Nothing happen in jubula.

Thanks to your help.
Re: Create an action for Application [message #1403721 is a reply to message #1403667] Fri, 25 July 2014 14:36 Go to previous message
Déborah D is currently offline Déborah DFriend
Messages: 44
Registered: June 2014
Member
I try this way, but it doesn't work...

feature.xml:

<?xml version="1.0" encoding="UTF-8"?>
<feature
      id="com.***.jubula.extension.feature"
      label="Feature"
      version="1.0.0.qualifier"
      provider-name="***">

   <description url="http://www.example.com/description">
      [Enter Feature Description here.]
   </description>

   <copyright url="http://www.example.com/copyright">
      [Enter Copyright Description here.]
   </copyright>

   <license url="http://www.example.com/license">
      [Enter License Description here.]
   </license>

</feature>



plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.jubula.toolkit.common.toolkitsupport">
      <toolkit
            IToolkitProvider="com.***.jubula.extension.toolkit.provider.MyToolkitProvider"
            includes="null"
            isUserToolkit="true"
            level="concrete"
            name="Jubula Drag And Drop Application"
            order="1"
            toolkitID="com.***.jubula.extension.toolkit">
      </toolkit>
   </extension>

</plugin>


toolkitProvider:

package com.***.jubula.extension.toolkit.provider;

import java.net.URL;
import java.util.Map;
import java.util.ResourceBundle;
import org.eclipse.jubula.toolkit.common.IToolKitProvider;
import org.eclipse.jubula.toolkit.common.exception.ToolkitPluginException;
import org.eclipse.jubula.toolkit.common.utils.ToolkitUtils;
import org.eclipse.swt.widgets.Composite;
import com.***.jubula.extension.toolkit.Activator;

public class MyToolkitProvider implements IToolKitProvider {
    /** the bundle location */
    public static final String BUNDLE = "com.***.jubula.extension.toolkit.i18n.i18n";
     
    public URL getComponentConfigurationFileURL() {
        return ToolkitUtils.getURL(Activator.getDefault(), "resources/xml/ComponentConfiguration.xml");
    }
    public ResourceBundle getI18nResourceBundle() {
        return ResourceBundle.getBundle(BUNDLE);
    }
    public Composite getAutConfigDialog(Composite parent, int style, Map<String, String> autConfig, String autName) throws ToolkitPluginException {
        return null;
    }
}


ComponentConfiguration.xml: (I don't know what put for the type of concreteComponent)

<?xml version="1.0" encoding="ISO-8859-1"?>

<compSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ComponentConfiguration.xsd">
	<configVersion>
		<majorVersion>0</majorVersion>
		<minorVersion>5</minorVersion>
	</configVersion>
	
	<!-- Concrete components -->
	
	<concreteComponent type="GraphicApplication">

    	<extends>guidancer.concrete.GraphicApplication</extends>
    	<testerClass>org.eclipse.jubula.rc.swing.tester.AppTester</testerClass>
		
		<action name="CompSystem.Drag">
			<method>rcDrag</method>
			<param name="CompSystem.MouseButton">
				<type>java.lang.Integer</type>
				<defaultValue>1</defaultValue>
				<valueSet>
					<element name="CompSystem.MouseButtonLeft" value="1"/>
					<element name="CompSystem.MouseButtonMiddle" value="2"/>
					<element name="CompSystem.MouseButtonRight" value="3"/>
				</valueSet>
			</param>
			<param name="CompSystem.ModifierSpecification">
				<type>java.lang.String</type>
				<defaultValue>none</defaultValue>
				<valueSet combinable="true">
					<element name="CompSystem.None" value="none"/>
					<element name="CompSystem.Shift" value="shift"/>
					<element name="CompSystem.Ctrl" value="control"/>
					<element name="CompSystem.Alt" value="alt"/>
					<element name="CompSystem.Meta" value="meta"/>
					<element name="CompSystem.Cmd" value="cmd"/>
					<element name="CompSystem.Mod" value="mod"/>
				</valueSet>
			</param>
			<param name="CompSystem.XPos">
				<type>java.lang.Integer</type>
				<defaultValue>50</defaultValue>
			</param>
			<param name="CompSystem.XUnits">
				<type>java.lang.String</type>
				<defaultValue>percent</defaultValue>
				<valueSet>
					<element name="CompSystem.Percent" value="percent"/>
					<element name="CompSystem.Pixel" value="pixel"/>
				</valueSet>
			</param>
			<param name="CompSystem.YPos">
				<type>java.lang.Integer</type>
				<defaultValue>50</defaultValue>
			</param>
			<param name="CompSystem.YUnits">
				<type>java.lang.String</type>
				<defaultValue>percent</defaultValue>
				<valueSet>
					<element name="CompSystem.Percent" value="percent"/>
					<element name="CompSystem.Pixel" value="pixel"/>
				</valueSet>
			</param>	
		</action>
			
		<action name="CompSystem.Drop">
			<method>rcDrop</method>
			<param name="CompSystem.XPos">
				<type>java.lang.Integer</type>
				<defaultValue>50</defaultValue>
			</param>
			<param name="CompSystem.XUnits">
				<type>java.lang.String</type>
				<defaultValue>percent</defaultValue>
				<valueSet>
					<element name="CompSystem.Percent" value="percent"/>
					<element name="CompSystem.Pixel" value="pixel"/>
				</valueSet>
			</param>
			<param name="CompSystem.YPos">
				<type>java.lang.Integer</type>
				<defaultValue>50</defaultValue>
			</param>
			<param name="CompSystem.YUnits">
				<type>java.lang.String</type>
				<defaultValue>percent</defaultValue>
				<valueSet>
					<element name="CompSystem.Percent" value="percent"/>
					<element name="CompSystem.Pixel" value="pixel"/>
				</valueSet>
			</param>
			<param name="CompSystem.DelayBeforeDrop">
				<type>java.lang.Integer</type>
				<defaultValue>100</defaultValue>
			</param>
		</action>
	</concreteComponent>
	
</compSystem>


i18n:

GraphicApplication=Application

CompSystem.Alt=Alt
CompSystem.Cmd=Cmd
CompSystem.Ctrl=Ctrl
CompSystem.DelayBeforeDrop=Delay Before Drop
CompSystem.Drag=Drag
CompSystem.Drop=Drop
CompSystem.Meta=Meta
CompSystem.Mod=Mod
CompSystem.MouseButton=Mouse Button
CompSystem.MouseButtonLeft=Mouse Button Left
CompSystem.MouseButtonMiddle=Mouse Button Middle
CompSystem.MouseButtonRight=Mouse Button Right
CompSystem.ModifierSpecification=Modifier Specification
CompSystem.None=None
CompSystem.Percent=Percent
CompSystem.Pixel=Pixel
CompSystem.Shift=Shift
CompSystem.XPos=x-position
CompSystem.XUnits=x-units
CompSystem.YPos=y-position
CompSystem.YUnits=y-units


componentConfiguration.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:include schemaLocation="../../../ToolkitSupportPlugin/resources/xml/ToolkitComponentConfiguration.xsd"/>

</xs:schema>


AppTester.java:
package org.eclipse.jubula.rc.common.tester;

import java.awt.Rectangle;
import org.eclipse.jubula.rc.common.driver.IRobot;

public class AppTester extends AbstractApplicationTester{

	public void rcDrag(int mouseButton, String modifierKeys, int XPos, String XUnits, int YPos, String YUnits){
		
	}
	
	public void rcDrop(int XPos, String XUnits, int YPos, String YUnits, int delayBeforeDrop){
		
	}
	
	public String[] getTextArrayFromComponent() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public Rectangle getActiveWindowBounds() {
		// TODO Auto-generated method stub
		return null;
	}
	
	protected IRobot getRobot() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public void rcKeyStroke(String modifierSpec, String keySpec) {
		// TODO Auto-generated method stub
	}
	
	protected Object getFocusOwner() {
		// TODO Auto-generated method stub
		return null;
	}
	
	protected int getEventCode(int key) {
		// TODO Auto-generated method stub
		return 0;
	}
	
	protected Object getActiveWindow() {
		// TODO Auto-generated method stub
		return null;
	}

}


site.xml:

<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature url="features/com.***.jubula.extension.feature_1.0.0.201407251534.jar" id="com.***.jubula.extension.feature" version="1.0.0.201407251534">
      <category name="com.***.jubula.extension.feature"/>
   </feature>
   <category-def name="com.***.jubula.extension.feature" label="Jubula Drag And Drop Application"/>
</site>


I build in site.xml and i install new software in Eclipse.

[Updated on: Fri, 25 July 2014 14:46]

Report message to a moderator

Previous Topic:Show AUT's variable on screen
Next Topic:Out of memory while writing test result report
Goto Forum:
  


Current Time: Mon Mar 02 19:22:03 GMT 2015

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

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