diff options
| author | Marvin Mueller | 2013-08-08 09:50:52 +0000 |
|---|---|---|
| committer | Marvin Mueller | 2013-08-21 10:55:06 +0000 |
| commit | 8b844089e36c1f2cd57625e2f2ee7e61f945d2b8 (patch) | |
| tree | 3b99549dc62af2416f70beb94f82d4db35e61003 | |
| parent | 2fc73556626c8a346c1c32957f50d83012e06a83 (diff) | |
| download | org.eclipse.jubula.core-8b844089e36c1f2cd57625e2f2ee7e61f945d2b8.tar.gz org.eclipse.jubula.core-8b844089e36c1f2cd57625e2f2ee7e61f945d2b8.tar.xz org.eclipse.jubula.core-8b844089e36c1f2cd57625e2f2ee7e61f945d2b8.zip | |
Sprint task - Changing the default mapping mechanism so application and menu actions do not need a parameter name anymore
62 files changed, 381 insertions, 1219 deletions
diff --git a/org.eclipse.jubula.client.archive/model/archiveModel.xsd b/org.eclipse.jubula.client.archive/model/archiveModel.xsd index ba6582ca4..8bd9c5b8c 100644 --- a/org.eclipse.jubula.client.archive/model/archiveModel.xsd +++ b/org.eclipse.jubula.client.archive/model/archiveModel.xsd @@ -407,7 +407,7 @@ <xs:extension base="gd:parameter"> <xs:sequence> <xs:element name="actionName" type="xs:string" /> - <xs:element name="componentName" type="xs:string" /> + <xs:element name="componentName" type="xs:string" nillable="true" /> <xs:element name="componentType" type="xs:string" /> </xs:sequence> </xs:extension> diff --git a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java index f2b820b8f..bb0082e05 100644 --- a/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java +++ b/org.eclipse.jubula.client.archive/src/org/eclipse/jubula/client/archive/XmlImporter.java @@ -146,6 +146,8 @@ import org.eclipse.jubula.tools.objects.ComponentIdentifier; import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.jubula.tools.objects.IMonitoringValue; import org.eclipse.jubula.tools.objects.MonitoringValue; +import org.eclipse.jubula.tools.xml.businessmodell.Component; +import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.jubula.tools.xml.businessmodell.ToolkitPluginDescriptor; import org.eclipse.osgi.util.NLS; import org.slf4j.Logger; @@ -519,15 +521,18 @@ class XmlImporter { } final String name = compName.getCompName(); final String type = compName.getCompType(); - final String creationContext = compName.getCreationContext(); - final CompNameCreationContext ctx = CompNameCreationContext - .forName(creationContext); - final IComponentNamePO componentNamePO = PoMaker - .createComponentNamePO(guid, name, type, ctx, proj.getId()); - componentNamePO.setReferencedGuid(compName.getRefGuid()); - createdCompNames.add(componentNamePO); - compNameCache.addComponentNamePO( - componentNamePO); + if (!componentHasDefaultMapping(type)) { + + final String creationContext = compName.getCreationContext(); + final CompNameCreationContext ctx = CompNameCreationContext + .forName(creationContext); + final IComponentNamePO componentNamePO = PoMaker + .createComponentNamePO(guid, name, type, ctx, proj.getId()); + componentNamePO.setReferencedGuid(compName.getRefGuid()); + createdCompNames.add(componentNamePO); + compNameCache.addComponentNamePO( + componentNamePO); + } } if (assignNewGuid) { @@ -1207,15 +1212,18 @@ class XmlImporter { private ICapPO createCap(IProjectPO proj, Cap xml, boolean assignNewGuid) { final ICapPO cap; - + String componentname = xml.getComponentName(); + if (componentHasDefaultMapping(xml.getComponentType())) { + componentname = null; + } if (xml.getGUID() != null && !assignNewGuid) { // GUID is available cap = NodeMaker.createCapPO( - xml.getName(), xml.getComponentName(), xml.getComponentType(), + xml.getName(), componentname, xml.getComponentType(), xml.getActionName(), proj, xml.getGUID()); } else { cap = NodeMaker.createCapPO(xml.getName(), - xml.getComponentName(), xml.getComponentType(), + componentname, xml.getComponentType(), xml.getActionName(), proj); } cap.setDataFile(xml.getDatafile()); @@ -2169,5 +2177,20 @@ class XmlImporter { } } + /** + * + * @param componentType + * component type name + * @return true if the component has a default mapping and therefore has no + * component name + */ + private boolean componentHasDefaultMapping(String componentType) { + Component component = ComponentBuilder.getInstance() + .getCompSystem().findComponent(componentType); + if (component.isConcrete()) { + return ((ConcreteComponent)component).hasDefaultMapping(); + } + return false; + } } diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/IRecordListener.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/IRecordListener.java index af6ecb618..e6653228a 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/IRecordListener.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/IRecordListener.java @@ -32,7 +32,10 @@ public interface IRecordListener extends EventListener { * the CapPO. May be <code>null</code> if the test step could not
* successfully be created.
* @param ci
- * ComponentIdentifier
+ * ComponentIdentifier + * @param hasDefaultMapping + * if the cap which is recorded has not component name
*/
- public void capRecorded(ICapPO newCap, IComponentIdentifier ci);
+ public void capRecorded(ICapPO newCap, IComponentIdentifier ci, + boolean hasDefaultMapping);
}
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/MessageFactory.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/MessageFactory.java index 152c37f68..7ee94d474 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/MessageFactory.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/MessageFactory.java @@ -271,21 +271,9 @@ public class MessageFactory { public static SendAUTListOfSupportedComponentsMessage getSendAUTListOfSupportedComponentsMessage() throws UnknownMessageException { - final String autToolKit = getAutToolkit(); String messageClassName = "null"; //$NON-NLS-1$ try { - if (CommandConstants.SWT_TOOLKIT.equals(autToolKit) - || CommandConstants.RCP_TOOLKIT.equals(autToolKit)) { - messageClassName = "org.eclipse.jubula.communication.message.swt.SendSwtAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$ - } else if (CommandConstants.SWING_TOOLKIT.equals(autToolKit)) { - messageClassName = "org.eclipse.jubula.communication.message.swing.SendSwingAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$ - } else if (CommandConstants.HTML_TOOLKIT.equals(autToolKit)) { - messageClassName = "org.eclipse.jubula.communication.message.html.SendHtmlAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$ - } else if (CommandConstants.WIN_TOOLKIT.equals(autToolKit)) { - messageClassName = "org.eclipse.jubula.communication.message.win.SendWinAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$) { - } else if (CommandConstants.IOS_TOOLKIT.equals(autToolKit)) { - messageClassName = "org.eclipse.jubula.communication.message.ios.SendIOSAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$) { - } + messageClassName = "org.eclipse.jubula.communication.message.SendAUTListOfSupportedComponentsMessage"; //$NON-NLS-1$ Class messageClass = Class.forName(messageClassName, false, SendAUTListOfSupportedComponentsMessage.class .getClassLoader()); diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNamesBP.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNamesBP.java index 65a8291ae..6a50f2f42 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNamesBP.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/CompNamesBP.java @@ -452,7 +452,9 @@ public class CompNamesBP { } } else if (childNode instanceof ICapPO) { ICapPO cap = (ICapPO)childNode; - if (cap.getComponentName().equals(pair.getFirstName())) { + if (cap.getComponentName() != null + && cap.getComponentName() + .equals(pair.getFirstName())) { pair.setType(cap.getComponentType()); return true; } @@ -522,7 +524,10 @@ public class CompNamesBP { INodePO node = it.previous(); if (node instanceof IExecTestCasePO) { IExecTestCasePO execNode = (IExecTestCasePO)node; - ICompNamesPairPO pair = execNode.getCompNamesPair(currentName); + ICompNamesPairPO pair = null; + if (!StringUtils.isEmpty(currentName)) { + pair = execNode.getCompNamesPair(currentName); + } if (pair != null) { currentName = pair.getSecondName(); currentNamePo = diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/ComponentNamesBP.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/ComponentNamesBP.java index b2872ba8a..842923651 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/ComponentNamesBP.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/ComponentNamesBP.java @@ -12,10 +12,8 @@ package org.eclipse.jubula.client.core.businessprocess; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import javax.persistence.EntityManager; @@ -59,7 +57,6 @@ import org.eclipse.jubula.tools.exception.JBFatalException; import org.eclipse.jubula.tools.messagehandling.MessageIDs; import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; import org.eclipse.jubula.tools.xml.businessmodell.Component; -import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.osgi.util.NLS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -147,15 +144,11 @@ public class ComponentNamesBP /** The singleton instance */ private static ComponentNamesBP instance = null; - /** all default Names */ - private Map<ConcreteComponent, String> m_defaultNames = - new HashMap<ConcreteComponent, String>(); - /** * Singleton Constructor. */ private ComponentNamesBP() { - initDefaultNames(); + // } @@ -562,12 +555,6 @@ public class ComponentNamesBP } CompSystem compSystem = ComponentBuilder.getInstance().getCompSystem(); - if (compSystem.getDefaultMappingNames().containsKey(componentName)) { - // Default mapping cannot change, no need to perform - // the computation. - return - (String)compSystem.getDefaultMappingNames().get(componentName); - } Set<Component> components = new HashSet<Component>(); for (String compType : types) { Component comp = compSystem.findComponent(compType); @@ -645,13 +632,7 @@ public class ComponentNamesBP public String isCompatible(String originalCompType, String checkableName, IComponentNameMapper compNameMapper, Long projectId, boolean isSimpleMatch) { - - if (isReservedName(checkableName, originalCompType)) { - return MessageIDs.getMessageObject( - MessageIDs.E_RESERVED_COMP_NAME).getMessage( - new Object[] {checkableName}); - } - + IComponentNameCache compNameCache = compNameMapper.getCompNameCache(); Set<IComponentNameData> componentNameDataSet = @@ -743,41 +724,7 @@ public class ComponentNamesBP return isCompatible(originalCompType, checkableName, compNameMapper, projectId, false); - } - - /** - * @param name comp name to check - * @param componentType The type for the component - * @return true, if given name is a reserved comp name - */ - private boolean isReservedName(String name, String componentType) { - if (m_defaultNames.values().contains(name)) { - CompSystem compSystem = - ComponentBuilder.getInstance().getCompSystem(); - Component comp = compSystem.findComponent(componentType); - if (comp instanceof ConcreteComponent) { - return !name.equals(m_defaultNames.get(comp)); - } - - return true; - } - return false; - } - - /** - * initializes a list with all defaultNames - */ - private void initDefaultNames() { - m_defaultNames.clear(); - for (Object o : ComponentBuilder.getInstance().getCompSystem() - .getConcreteComponents()) { - ConcreteComponent c = (ConcreteComponent)o; - if (c.hasDefaultMapping()) { - m_defaultNames.put(c, StringHelper.getInstance().get( - c.getDefaultMapping().getLogicalName(), true)); - } - } - } + } /** * Gets the Component with the given typeName. diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestExecution.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestExecution.java index 4bb423a2a..5c28ca643 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestExecution.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/TestExecution.java @@ -15,12 +15,15 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.collections.MapUtils; +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; @@ -97,6 +100,7 @@ import org.eclipse.jubula.tools.exception.CommunicationException; import org.eclipse.jubula.tools.exception.InvalidDataException; import org.eclipse.jubula.tools.exception.JBException; import org.eclipse.jubula.tools.messagehandling.MessageIDs; +import org.eclipse.jubula.tools.objects.ComponentIdentifier; import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.jubula.tools.objects.event.EventFactory; import org.eclipse.jubula.tools.objects.event.TestErrorEvent; @@ -108,6 +112,7 @@ import org.eclipse.jubula.tools.utils.TimeUtil; import org.eclipse.jubula.tools.xml.businessmodell.Action; import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; import org.eclipse.jubula.tools.xml.businessmodell.Component; +import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.jubula.tools.xml.businessmodell.Param; import org.eclipse.osgi.util.NLS; import org.osgi.framework.Constants; @@ -757,28 +762,28 @@ public class TestExecution { ITestSuitePO ts = (ITestSuitePO)m_trav.getRoot(); IAUTMainPO aut = ts.getAut(); IObjectMappingPO om = aut.getObjMap(); - IObjectMappingPO transientOm = ObjectMappingEventDispatcher. - getObjMapTransient(); + Component comp = compSystem.findComponent(cap.getComponentType()); // Find the component name. It may be overridden in one or // more ExecTestCase nodes. - logicalName = m_compNamesBP.findCompName( - m_trav.getExecStackAsNodeList(), cap, - cap.getComponentName(), - ComponentNamesBP.getInstance()).getCompName(); + if (!StringUtils.isEmpty(cap.getComponentName())) { + logicalName = m_compNamesBP.findCompName( + m_trav.getExecStackAsNodeList(), cap, + cap.getComponentName(), + ComponentNamesBP.getInstance()).getCompName(); + } messageCap.setResolvedLogicalName(logicalName); - IComponentIdentifier technicalName; + IComponentIdentifier technicalName = null; - try { - technicalName = transientOm.getTechnicalName(logicalName); - } catch (LogicComponentNotManagedException e) { - technicalName = om.getTechnicalName(logicalName); + technicalName = getTechnicalName(logicalName, aut, comp); + if (comp.isConcrete() && ((ConcreteComponent)comp) + .hasDefaultMapping()) { + messageCap.sethasDefaultMapping(true); } if (technicalName == null) { throw new LogicComponentNotManagedException( StringConstants.EMPTY, MessageIDs.E_COMPONENT_NOT_MANAGED); } - Component comp = compSystem.findComponent(cap.getComponentType()); Action action = comp.findAction(cap.getActionName()); messageCap.setMethod(action.getMethod()); messageCap.setPostExecutionCommand( @@ -818,6 +823,48 @@ public class TestExecution { } /** + * + * @param logicalName + * guid of the logical name for which to find the technical name + * @param aut + * AUT information + * @param comp + * component + * @return a ComponentIdentifier or null + */ + private IComponentIdentifier getTechnicalName(String logicalName, + IAUTMainPO aut, Component comp) { + IObjectMappingPO om = aut.getObjMap(); + IComponentIdentifier technicalName; + try { + technicalName = om.getTechnicalName(logicalName); + } catch (LogicComponentNotManagedException e) { + technicalName = null; + } + if (technicalName == null && comp instanceof ConcreteComponent) { + ConcreteComponent cc = ((ConcreteComponent) comp); + if (cc.hasDefaultMapping() && cc.getComponentClass() != null) { + Set realizers = cc.getAllRealizers(); + for (Iterator iterator = realizers.iterator(); iterator + .hasNext();) { + ConcreteComponent concreteComponent = + (ConcreteComponent) iterator.next(); + if (aut.getToolkit().equals( + concreteComponent.getToolkitDesriptor() + .getToolkitID())) { + technicalName = new ComponentIdentifier(); + technicalName + .setComponentClassName(concreteComponent + .getComponentClass()); + break; + } + } + } + } + return technicalName; + } + + /** * sets the properties of messageCap * * @param cap cap diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/compcheck/CompletenessGuard.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/compcheck/CompletenessGuard.java index f9f944db9..b7e39583a 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/compcheck/CompletenessGuard.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/compcheck/CompletenessGuard.java @@ -123,7 +123,6 @@ public final class CompletenessGuard { if (metaComponentType instanceof ConcreteComponent && ((ConcreteComponent) metaComponentType) .hasDefaultMapping()) { - setCompletenessObjectMapping(cap, m_aut, true); return true; } diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/CheckIfComponentNameIsReusedOp.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/CheckIfComponentNameIsReusedOp.java index 71574471c..e2fe44edb 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/CheckIfComponentNameIsReusedOp.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/CheckIfComponentNameIsReusedOp.java @@ -56,7 +56,8 @@ public class CheckIfComponentNameIsReusedOp // if (Persistor.isPoSubclass(node, ICapPO.class)) { if (node instanceof ICapPO) { ICapPO cap = (ICapPO)node; - if (cap.getComponentName().equals(m_compNameGuid)) { + if (cap.getComponentName() != null + && cap.getComponentName().equals(m_compNameGuid)) { m_isReused = true; ctx.setContinued(false); return false; diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/FindNodesForComponentNameOp.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/FindNodesForComponentNameOp.java index 5fe87496a..d4bcc25f0 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/FindNodesForComponentNameOp.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/businessprocess/treeoperations/FindNodesForComponentNameOp.java @@ -54,7 +54,7 @@ public class FindNodesForComponentNameOp INodePO node, boolean alreadyVisited) { if (Persistor.isPoSubclass(node, ICapPO.class)) { ICapPO cap = (ICapPO)node; - if (cap.getComponentName().equals(getCompNameGuid())) { + if (getCompNameGuid().equals(cap.getComponentName())) { getNodes().add(cap); } } else if (Persistor.isPoSubclass(node, IExecTestCasePO.class)) { diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/AUTStartedCommand.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/AUTStartedCommand.java index 56c99baa8..21dffed7b 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/AUTStartedCommand.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/AUTStartedCommand.java @@ -10,27 +10,16 @@ *******************************************************************************/ package org.eclipse.jubula.client.core.commands; -import java.util.Iterator; -import java.util.Set; - import org.eclipse.jubula.client.core.AUTEvent; import org.eclipse.jubula.client.core.ClientTestFactory; import org.eclipse.jubula.client.core.IAUTInfoListener; import org.eclipse.jubula.client.core.IClientTest; import org.eclipse.jubula.client.core.businessprocess.ObjectMappingEventDispatcher; import org.eclipse.jubula.client.core.i18n.Messages; -import org.eclipse.jubula.client.core.model.IObjectMappingCategoryPO; -import org.eclipse.jubula.client.core.model.IObjectMappingPO; import org.eclipse.jubula.communication.ICommand; import org.eclipse.jubula.communication.message.AUTStartStateMessage; import org.eclipse.jubula.communication.message.AUTStateMessage; import org.eclipse.jubula.communication.message.Message; -import org.eclipse.jubula.toolkit.common.xml.businessprocess.ComponentBuilder; -import org.eclipse.jubula.tools.i18n.CompSystemI18n; -import org.eclipse.jubula.tools.objects.IComponentIdentifier; -import org.eclipse.jubula.tools.xml.businessmodell.Component; -import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; -import org.eclipse.osgi.util.NLS; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -123,70 +112,13 @@ public class AUTStartedCommand implements ICommand { public void setMessage(Message message) { m_message = (AUTStartStateMessage)message; } - - /** - * Determines the logical name of the passed component. To get a valid - * logical name, the component has to be a <code>ConcreteComponent</code> - * with a default mapping. If not, the method returns <code>null</code>. - * The name of the default mapping is localized. If there is no I18N value, - * <code>DefaultMapping.getLogicalName()</code> is returned. - * - * @param comp - * The component - * @return The logical name or <code>null</code> - */ - private String getLogicalName(Component comp) { - String logicalName = null; - if (comp.isConcrete()) { - ConcreteComponent cc = (ConcreteComponent)comp; - if (cc.hasDefaultMapping()) { - String logicalNameKey = cc.getDefaultMapping().getLogicalName(); - String name = CompSystemI18n.getString(logicalNameKey); - logicalName = name != null ? name : logicalNameKey; - } - } - return logicalName; - } /** * {@inheritDoc} */ public Message execute() { - // The component identifiers returned by the message contain - // information about all components with a default mapping. - // So, their technical and logical names are added to the - // object mapping. This happens whenever the AUT is being started. + ObjectMappingEventDispatcher.clearObjMapTransient(); - IObjectMappingPO transientObjMap = ObjectMappingEventDispatcher. - getObjMapTransient(); - IObjectMappingCategoryPO oldCategory = - ObjectMappingEventDispatcher.getCategoryToCreateIn(); - // sets Category - ObjectMappingEventDispatcher.setCategoryToCreateIn( - transientObjMap.getMappedCategory()); - for (Iterator it = m_message.getCompIds().iterator(); it.hasNext();) { - - IComponentIdentifier id = (IComponentIdentifier)it.next(); - Component comp = ComponentBuilder.getInstance().getCompSystem() - .findComponent(id.getComponentClassName()); - Set<Component> allSyntheticComponents = comp.getAllRealized(); - allSyntheticComponents.add(comp); - for (Component sComponent : allSyntheticComponents) { - String logicalName = getLogicalName(sComponent); - if (logicalName != null) { - // adds new mapping - transientObjMap.addObjectMappingAssoziation( - logicalName, id); - } else { - if (log.isErrorEnabled()) { - log.error(NLS.bind( - Messages.NoLogicalNameForDefaultMapping, - sComponent)); - } - } - } - } - ObjectMappingEventDispatcher.setCategoryToCreateIn(oldCategory); // do this after the OM was build fireAutStateChanged(); diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/CAPRecordedCommand.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/CAPRecordedCommand.java index 72f46582d..7ab264b82 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/CAPRecordedCommand.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/commands/CAPRecordedCommand.java @@ -186,7 +186,8 @@ public class CAPRecordedCommand implements ICommand { ICapPO cap = buildCapPO(messageCap, compType); // GUI updates if (recordListener != null) { - recordListener.capRecorded(cap, messageCap.getCi()); + recordListener.capRecorded(cap, messageCap.getCi(), + messageCap.hasDefaultMapping()); } } @@ -198,17 +199,18 @@ public class CAPRecordedCommand implements ICommand { * not be created. */ private ICapPO buildCapPO(MessageCap messageCap, String componentType) { - String componentName; + String componentName = null; boolean isAppAction = isApplication(componentType); if (isAppAction) { - componentName = messageCap.getCi().generateLogicalName(); + componentName = null; } else { componentName = getOrCreateLogicalName(messageCap); } String actionName = messageCap.getAction().getName(); String capName = null; capName = CompSystemI18n.getString(actionName); - if (isAppAction || messageCap.isWebObservOld()) { + if (isAppAction || messageCap.isWebObservOld() + || messageCap.hasDefaultMapping()) { capName = CompSystemI18n.getString(actionName); } else { capName = CompSystemI18n.getString(actionName); @@ -228,10 +230,13 @@ public class CAPRecordedCommand implements ICommand { // mapper doesn't remove the instance of reuse // for <code>componentName</code>. recCap.setComponentName(null); + try { - ComponentNamesBP.getInstance().setCompName( - recCap, componentName, - CompNameCreationContext.STEP, compNamesMapper); + if (!messageCap.hasDefaultMapping()) { + ComponentNamesBP.getInstance().setCompName( + recCap, componentName, + CompNameCreationContext.STEP, compNamesMapper); + } } catch (IncompatibleTypeException e) { // Should not happen, but if it does, return null to indicate that // the cap was not created successfully. diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CapPO.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CapPO.java index a56945703..ba0e5be18 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CapPO.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/CapPO.java @@ -30,6 +30,7 @@ import org.eclipse.jubula.tools.exception.Assert; import org.eclipse.jubula.tools.xml.businessmodell.Action; import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; import org.eclipse.jubula.tools.xml.businessmodell.Component; +import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.jubula.tools.xml.businessmodell.Param; @@ -181,9 +182,18 @@ class CapPO extends ParamNodePO implements ICapPO { private void validateCAP(String capName, String componentName, String componentType, String actionName) { Validate.notEmpty(capName, Messages.MissingNameForCapPO); - Validate + CompSystem compsys = ComponentBuilder.getInstance().getCompSystem(); + Component comp = compsys.findComponent(componentType); + boolean hasDefaultMapping = false; + if (comp.isConcrete()) { + ConcreteComponent cc = (ConcreteComponent) comp; + hasDefaultMapping = cc.hasDefaultMapping(); + } + if (!hasDefaultMapping) { + Validate .notEmpty(componentName, - Messages.MissingComponentNameForComponent); + Messages.MissingComponentNameForComponent); + } Validate .notEmpty(componentType, Messages.MissingComponentNameForComponent); diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/StringHelper.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/StringHelper.java index bf605078a..b7983d5c4 100644 --- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/StringHelper.java +++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/utils/StringHelper.java @@ -27,7 +27,6 @@ import org.eclipse.jubula.tools.i18n.I18n; import org.eclipse.jubula.tools.xml.businessmodell.Action; import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; import org.eclipse.jubula.tools.xml.businessmodell.Component; -import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.jubula.tools.xml.businessmodell.Param; import org.eclipse.jubula.tools.xml.businessmodell.ValueSetElement; @@ -113,18 +112,6 @@ public class StringHelper { m_map.put(value, compType); } } - if (component.isConcrete()) { - ConcreteComponent cc = (ConcreteComponent)component; - if (cc.hasDefaultMapping()) { - String logicalName = cc.getDefaultMapping() - .getLogicalName(); - if (!m_map.containsKey(logicalName)) { - String value = CompSystemI18n.getString(logicalName); - m_map.put(logicalName, value); - m_map.put(value, logicalName); - } - } - } final List<Action> actions = component.getActions(); for (Action action : actions) { String actionName = action.getName(); diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/propertysources/CapGUIPropertySource.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/propertysources/CapGUIPropertySource.java index b74dbdff8..24b2bc48f 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/propertysources/CapGUIPropertySource.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/propertysources/CapGUIPropertySource.java @@ -42,7 +42,6 @@ import org.eclipse.jubula.client.ui.i18n.Messages; import org.eclipse.jubula.client.ui.rcp.Plugin; import org.eclipse.jubula.client.ui.rcp.businessprocess.WorkingLanguageBP; import org.eclipse.jubula.client.ui.rcp.controllers.PMExceptionHandler; -import org.eclipse.jubula.client.ui.rcp.controllers.propertydescriptors.JBPropertyDescriptor; import org.eclipse.jubula.client.ui.rcp.controllers.propertydescriptors.PopupCompNameTextPropertyDescriptor; import org.eclipse.jubula.client.ui.rcp.editors.IJBEditor; import org.eclipse.jubula.client.ui.rcp.factory.TestDataControlFactory; @@ -309,36 +308,7 @@ public class CapGUIPropertySource extends AbstractNodePropertySource { if (comp.isConcrete()) { final ConcreteComponent concrete = (ConcreteComponent)comp; if (concrete.hasDefaultMapping()) { - ComponentNameController cnc = new ComponentNameController(); - final String logicalName = StringHelper.getInstance().get( - concrete.getDefaultMapping().getLogicalName(), true); - - final IEditorPart activeEditor = Plugin.getActiveEditor(); - // FIXME zeb This looks like a workaround for something - // unnecessary. We should see if we can handle this default - // mapping situation in a more elegant way. - if (activeEditor instanceof IJBEditor - && ((IJBEditor)activeEditor).getEditorHelper() - .getEditSupport().getWorkVersion() - == capPO.getParentNode()) { - IWritableComponentNameMapper mapper = - ((IJBEditor)activeEditor).getEditorHelper() - .getEditSupport().getCompMapper(); - try { - ComponentNamesBP.getInstance().setCompName(capPO, - logicalName, CompNameCreationContext.STEP, - mapper); - cnc.setProperty(logicalName); - pd = new JBPropertyDescriptor( - cnc, P_ELEMENT_DISPLAY_COMPNAME); - } catch (IncompatibleTypeException e) { - ErrorHandlingUtil.createMessageDialog( - e, e.getErrorMessageParams(), null); - } catch (PMException pme) { - PMExceptionHandler.handlePMExceptionForEditor( - pme, (IJBEditor)activeEditor); - } - } + return null; } } if (pd == null) { @@ -405,7 +375,10 @@ public class CapGUIPropertySource extends AbstractNodePropertySource { // Component Type addPropertyDescriptor(getCompTypePropDesc()); // Component Name - addPropertyDescriptor(getCompNamePropDesc()); + IPropertyDescriptor propdesc = getCompNamePropDesc(); + if (propdesc != null) { + addPropertyDescriptor(getCompNamePropDesc()); + } // Action Type addPropertyDescriptor(getActionPropDesc()); // Parameters diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/dialogs/NewCAPDialog.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/dialogs/NewCAPDialog.java index f102ca3eb..39dee7593 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/dialogs/NewCAPDialog.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/dialogs/NewCAPDialog.java @@ -13,10 +13,8 @@ package org.eclipse.jubula.client.ui.rcp.dialogs; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.TitleAreaDialog; @@ -86,8 +84,6 @@ public class NewCAPDialog extends TitleAreaDialog { private DirectCombo <String> m_componentCombo; /** the combo box for the actions */ private DirectCombo <String> m_actionCombo; - /** list of all default names */ - private Set <String>m_defaultNames = new HashSet<String>(); /** The name of the cap */ private String m_capName; /** The type of the component */ @@ -159,27 +155,10 @@ public class NewCAPDialog extends TitleAreaDialog { m_componentNameField.addModifyListener(m_modifyListener); Plugin.getHelpSystem().setHelp(parent, ContextHelpIds.CAP); setHelpAvailable(true); - initDefaultNamesList(); return area; } /** - * initializes a list with all defaultNames - */ - private void initDefaultNamesList() { - m_defaultNames.clear(); - final List concreteComponents = ComponentBuilder.getInstance() - .getCompSystem().getConcreteComponents(); - for (Object o : concreteComponents) { - ConcreteComponent c = (ConcreteComponent)o; - if (c.hasDefaultMapping()) { - m_defaultNames.add(StringHelper.getInstance().get( - c.getDefaultMapping().getLogicalName(), true)); - } - } - } - - /** * {@inheritDoc} */ protected Button createButton(Composite parent, int id, String label, @@ -336,8 +315,6 @@ public class NewCAPDialog extends TitleAreaDialog { ConcreteComponent cc = (ConcreteComponent)component; if (cc.hasDefaultMapping()) { defaultMappingComponent = true; - componentName = StringHelper.getInstance().get( - cc.getDefaultMapping().getLogicalName(), true); } } List<Action> actions = @@ -452,20 +429,20 @@ public class NewCAPDialog extends TitleAreaDialog { isCorrect = false; } - if (m_componentNameField.isEnabled() - && m_defaultNames.contains(m_componentNameField.getText())) { + if (!m_componentNameField.isEnabled()) { defaultName = true; - isCorrect = false; + isCorrect = true; } + String compatibilityErrorMsg = null; + if (!defaultName) { + compatibilityErrorMsg = + ComponentNamesBP.getInstance() + .isCompatible(m_componentCombo.getSelectedObject(), + m_componentNameField.getText(), m_compMapper, + GeneralStorage.getInstance().getProject().getId()); - String compatibilityErrorMsg = - ComponentNamesBP.getInstance().isCompatible( - m_componentCombo.getSelectedObject(), - m_componentNameField.getText(), - m_compMapper, - GeneralStorage.getInstance().getProject().getId()); - + } isCorrect &= compatibilityErrorMsg == null; if (isCorrect) { @@ -475,7 +452,7 @@ public class NewCAPDialog extends TitleAreaDialog { getButton(IDialogConstants.OK_ID).setEnabled(false); if (compatibilityErrorMsg != null) { setErrorMessage(compatibilityErrorMsg); - } else if (componentNameLength == 0) { + } else if (componentNameLength == 0 && !defaultName) { setErrorMessage(Messages.NewCAPDialogEmptyCompName); } else if (defaultName) { setErrorMessage(NLS.bind(Messages.NewCAPDialogReservedCompName, diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java index 4dadf25b5..1961d4b67 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/AbstractTestCaseEditor.java @@ -94,10 +94,13 @@ import org.eclipse.jubula.client.ui.rcp.provider.contentprovider.TestCaseEditorC import org.eclipse.jubula.client.ui.rcp.provider.labelprovider.TooltipLabelProvider; import org.eclipse.jubula.client.ui.utils.CommandHelper; import org.eclipse.jubula.client.ui.utils.ErrorHandlingUtil; +import org.eclipse.jubula.toolkit.common.xml.businessprocess.ComponentBuilder; import org.eclipse.jubula.tools.constants.StringConstants; import org.eclipse.jubula.tools.exception.Assert; import org.eclipse.jubula.tools.exception.ProjectDeletedException; import org.eclipse.jubula.tools.messagehandling.MessageIDs; +import org.eclipse.jubula.tools.xml.businessmodell.Component; +import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.SashForm; @@ -408,7 +411,8 @@ public abstract class AbstractTestCaseEditor extends AbstractJBEditor String compNameGuid = capPo.getComponentName(); IComponentNamePO compNamePo = compNameCache.getCompNamePo(compNameGuid); - if (!compNamePo.getGuid().equals(compNameGuid)) { + if (compNamePo != null + && !compNamePo.getGuid().equals(compNameGuid)) { capPo.setComponentName(compNamePo.getGuid()); } } @@ -518,6 +522,9 @@ public abstract class AbstractTestCaseEditor extends AbstractJBEditor cap.getName()) }); return false; } + if (componentHasDefaultMapping(cap)) { + continue; // there is no component name + } if (cap.getComponentName() == null || StringConstants.EMPTY.equals( cap.getComponentName())) { @@ -527,9 +534,9 @@ public abstract class AbstractTestCaseEditor extends AbstractJBEditor cap.getName()) }); return false; } - if (cap.getComponentName().startsWith(BLANK) - || cap.getComponentName().endsWith(BLANK)) { - ErrorHandlingUtil.createMessageDialog(mId, null, + if (cap.getComponentName().startsWith(BLANK) || cap + .getComponentName().endsWith(BLANK)) { + ErrorHandlingUtil.createMessageDialog(mId, null, new String[] { NLS.bind( Messages.TestCaseEditorWrongCompName2, cap.getName()) }); @@ -555,6 +562,21 @@ public abstract class AbstractTestCaseEditor extends AbstractJBEditor } return checkRefsAndCompNames(testCase); } + + /** + * + * @param cap + * the cap from which wee need the component type + * @return if the component has a default mapping + */ + private boolean componentHasDefaultMapping(ICapPO cap) { + Component component = ComponentBuilder.getInstance() + .getCompSystem().findComponent(cap.getComponentType()); + if (component.isConcrete()) { + return ((ConcreteComponent) component).hasDefaultMapping(); + } + return false; + } /** * {@inheritDoc} diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/TestCaseEditor.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/TestCaseEditor.java index a4ab4c787..40c6470cb 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/TestCaseEditor.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/TestCaseEditor.java @@ -258,7 +258,7 @@ public class TestCaseEditor extends AbstractTestCaseEditor * {@inheritDoc} */ public void capRecorded(final ICapPO newCap, - final IComponentIdentifier ci) { + final IComponentIdentifier ci, final boolean hasDefaultMapping) { if (newCap == null) { ErrorHandlingUtil.createMessageDialog( @@ -278,7 +278,8 @@ public class TestCaseEditor extends AbstractTestCaseEditor // recorded action with default mapping not being // added to objmap if (!ObjectMappingEventDispatcher. - getObjMapTransient().existTechnicalName(ci)) { + getObjMapTransient().existTechnicalName(ci) + && !hasDefaultMapping) { String capComponentName = m_objectMappingManager.addMapping( diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/newcap/NewCAP.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/newcap/NewCAP.java index fa2bfdab5..bf2a97022 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/newcap/NewCAP.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/newcap/NewCAP.java @@ -33,6 +33,10 @@ import org.eclipse.jubula.client.ui.rcp.dialogs.NewCAPDialog; import org.eclipse.jubula.client.ui.rcp.editors.AbstractTestCaseEditor; import org.eclipse.jubula.client.ui.utils.DialogUtils; import org.eclipse.jubula.client.ui.utils.ErrorHandlingUtil; +import org.eclipse.jubula.toolkit.common.xml.businessprocess.ComponentBuilder; +import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; +import org.eclipse.jubula.tools.xml.businessmodell.Component; +import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.handlers.HandlerUtil; @@ -106,13 +110,19 @@ public class NewCAP extends AbstractSelectionBasedHandler { capName, componentName, componentType, action); final IWritableComponentNameMapper compMapper = tse.getEditorHelper().getEditSupport().getCompMapper(); //###BLA + CompSystem compSystem = ComponentBuilder.getInstance() + .getCompSystem(); + Component comp = compSystem.findComponent(componentType); try { // Set the Component Name to null so that the Component Name // mapper doesn't remove the instance of reuse // for <code>componentName</code>. cap.setComponentName(null); - ComponentNamesBP.getInstance().setCompName(cap, componentName, - CompNameCreationContext.STEP, compMapper); + if (comp instanceof ConcreteComponent + && !((ConcreteComponent) comp).hasDefaultMapping()) { + ComponentNamesBP.getInstance().setCompName(cap, componentName, + CompNameCreationContext.STEP, compMapper); + } workTC.addNode(position, cap); tse.getEditorHelper().setDirty(true); DataEventDispatcher.getInstance().fireDataChangedListener(cap, diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/ComponentNamePropertyTester.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/ComponentNamePropertyTester.java index e22e33aeb..bc366b03c 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/ComponentNamePropertyTester.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/propertytester/ComponentNamePropertyTester.java @@ -15,8 +15,6 @@ import org.eclipse.jubula.client.core.model.IProjectPO; import org.eclipse.jubula.client.core.persistence.GeneralStorage; import org.eclipse.jubula.client.ui.propertytester.AbstractBooleanPropertyTester; import org.eclipse.jubula.client.ui.rcp.businessprocess.ComponentNameReuseBP; -import org.eclipse.jubula.toolkit.common.xml.businessprocess.ComponentBuilder; -import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; /** @@ -45,9 +43,6 @@ public class ComponentNamePropertyTester extends AbstractBooleanPropertyTester { if (property.equals(IS_BEING_USED_PROP)) { return testIsBeingUsed(compName); } - if (property.equals(IS_DEFAULT_MAPPING_PROP)) { - return testIsDefaultMapping(compName); - } return false; } @@ -67,19 +62,6 @@ public class ComponentNamePropertyTester extends AbstractBooleanPropertyTester { return true; } - /** - * @param compName The Component Name to test. - * @return <code>true</code> if the Component Name is part of a default - * mapping (ex. Menu, Application). Otherwise <code>false</code>. - */ - private boolean testIsDefaultMapping(IComponentNamePO compName) { - - String name = compName.getName(); - CompSystem compSystem = ComponentBuilder.getInstance().getCompSystem(); - return compSystem.getDefaultMappingNames().containsKey(name); - - } - /** {@inheritDoc} */ public Class<? extends Object> getType() { return IComponentNamePO.class; diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java index c1c8c09a0..32d2ad507 100644 --- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java +++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java @@ -428,7 +428,7 @@ public class Utils { : exec.getSpecTestCase().getUnmodifiableNodeList()) { if (node instanceof ICapPO) { ICapPO cap = (ICapPO)node; - if (cap.getComponentName().equals(name)) { + if (name.equals(cap.getComponentName())) { return cap.getComponentType(); } } else if (node instanceof IExecTestCasePO) { diff --git a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/MessageCap.java b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/MessageCap.java index 8e07ada6b..c3e1ce82c 100644 --- a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/MessageCap.java +++ b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/MessageCap.java @@ -40,7 +40,10 @@ public class MessageCap { /** the resolved(possibly overwritten) logical name */ private String m_resolvedLogicalName; - + + /** if there is no graphical component for this cap*/ + private boolean m_hasDefaultMapping = false; + /** * full qualified name of the command class to execute after test execution * in TestExecution @@ -191,4 +194,18 @@ public class MessageCap { public void setPostExecutionCommand(String postExecutionCommand) { m_postExecutionCommand = postExecutionCommand; } + + /** + * @return if there is not component for this cap + */ + public boolean hasDefaultMapping() { + return m_hasDefaultMapping; + } + + /** + * @param hasDefaultMapping if there is not component for this cap + */ + public void sethasDefaultMapping(boolean hasDefaultMapping) { + this.m_hasDefaultMapping = hasDefaultMapping; + } }
\ No newline at end of file diff --git a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/SendAUTListOfSupportedComponentsMessage.java b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/SendAUTListOfSupportedComponentsMessage.java index 97d444c9c..69c9dcf28 100644 --- a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/SendAUTListOfSupportedComponentsMessage.java +++ b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/SendAUTListOfSupportedComponentsMessage.java @@ -13,6 +13,7 @@ package org.eclipse.jubula.communication.message; import java.util.ArrayList; import java.util.List; +import org.eclipse.jubula.tools.constants.CommandConstants; import org.eclipse.jubula.tools.xml.businessmodell.Component; import org.eclipse.jubula.tools.xml.businessmodell.Profile; @@ -25,7 +26,7 @@ import org.eclipse.jubula.tools.xml.businessmodell.Profile; * @author BREDEX GmbH * @created 04.10.2004 */ -public abstract class SendAUTListOfSupportedComponentsMessage extends Message { +public final class SendAUTListOfSupportedComponentsMessage extends Message { /** static version */ private static final double VERSION = 1.0; @@ -43,7 +44,9 @@ public abstract class SendAUTListOfSupportedComponentsMessage extends Message { } /** {@inheritDoc} */ - public abstract String getCommandClass(); + public String getCommandClass() { + return CommandConstants.SEND_COMPONENTS_COMMAND; + } /** @return The list of <code>Component</code> objects. */ public List getComponents() { diff --git a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/html/SendHtmlAUTListOfSupportedComponentsMessage.java b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/html/SendHtmlAUTListOfSupportedComponentsMessage.java deleted file mode 100644 index b5796a121..000000000 --- a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/html/SendHtmlAUTListOfSupportedComponentsMessage.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.communication.message.html; - -import org.eclipse.jubula.communication.message.SendAUTListOfSupportedComponentsMessage; -import org.eclipse.jubula.tools.constants.CommandConstants; - -/** - * @author BREDEX GmbH - * @created Nov 10, 2009 - * - */ -public class SendHtmlAUTListOfSupportedComponentsMessage extends - SendAUTListOfSupportedComponentsMessage { - - /** {@inheritDoc} */ - public String getCommandClass() { - return CommandConstants.HTML_SEND_COMPONENTS_COMMAND; - } -} diff --git a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swing/SendSwingAUTListOfSupportedComponentsMessage.java b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swing/SendSwingAUTListOfSupportedComponentsMessage.java deleted file mode 100644 index 86f6b0d09..000000000 --- a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swing/SendSwingAUTListOfSupportedComponentsMessage.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.communication.message.swing; - -import org.eclipse.jubula.communication.message.SendAUTListOfSupportedComponentsMessage; -import org.eclipse.jubula.tools.constants.CommandConstants; - -/** - * This message transfers all Jubula components of type - * {@link org.eclipse.jubula.tools.xml.businessmodell.Component} and - * subclasses. the components will be registered in the AUTSwingServer by executing - * <code>SendAUTListOfSupportedComponentsCommand</code>. - * @author BREDEX GmbH - * @created 09.05.2006 - */ -public class SendSwingAUTListOfSupportedComponentsMessage - extends SendAUTListOfSupportedComponentsMessage { - - /** empty constructor for serialisation */ - public SendSwingAUTListOfSupportedComponentsMessage() { - super(); - } - - /** {@inheritDoc} */ - public String getCommandClass() { - return CommandConstants.SWING_SEND_COMPONENTS_COMMAND; - } -}
\ No newline at end of file diff --git a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swt/SendSwtAUTListOfSupportedComponentsMessage.java b/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swt/SendSwtAUTListOfSupportedComponentsMessage.java deleted file mode 100644 index aad71be64..000000000 --- a/org.eclipse.jubula.communication/src/org/eclipse/jubula/communication/message/swt/SendSwtAUTListOfSupportedComponentsMessage.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.communication.message.swt; - -import org.eclipse.jubula.communication.message.SendAUTListOfSupportedComponentsMessage; -import org.eclipse.jubula.tools.constants.CommandConstants; - -/** - * This message transfers all Jubula components of type - * {@link org.eclipse.jubula.tools.xml.businessmodell.Component} and - * subclasses. the components will be registered in the AUTSwtServer by executing - * <code>SendAUTListOfSupportedComponentsCommand</code>. - * @author BREDEX GmbH - * @created 09.05.2006 - */ -public class SendSwtAUTListOfSupportedComponentsMessage - extends SendAUTListOfSupportedComponentsMessage { - - /** empty constructor for serialization */ - public SendSwtAUTListOfSupportedComponentsMessage() { - super(); - } - - /** {@inheritDoc} */ - public String getCommandClass() { - return CommandConstants.SWT_SEND_COMPONENTS_COMMAND; - } -}
\ No newline at end of file diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/AUTServerConfiguration.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/AUTServerConfiguration.java index 9b26519fe..172604b6c 100644 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/AUTServerConfiguration.java +++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/AUTServerConfiguration.java @@ -235,6 +235,47 @@ public class AUTServerConfiguration { implClassName = (String)m_implClassNames.get( currentClass.getName()); } + return createInstance(componentClass.getName(), implClassName, + currentClass.getClassLoader()); + } + + /** + * Returns an instance of the implementation class for + * <code>componentClassName</code>. + * + * @param componentClassName + * the class name of the component, e.g javax.swing.JButton + * @throws UnsupportedComponentException + * If the <code>componentClassName</code> has no registered + * implementation class. + * @throws IllegalArgumentException + * if the <code>componentClassName</code> is <code>null</code>. + * @return An instance of the implementation class. + */ + public Object getImplementationClass(String componentClassName) + throws UnsupportedComponentException, + IllegalArgumentException { + Validate.notNull(componentClassName); + String implClassName = (String)m_implClassNames.get( + componentClassName); + return createInstance(componentClassName, implClassName, null); + } + + /** + * + * @param componentClassName + * the class name of the component + * @param implClassName + * the tester class name of the component + * @param classLoader + * the classloader which should be used + * @return an instance of the tester class, either from the cache or newly + * instantiated + * @throws UnsupportedComponentException + */ + private Object createInstance(String componentClassName, + String implClassName, ClassLoader classLoader) + throws UnsupportedComponentException { if (implClassName != null) { Class implClass = null; Object implInstance = m_implClassCache.get(implClassName); @@ -246,10 +287,10 @@ public class AUTServerConfiguration { log.debug("Loading ImplementationClass: " //$NON-NLS-1$ + "'" + String.valueOf(implClassName) + "'" //$NON-NLS-1$ //$NON-NLS-2$ + " with ClassLoader: " //$NON-NLS-1$ - + "'" + String.valueOf(currentClass.getClassLoader()) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ + + "'" + String.valueOf(classLoader) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ } implClass = loadImplementationClass(implClassName, - currentClass.getClassLoader()); + classLoader); implInstance = implClass.newInstance(); if (!m_implClassCache.containsKey(implClassName)) { m_implClassCache.put(implClassName, implInstance); @@ -267,7 +308,7 @@ public class AUTServerConfiguration { } catch (ClassNotFoundException cnfe) { log.error(cnfe); throw new UnsupportedComponentException( - "component '" + componentClass.getName() //$NON-NLS-1$ + "component '" + componentClassName //$NON-NLS-1$ + "' is not supported: implementation class '" //$NON-NLS-1$ + implClassName + "' not found", MessageIDs.E_COMPONENT_UNSUPPORTED); //$NON-NLS-1$ @@ -275,8 +316,8 @@ public class AUTServerConfiguration { return implInstance; } throw new UnsupportedComponentException( - "component '" + componentClass.getName() //$NON-NLS-1$ - + "' is not supported", MessageIDs.E_COMPONENT_UNSUPPORTED); //$NON-NLS-1$ + "component '" + componentClassName //$NON-NLS-1$ + + "' is not supported", MessageIDs.E_COMPONENT_UNSUPPORTED); //$NON-NLS-1$ } /** diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractCapTestCommand.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractCapTestCommand.java index 18aa3b50a..df28b2950 100644 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractCapTestCommand.java +++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractCapTestCommand.java @@ -110,7 +110,9 @@ public abstract class AbstractCapTestCommand implements ICommand { + (ci == null ? "(none)" : ci.getComponentClassName())); //$NON-NLS-1$ } try { - Validate.notNull(ci); + if (!messageCap.hasDefaultMapping()) { + Validate.notNull(ci); + } // FIXME : Extra handling for waitForComponent and verifyExists int timeout = 500; @@ -127,10 +129,16 @@ public abstract class AbstractCapTestCommand implements ICommand { + "Using default value.", e); //$NON-NLS-1$ } } - Object component = findComponent(ci, timeout); - implClass = AUTServerConfiguration.getInstance() - .prepareImplementationClass(component, component.getClass()); + if (!messageCap.hasDefaultMapping()) { + Object component = findComponent(ci, timeout); + implClass = AUTServerConfiguration.getInstance() + .prepareImplementationClass(component, + component.getClass()); + } else { + implClass = AUTServerConfiguration.getInstance() + .getImplementationClass(ci.getComponentClassName()); + } if (isWaitForComponent) { MessageParam delayParam = (MessageParam)messageCap. getMessageParams().get(1); diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractSendAUTListOfSupportedComponentsCommand.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/SendAUTListOfSupportedComponentsCommand.java index 49adf2f7b..7e85388cc 100644 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/AbstractSendAUTListOfSupportedComponentsCommand.java +++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/commands/SendAUTListOfSupportedComponentsCommand.java @@ -20,14 +20,8 @@ import org.eclipse.jubula.communication.message.AUTStartStateMessage; import org.eclipse.jubula.communication.message.Message; import org.eclipse.jubula.communication.message.SendAUTListOfSupportedComponentsMessage; import org.eclipse.jubula.rc.common.AUTServerConfiguration; -import org.eclipse.jubula.rc.common.components.IComponentFactory; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; -import org.eclipse.jubula.tools.messagehandling.MessageIDs; -import org.eclipse.jubula.tools.objects.ComponentIdentifier; -import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.jubula.tools.xml.businessmodell.Component; import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; -import org.eclipse.jubula.tools.xml.businessmodell.DefaultMapping; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,11 +37,11 @@ import org.slf4j.LoggerFactory; * @created 02.01.2007 * */ -public abstract class AbstractSendAUTListOfSupportedComponentsCommand +public final class SendAUTListOfSupportedComponentsCommand implements ICommand { /** the logger */ private static Logger log = LoggerFactory.getLogger( - AbstractSendAUTListOfSupportedComponentsCommand.class); + SendAUTListOfSupportedComponentsCommand.class); /** the (empty) message */ private SendAUTListOfSupportedComponentsMessage m_message; @@ -66,54 +60,6 @@ public abstract class AbstractSendAUTListOfSupportedComponentsCommand } /** - * Creates a new component identifier and calls - * {@link ComponentHandler#addToHierarchy(IComponentFactory, String, String)} - * The identifier contains information about a default mapped component. - * @param c The component with a default mapping - * @return The identifier - * @throws UnsupportedComponentException If the registration of the default mapping fails - */ - protected IComponentIdentifier createIdentifier(ConcreteComponent c) - throws UnsupportedComponentException { - - DefaultMapping defaultMapping = c.getDefaultMapping(); - String typeFactoryName = defaultMapping.getTypeFactory(); - String technicalName = defaultMapping.getTechnicalName(); - try { - Class typeFactoryClass = Class.forName(typeFactoryName); - IComponentFactory factory = (IComponentFactory)typeFactoryClass - .newInstance(); - addToHierarchy(factory, c, technicalName); - IComponentIdentifier id = new ComponentIdentifier(); - id.setComponentClassName(c.getType()); - id.setSupportedClassName(c.getComponentClass()); - List list = new ArrayList(); - list.add(technicalName); - id.setHierarchyNames(list); - return id; - } catch (ClassNotFoundException e) { - throw new UnsupportedComponentException(e.getMessage(), - MessageIDs.E_CLASS_NOT_FOUND); - } catch (InstantiationException e) { - throw new UnsupportedComponentException(e.getMessage(), - MessageIDs.E_INSTANTIATION); - } catch (IllegalAccessException e) { - throw new UnsupportedComponentException(e.getMessage(), - MessageIDs.E_ILLEGAL_ACCESS); - } - } - - /** - * @param factory factory - * @param c The component with a default mapping - * @param technicalName technicalName - * @throws UnsupportedComponentException . - */ - protected abstract void addToHierarchy(IComponentFactory factory, - ConcreteComponent c, String technicalName) - throws UnsupportedComponentException; - - /** * {@inheritDoc} */ public Message execute() { @@ -141,15 +87,6 @@ public abstract class AbstractSendAUTListOfSupportedComponentsCommand concrete); } - - // Create an identifier for components with a default mapping - // and store in the message (see below). These identifiers - // will be used on the client side to create an object mapping. - if (concrete.hasDefaultMapping()) { - componentIds = addComponentID(componentIds, concrete); - } - } catch (UnsupportedComponentException e) { - log.error("An error occurred while registering a component.", e); //$NON-NLS-1$ } catch (IllegalArgumentException e) { log.error("An error occurred while registering a component.", e); //$NON-NLS-1$ } @@ -159,20 +96,6 @@ public abstract class AbstractSendAUTListOfSupportedComponentsCommand return new AUTStartStateMessage(componentIds); } - /** - * @param componentIds - * the list of compIDs to add - * @param concrete - * the concrete component - * @throws UnsupportedComponentException . - * @return the list of the supported component IDs - */ - protected List addComponentID(List componentIds, ConcreteComponent concrete) - throws UnsupportedComponentException { - componentIds.add(createIdentifier(concrete)); - return componentIds; - } - /** * {@inheritDoc} */ diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/AUTHierarchy.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/AUTHierarchy.java index 4791f2f3a..96ad2dcd4 100644 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/AUTHierarchy.java +++ b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/AUTHierarchy.java @@ -101,22 +101,6 @@ public abstract class AUTHierarchy { } /** - * This method may be used for a component with a default mapping. It - * creates a component instance using the passed factory, creates a new - * <code>SwingHierarchyContainer</code> and adds the container to the internal - * hierarchy map. The technical name is set as the name property of the - * <code>SwingHierarchyContainer</code>. - * @param factory The factory to create a new component - * @param componentName The name of the component to create - * @param technicalName The technical name of the component - * @throws UnsupportedComponentException If the factory fails creating the component - */ - public abstract void addToHierarchy(IComponentFactory factory, - String componentName, - String technicalName) - throws UnsupportedComponentException; - - /** * returns an array of all component identifier of (supported) components, * which are currently instantiated by the AUT. * @attention synchronized in subclasses!!! diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/DefaultComponentFactory.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/DefaultComponentFactory.java deleted file mode 100644 index f17110ed2..000000000 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/DefaultComponentFactory.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.rc.common.components; - -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; -import org.eclipse.jubula.tools.messagehandling.MessageIDs; - - -/** - * Creates a new graphics component by calling the default constructor of the - * component class. No further initialization is performed. - * - * @author BREDEX GmbH - * @created 10.08.2005 - */ -public class DefaultComponentFactory implements IComponentFactory { - /** - * Creates an error message. - * - * @param componentName - * The component name - * @param e - * The exception - * @return The error message - */ - private String createMessage(String componentName, Exception e) { - return "The component '" + componentName //$NON-NLS-1$ - + "' could not be instantiated:" + e.getMessage(); //$NON-NLS-1$ - } - /** - * {@inheritDoc} - */ - public Object createComponent(String componentName) - throws UnsupportedComponentException { - try { - return Class.forName(componentName).newInstance(); - } catch (InstantiationException e) { - throw new UnsupportedComponentException(createMessage( - componentName, e), MessageIDs.E_COMPONENT_NOT_INSTANTIATED); - } catch (IllegalAccessException e) { - throw new UnsupportedComponentException(createMessage( - componentName, e), MessageIDs.E_COMPONENT_NOT_INSTANTIATED); - } catch (ClassNotFoundException e) { - throw new UnsupportedComponentException(createMessage( - componentName, e), MessageIDs.E_COMPONENT_NOT_INSTANTIATED); - } - } -} diff --git a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/IComponentFactory.java b/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/IComponentFactory.java deleted file mode 100644 index f3b9f50b5..000000000 --- a/org.eclipse.jubula.rc.common/src/org/eclipse/jubula/rc/common/components/IComponentFactory.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.rc.common.components; - -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; - -/** - * This interface represents a factory that creates a graphics component - * instance from the passed component class name. Implementors are specified in - * the Jubula configuration file to support the default object mapping. - * - * @author BREDEX GmbH - * @created 10.08.2005 - */ -public interface IComponentFactory { - /** - * Creates a new graphics component instance from the passed name. The - * component name must be equal to the component type specified in the - * Jubula configuration file. - * - * @param componentName - * The component name - * @return The new component - * @throws UnsupportedComponentException - * If the component cannot be created. - */ - public Object createComponent(String componentName) - throws UnsupportedComponentException; -} diff --git a/org.eclipse.jubula.rc.swing/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.swing/META-INF/MANIFEST.MF index f2c236d60..7ec109d87 100644 --- a/org.eclipse.jubula.rc.swing/META-INF/MANIFEST.MF +++ b/org.eclipse.jubula.rc.swing/META-INF/MANIFEST.MF @@ -13,8 +13,7 @@ Require-Bundle: org.apache.commons.beanutils;bundle-version="[1.7.0,2.0.0)", org.eclipse.jubula.tools;bundle-version="[2.2.0,2.3.0)", org.eclipse.jubula.communication;bundle-version="[2.2.0,2.3.0)", org.eclipse.jubula.rc.common;bundle-version="[2.2.0,2.3.0)" -Export-Package: com.bredexsw.guidancer.autserver.swing.implclasses, - org.eclipse.jubula.rc.swing, +Export-Package: org.eclipse.jubula.rc.swing, org.eclipse.jubula.rc.swing.commands, org.eclipse.jubula.rc.swing.components, org.eclipse.jubula.rc.swing.driver, diff --git a/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/GraphicApplication.java b/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/GraphicApplication.java deleted file mode 100644 index e29c6233f..000000000 --- a/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/GraphicApplication.java +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package com.bredexsw.guidancer.autserver.swing.implclasses; - -import java.awt.Component; - -/** - * This class is a dummy graphics component that represents the tested - * application itself. It is used by implementation classes which perform - * general, application wide actions without the need of a special graphics - * component like a button or a textfield. Those actions are key strokes, for - * example. - * - * @author BREDEX GmbH - * @created 08.08.2005 - */ -public class GraphicApplication extends Component { - /* - * IMPORTANT NOTE: This class extends java.awt.Component. This is not - * required from the implementation class/default mapping mechanismn's - * point of view. However, the AUTHierarchy implementation assumes - * AWT components so far. - */ - - /** - * {@inheritDoc} - */ - public boolean isShowing() { - // Always returns true because the "application" itself should - // always be considered visible. - return true; - } -} diff --git a/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/JMenuBarDefaultMapping.java b/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/JMenuBarDefaultMapping.java deleted file mode 100644 index afe7b581f..000000000 --- a/org.eclipse.jubula.rc.swing/src/com/bredexsw/guidancer/autserver/swing/implclasses/JMenuBarDefaultMapping.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package com.bredexsw.guidancer.autserver.swing.implclasses; - -import javax.swing.JMenuBar; - -import org.eclipse.jubula.tools.objects.MappingConstants; - - -/** - * For Default Mapping of Menu. - * - * @author BREDEX GmbH - * @created 14.05.2007 - */ -public class JMenuBarDefaultMapping extends JMenuBar { - - /** - * - */ - public JMenuBarDefaultMapping() { - setName(MappingConstants.MENU_DEFAULTMAPPING_TECHNICAL_NAME); - } - - /** - * {@inheritDoc} - */ - public boolean isShowing() { - return true; - } - - /** - * {@inheritDoc} - */ - public void updateUI() { - // This method is overriden because under some conditions it produces - // NullPointerExceptions. (ClassLoading-Problems?) - // Because of this is only a Default-Mapping Component and not visible - // on the screen, it needs no explicit UI. - } -} diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/commands/SendAUTListOfSupportedComponentsCommand.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/commands/SendAUTListOfSupportedComponentsCommand.java deleted file mode 100644 index 509d0dce3..000000000 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/commands/SendAUTListOfSupportedComponentsCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.rc.swing.commands; - -import org.eclipse.jubula.rc.common.commands.AbstractSendAUTListOfSupportedComponentsCommand; -import org.eclipse.jubula.rc.common.components.IComponentFactory; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; -import org.eclipse.jubula.rc.swing.listener.ComponentHandler; -import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; - - -/** - * The command object for QueryAUTForComponentsMessage. <br> - * - * execute() registers all components sent by the - * <code>QueryAUTForComponentsMessage</code> in the AUT server and returns an - * <code>AUTComponentsMessage</code> containing all components of the AUT - * which are supported. - * - * timeout() should never be called. <br> - * - * @author BREDEX GmbH - * @created 04.10.2004 - */ -public class SendAUTListOfSupportedComponentsCommand - extends AbstractSendAUTListOfSupportedComponentsCommand { - /** {@inheritDoc} */ - protected void addToHierarchy(IComponentFactory factory, - ConcreteComponent c, String technicalName) - throws UnsupportedComponentException { - - ComponentHandler.addToHierarchy(factory, c.getComponentClass(), - technicalName); - } -}
\ No newline at end of file diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/AUTSwingHierarchy.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/AUTSwingHierarchy.java index 9ea10e317..b0f68e8fa 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/AUTSwingHierarchy.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/AUTSwingHierarchy.java @@ -42,9 +42,7 @@ import org.eclipse.jubula.rc.common.AUTServerConfiguration; import org.eclipse.jubula.rc.common.Constants; import org.eclipse.jubula.rc.common.components.AUTHierarchy; import org.eclipse.jubula.rc.common.components.HierarchyContainer; -import org.eclipse.jubula.rc.common.components.IComponentFactory; import org.eclipse.jubula.rc.common.exception.ComponentNotManagedException; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; import org.eclipse.jubula.rc.common.logger.AutServerLogger; import org.eclipse.jubula.rc.swing.SwingAUTServer; import org.eclipse.jubula.rc.swing.listener.ComponentHandler; @@ -184,27 +182,7 @@ public class AUTSwingHierarchy extends AUTHierarchy // addToHierarchy
addToHierarchyDown(getHierarchyContainer(window), window);
}
-
- /**
- * {@inheritDoc}
- */
- public void addToHierarchy(IComponentFactory factory, String componentName,
- String technicalName) throws UnsupportedComponentException {
- Component component = (Component)factory.createComponent(componentName);
- // don't add, if in hierarchy map yet
- if (getRealMap().get(component) != null) {
- return;
- }
- if (getHierarchyContainer(component) != null) {
- return;
- }
- SwingComponent comp = new SwingComponent(component);
- SwingHierarchyContainer container = new SwingHierarchyContainer(comp);
- container.setName(technicalName, true);
- addToHierachyMap(container);
- }
-
/**
* Removes the given window from the hierarchy.
* @param window the window to remove.
@@ -359,7 +337,7 @@ public class AUTSwingHierarchy extends AUTHierarchy if (window != null && window.isShowing() && !window.isActive()) {
window.toFront();
}
- return comp;
+ return comp;
}
throw new ComponentNotManagedException(
"unmanaged component with identifier: '" //$NON-NLS-1$
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/FindSwingComponentBP.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/FindSwingComponentBP.java index 5f2b10630..c74eddb6d 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/FindSwingComponentBP.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/components/FindSwingComponentBP.java @@ -15,8 +15,6 @@ import java.awt.Component; import org.eclipse.jubula.rc.common.components.FindComponentBP; import org.eclipse.jubula.tools.objects.IComponentIdentifier; -import com.bredexsw.guidancer.autserver.swing.implclasses.GraphicApplication; - /** * @author BREDEX GmbH @@ -52,9 +50,6 @@ public class FindSwingComponentBP extends FindComponentBP { */ protected boolean isAvailable(Object currComp) { Component comp = (Component)currComp; - if (comp instanceof GraphicApplication) { - return true; - } return comp.isShowing(); } }
\ No newline at end of file diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/ComponentHandler.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/ComponentHandler.java index 77734082b..488e49014 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/ComponentHandler.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/ComponentHandler.java @@ -22,11 +22,9 @@ import java.util.EventListener; import org.eclipse.jubula.communication.message.ChangeAUTModeMessage; import org.eclipse.jubula.rc.common.AUTServer; -import org.eclipse.jubula.rc.common.components.IComponentFactory; import org.eclipse.jubula.rc.common.exception.ComponentNotFoundException; import org.eclipse.jubula.rc.common.exception.ComponentNotManagedException; import org.eclipse.jubula.rc.common.exception.NoIdentifierForComponentException; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; import org.eclipse.jubula.rc.common.listener.BaseAUTListener; import org.eclipse.jubula.rc.common.logger.AutServerLogger; import org.eclipse.jubula.rc.swing.components.AUTSwingHierarchy; @@ -87,18 +85,6 @@ public class ComponentHandler extends BaseAWTEventListener } } /** - * @param factory factory - * @param componentName componentName - * @param technicalName technicalName - * @throws UnsupportedComponentException UnsupportedComponentException - */ - public static void addToHierarchy(IComponentFactory factory, - String componentName, String technicalName) - throws UnsupportedComponentException { - - autHierarchy.addToHierarchy(factory, componentName, technicalName); - } - /** * returns an array of all componentIdentifier of (supported) components, * which are currently instantiated by the AUT. <br> * delegate to AUTHierarchy.getAllComponentId() diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java index d8056d729..314315a14 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java @@ -40,6 +40,7 @@ import javax.swing.JTree; import javax.swing.text.JTextComponent; import javax.swing.tree.TreePath; +import org.apache.commons.lang.StringUtils; import org.eclipse.jubula.communication.message.CAPRecordedMessage; import org.eclipse.jubula.communication.message.MessageCap; import org.eclipse.jubula.communication.message.MessageParam; @@ -719,9 +720,10 @@ public class RecordActions { messageParam.setValue(value); messageCap.addMessageParam(messageParam); - if (!(logName.equals("default"))) { //$NON-NLS-1$ - messageCap.setLogicalName(logName); - } + } + if (StringUtils.isEmpty(id.getComponentName())) { //$NON-NLS-1$ + messageCap.setLogicalName(logName); + messageCap.sethasDefaultMapping(true); } CAPRecordedMessage capRecMessage = new CAPRecordedMessage(messageCap); diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordHelper.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordHelper.java index 36b43d26a..599fee8f5 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordHelper.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordHelper.java @@ -53,6 +53,7 @@ import org.eclipse.jubula.rc.common.logger.AutServerLogger; import org.eclipse.jubula.rc.common.util.NameValidator; import org.eclipse.jubula.rc.swing.tester.util.TesterUtil; import org.eclipse.jubula.tools.constants.StringConstants; +import org.eclipse.jubula.tools.objects.ComponentIdentifier; import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.jubula.tools.objects.MappingConstants; import org.eclipse.jubula.tools.utils.StringParsing; @@ -166,19 +167,9 @@ public class RecordHelper { * @return the IComponentIdentifier for the default mapping component Menu */ protected IComponentIdentifier getMenuCompID() { - IComponentIdentifier id = null; - IComponentIdentifier[] compIDs = ComponentHandler.getAllComponentId(); - for (int i = 0; i < compIDs.length; i++) { - IComponentIdentifier idIter = compIDs[i]; - if (idIter.getSupportedClassName().equals( - MappingConstants.SWING_MENU_DEFAULT_MAPPING_CLASSNAME)) { - - id = idIter; - id.setComponentClassName(MappingConstants.SWING_MENU_CLASSNAME); - id.setSupportedClassName(MappingConstants.SWING_MENU_CLASSNAME); - break; - } - } + IComponentIdentifier id = new ComponentIdentifier(); + id.setComponentClassName(MappingConstants.SWING_MENU_CLASSNAME); + id.setSupportedClassName(MappingConstants.SWING_MENU_CLASSNAME); return id; } @@ -186,21 +177,11 @@ public class RecordHelper { * @return IComponentIdentifier for the default mapping component Application */ protected IComponentIdentifier getApplicationCompID() { - IComponentIdentifier id = null; - IComponentIdentifier[] compIDs = ComponentHandler.getAllComponentId(); - for (int i = 0; i < compIDs.length; i++) { - IComponentIdentifier idIter = compIDs[i]; - if (idIter.getSupportedClassName().equals( - MappingConstants - .SWING_APPLICATION_CLASSNAME)) { - id = idIter; - id.setComponentClassName(MappingConstants - .SWING_APPLICATION_COMPONENT_IDENTIFIER); - id.setSupportedClassName(MappingConstants + IComponentIdentifier id = new ComponentIdentifier(); + id.setComponentClassName(MappingConstants + .SWING_APPLICATION_COMPONENT_IDENTIFIER); + id.setSupportedClassName(MappingConstants .SWING_APPLICATION_COMPONENT_IDENTIFIER); - break; - } - } return id; } diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/JMenuBarTester.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/JMenuBarTester.java index cbbc96e2b..05d0ec86f 100644 --- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/JMenuBarTester.java +++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/tester/JMenuBarTester.java @@ -122,9 +122,11 @@ public class JMenuBarTester extends AbstractMenuTester { /** * @return the component */ - public IComponent getComponent() { - if (super.getComponent().getRealComponent() instanceof JPopupMenu) { - return super.getComponent(); + public IComponent getComponent() { + IComponent component = super.getComponent(); + if (component != null && component.getRealComponent() + instanceof JPopupMenu) { + return component; } Window activeWindow = WindowHelper.getActiveWindow(); if (activeWindow == null) { diff --git a/org.eclipse.jubula.rc.swt/META-INF/MANIFEST.MF b/org.eclipse.jubula.rc.swt/META-INF/MANIFEST.MF index 3154d89e1..12bfbe16c 100644 --- a/org.eclipse.jubula.rc.swt/META-INF/MANIFEST.MF +++ b/org.eclipse.jubula.rc.swt/META-INF/MANIFEST.MF @@ -14,8 +14,7 @@ Require-Bundle: org.apache.commons.beanutils;bundle-version="[1.7.0,2.0.0)", org.eclipse.jubula.rc.common;bundle-version="[2.2.0,2.3.0)", org.eclipse.swt;bundle-version="[3.3.0,5.0.0)" Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Export-Package: com.bredexsw.guidancer.autswtserver.implclasses, - org.eclipse.jubula.rc.common.adapter, +Export-Package: org.eclipse.jubula.rc.common.adapter, org.eclipse.jubula.rc.swt, org.eclipse.jubula.rc.swt.commands, org.eclipse.jubula.rc.swt.components, diff --git a/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/GraphicApplication.java b/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/GraphicApplication.java deleted file mode 100644 index b2054c581..000000000 --- a/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/GraphicApplication.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package com.bredexsw.guidancer.autswtserver.implclasses; - -import org.eclipse.swt.widgets.Shell; - -/** - * This class is a dummy graphics component that represents the tested - * application itself. It is used by implementation classes which perform - * general, application wide actions without the need of a special graphics - * component like a button or a textfield. Those actions are key strokes, for - * example. - * - * {@inheritDoc} - * - * @author BREDEX GmbH - * @created 20.04.2006 - */ -public class GraphicApplication extends Shell { - // Really empty! - /* - * IMPORTANT NOTE: This class extends org.eclipse.swt.widgets.Shell. - * This is not required from the implementation class/default mapping - * mechanismn's point of view. However, the AUTSWTHierarchy implementation - * assumes SWT components so far. - */ - - /** - * {@inheritDoc} - */ - protected void checkSubclass() { - // do nothing, therefor allowing subclassing - } -}
\ No newline at end of file diff --git a/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/MenuDefaultMapping.java b/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/MenuDefaultMapping.java deleted file mode 100644 index d81331dc6..000000000 --- a/org.eclipse.jubula.rc.swt/src/com/bredexsw/guidancer/autswtserver/implclasses/MenuDefaultMapping.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package com.bredexsw.guidancer.autswtserver.implclasses; - -import org.eclipse.jubula.tools.constants.SwtAUTHierarchyConstants; -import org.eclipse.jubula.tools.objects.MappingConstants; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Shell; - - -/** - * For Default Mapping of Menu. - * This class is a dummy Menu component that represents the Menu in an - * swt-application. It is used by implementation classes which perform - * menu actions - * - * @author BREDEX GmbH - * @created 02.04.2007 - */ -public class MenuDefaultMapping extends Menu { - /** - * Create a new Menu - */ - public MenuDefaultMapping() { - super(new Shell()); - setData(SwtAUTHierarchyConstants.WIDGET_NAME, - MappingConstants.MENU_DEFAULTMAPPING_TECHNICAL_NAME); - } - - /** - * {@inheritDoc} - */ - protected void checkSubclass() { - // do nothing, therefor allowing subclassing - } - -} diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/SendAUTListOfSupportedComponentsCommand.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/SendAUTListOfSupportedComponentsCommand.java deleted file mode 100644 index f3cbda2b3..000000000 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/commands/SendAUTListOfSupportedComponentsCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2010 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 - *******************************************************************************/ -package org.eclipse.jubula.rc.swt.commands; - -import java.util.List; - -import org.eclipse.jubula.rc.common.AUTServer; -import org.eclipse.jubula.rc.common.commands.AbstractSendAUTListOfSupportedComponentsCommand; -import org.eclipse.jubula.rc.common.components.IComponentFactory; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; -import org.eclipse.jubula.rc.swt.SwtAUTServer; -import org.eclipse.jubula.rc.swt.listener.ComponentHandler; -import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * The command object for QueryAUTForComponentsMessage. <br> - * - * execute() registers all components sent by the - * <code>QueryAUTForComponentsMessage</code> in the AUT server and returns an - * <code>AUTComponentsMessage</code> containing all components of the AUT - * which are supported. - * - * timeout() should never be called. <br> - * - * @author BREDEX GmbH - * @created 04.10.2004 - * - */ -public class SendAUTListOfSupportedComponentsCommand - extends AbstractSendAUTListOfSupportedComponentsCommand { - - /** the logger */ - private static Logger log = LoggerFactory.getLogger( - SendAUTListOfSupportedComponentsCommand.class); - /** list of comp IDs */ - private List m_componentIds; - /** concrete component */ - private ConcreteComponent m_concrete; - - /** - * {@inheritDoc} - */ - protected void addToHierarchy(IComponentFactory factory, - ConcreteComponent c, String technicalName) - throws UnsupportedComponentException { - - ComponentHandler.addToHierarchy(factory, c.getComponentClass(), - technicalName); - } - - /** - * {@inheritDoc} - */ - protected List addComponentID(List componentIds, - ConcreteComponent concrete) { - - m_componentIds = componentIds; - m_concrete = concrete; - ((SwtAUTServer)AUTServer.getInstance()).getAutDisplay() - .syncExec(new Runnable() { - public void run() { - try { - m_componentIds.add(createIdentifier(m_concrete)); - } catch (UnsupportedComponentException e) { - log.error(e.getLocalizedMessage(), e); - } - } - }); - return m_componentIds; - } -}
\ No newline at end of file diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/FindSWTComponentBP.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/FindSWTComponentBP.java index cc81e71da..8e00cbd2d 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/FindSWTComponentBP.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/FindSWTComponentBP.java @@ -19,9 +19,6 @@ import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Widget; -import com.bredexsw.guidancer.autswtserver.implclasses.GraphicApplication; - - /** * @author BREDEX GmbH * @created 19.04.2006 @@ -78,9 +75,6 @@ public class FindSWTComponentBP extends FindComponentBP { * {@inheritDoc} */ protected boolean isAvailable(Object currComp) { - if (currComp instanceof GraphicApplication) { - return true; - } if (currComp instanceof Control) { return !((Control)currComp).isDisposed() && ((Control)currComp).isVisible(); diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java index ede667e74..92ec450c9 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/components/SwtAUTHierarchy.java @@ -28,9 +28,7 @@ import org.eclipse.jubula.rc.common.AUTServerConfiguration; import org.eclipse.jubula.rc.common.Constants; import org.eclipse.jubula.rc.common.components.AUTHierarchy; import org.eclipse.jubula.rc.common.components.HierarchyContainer; -import org.eclipse.jubula.rc.common.components.IComponentFactory; import org.eclipse.jubula.rc.common.exception.ComponentNotManagedException; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; import org.eclipse.jubula.rc.common.logger.AutServerLogger; import org.eclipse.jubula.rc.swt.listener.ComponentHandler; import org.eclipse.jubula.rc.swt.utils.SwtUtils; @@ -137,27 +135,7 @@ public class SwtAUTHierarchy extends AUTHierarchy { addToHierarchyDown(hierarchyWindow, window); } - - /** - * {@inheritDoc} - */ - public void addToHierarchy(IComponentFactory factory, String componentName, - String technicalName) throws UnsupportedComponentException { - Widget component = (Widget)factory.createComponent(componentName); - // don't add, if in hierarchy map yet - if (getRealMap().get(component) != null) { - return; - } - if (getHierarchyContainer(component) != null) { - return; - } - SwtComponent comp = new SwtComponent(component); - SwtHierarchyContainer container = new SwtHierarchyContainer(comp); - container.setName(technicalName, true); - addToHierachyMap(container); - } - /** * Removes the given window from the hierarchy. * diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/ComponentHandler.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/ComponentHandler.java index a570bac43..dd44c90d8 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/ComponentHandler.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/ComponentHandler.java @@ -12,14 +12,12 @@ package org.eclipse.jubula.rc.swt.listener; import org.eclipse.jubula.communication.message.ChangeAUTModeMessage; import org.eclipse.jubula.rc.common.AUTServer; -import org.eclipse.jubula.rc.common.components.IComponentFactory; import org.eclipse.jubula.rc.common.driver.IEventThreadQueuer; import org.eclipse.jubula.rc.common.driver.IRunnable; import org.eclipse.jubula.rc.common.exception.ComponentNotFoundException; import org.eclipse.jubula.rc.common.exception.ComponentNotManagedException; import org.eclipse.jubula.rc.common.exception.NoIdentifierForComponentException; import org.eclipse.jubula.rc.common.exception.StepExecutionException; -import org.eclipse.jubula.rc.common.exception.UnsupportedComponentException; import org.eclipse.jubula.rc.common.listener.BaseAUTListener; import org.eclipse.jubula.rc.swt.SwtAUTServer; import org.eclipse.jubula.rc.swt.components.SwtAUTHierarchy; @@ -103,21 +101,7 @@ public class ComponentHandler extends BaseSwtEventListener MessageIDs.E_COMPONENT_ID_CREATION); } } - - /** - * dummy doc see ComponentHandler - * @param factory factory - * @param componentName componentName - * @param technicalName technicalName - * @throws UnsupportedComponentException - */ - public static void addToHierarchy(IComponentFactory factory, - String componentName, String technicalName) - throws UnsupportedComponentException { - autHierarchy.addToHierarchy(factory, componentName, technicalName); - } - /** * returns an array of all componentIdentifier of (supported) components, * which are currently instantiated by the AUT. <br> diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordActionsSWT.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordActionsSWT.java index 4e637d769..969bf09be 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordActionsSWT.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordActionsSWT.java @@ -719,6 +719,8 @@ public class RecordActionsSWT { if (!(logName.equals("default"))) { //$NON-NLS-1$ messageCap.setLogicalName(logName); + } else { + messageCap.sethasDefaultMapping(true); } messageCap.setExtraMessage(extraMsg); diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordHelperSWT.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordHelperSWT.java index 9a5c27893..e849f557b 100644 --- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordHelperSWT.java +++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/listener/RecordHelperSWT.java @@ -19,6 +19,7 @@ import org.eclipse.jubula.rc.common.util.NameValidator; import org.eclipse.jubula.rc.swt.components.FindSWTComponentBP; import org.eclipse.jubula.rc.swt.utils.SwtUtils; import org.eclipse.jubula.tools.constants.StringConstants; +import org.eclipse.jubula.tools.objects.ComponentIdentifier; import org.eclipse.jubula.tools.objects.IComponentIdentifier; import org.eclipse.jubula.tools.objects.MappingConstants; import org.eclipse.jubula.tools.utils.StringParsing; @@ -141,18 +142,9 @@ public class RecordHelperSWT { */ protected IComponentIdentifier getMenuCompID() { IComponentIdentifier id = null; - IComponentIdentifier[] compIDs = ComponentHandler.getAllComponentId(); - for (int i = 0; i < compIDs.length; i++) { - IComponentIdentifier idIter = compIDs[i]; - if (idIter.getSupportedClassName().equals( - MappingConstants.SWT_MENU_DEFAULT_MAPPING_CLASSNAME)) { - - id = idIter; - id.setComponentClassName(MappingConstants.SWT_MENU_CLASSNAME); - id.setSupportedClassName(MappingConstants.SWT_MENU_CLASSNAME); - break; - } - } + id = new ComponentIdentifier(); + id.setSupportedClassName(MappingConstants.SWT_MENU_CLASSNAME); + id.setComponentClassName(MappingConstants.SWT_MENU_CLASSNAME); return id; } @@ -162,52 +154,13 @@ public class RecordHelperSWT { */ protected IComponentIdentifier getApplicationCompID() { IComponentIdentifier id = null; - IComponentIdentifier[] compIds = - ComponentHandler.getAllComponentId(); - for (int i = 0; i < compIds.length; i++) { - IComponentIdentifier idIter = compIds[i]; - if (isDefaultMapping(idIter)) { - id = idIter; - id.setComponentClassName(getDefaultMapping( - id.getSupportedClassName())); - break; - } - } + id = new ComponentIdentifier(); + id.setComponentClassName(MappingConstants + .SWT_APPLICATION_COMPONENT_IDENTIFIER); + id.setSupportedClassName(MappingConstants.SWT_APPLICATION_CLASSNAME); return id; } - - /** - * - * @param supportedClassname The name of the class for which to find the - * default mapping. - * @return a String representing the default mapping for the given - * supported classname. If no default mapping exists, the classname - * itself will be returned. - */ - private String getDefaultMapping(String supportedClassname) { - String mapping = supportedClassname; - if (MappingConstants.SWT_APPLICATION_CLASSNAME.equals( - supportedClassname)) { - - mapping = MappingConstants.SWT_APPLICATION_COMPONENT_IDENTIFIER; - } - - return mapping; - } - - /** - * Checks if the given IComponentIdentifier has a Default-Mapping - * @param id the IComponentIdentifier to check - * @return true in case of Default-Mapping, false otherwise - */ - private boolean isDefaultMapping(IComponentIdentifier id) { - final String supportedClassName = id.getSupportedClassName(); - return supportedClassName.equals(MappingConstants - .SWT_APPLICATION_CLASSNAME) - || supportedClassName.equals(MappingConstants.SWT_MENU_CLASSNAME); - } - /** * get Text of component * @param w Widget @@ -276,7 +229,11 @@ public class RecordHelperSWT { .SWT_MENU_CLASSNAME)) { compsList = AUTServerConfiguration.getInstance() .findComponents( - MappingConstants.SWT_MENU_DEFAULT_MAPPING_CLASSNAME); + MappingConstants.SWT_MENU_DEFAULT_MAPPING_CLASSNAME); + } else if (id.getSupportedClassName().equals( + MappingConstants.SWT_APPLICATION_CLASSNAME)) { + compsList = AUTServerConfiguration.getInstance().findComponents( + MappingConstants.SWT_APPLICATION_CLASSNAME); } else { compsList = AUTServerConfiguration.getInstance() .findComponents(id.getSupportedClassName()); diff --git a/org.eclipse.jubula.toolkit.common/resources/xml/CommonComponentConfiguration.xsd b/org.eclipse.jubula.toolkit.common/resources/xml/CommonComponentConfiguration.xsd index 0522cdba8..e9fbf3b82 100644 --- a/org.eclipse.jubula.toolkit.common/resources/xml/CommonComponentConfiguration.xsd +++ b/org.eclipse.jubula.toolkit.common/resources/xml/CommonComponentConfiguration.xsd @@ -23,21 +23,8 @@ </xs:sequence>
<xs:attribute name="combinable" default="false" use="optional" />
</xs:complexType>
- </xs:element>
- - <xs:element name="defaultMapping"> - <xs:complexType> - <xs:complexContent> - <xs:extension base="typeFactory"> - <xs:attribute name="logicalName" use="required" type="xs:ID"/> - <xs:attribute name="technicalName" use="required"/> - </xs:extension> - </xs:complexContent> - </xs:complexType> </xs:element> - <xs:element name="typeFactory" type="xs:string"/> -
<xs:element name="element">
<xs:complexType>
<xs:attribute name="name" use="required" />
@@ -77,10 +64,4 @@ <xs:element name="realizes" type="xs:string"/>
<xs:element name="extends" type="xs:string"/>
- <xs:complexType name="typeFactory"> - <xs:sequence> - <xs:element ref="typeFactory"/> - </xs:sequence> - </xs:complexType> -
</xs:schema>
\ No newline at end of file diff --git a/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd b/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd index f7e9631a5..02008e71e 100644 --- a/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd +++ b/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd @@ -27,7 +27,6 @@ <xs:element name="toolkitComponent">
<xs:complexType>
<xs:sequence>
- <xs:element minOccurs="0" ref="defaultMapping" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="realizes" />
<xs:element minOccurs="0" maxOccurs="unbounded" ref="extends" />
<xs:element ref="testerClass" />
@@ -43,6 +42,14 @@ </xs:restriction>
</xs:simpleType>
</xs:attribute>
+ <xs:attribute name="hasDefaultMapping" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
<xs:attribute name="observable" default="true">
<xs:simpleType>
<xs:restriction base="xs:token">
@@ -103,29 +110,36 @@ </xs:complexType>
</xs:element>
<xs:element name="concreteComponent">
- <xs:complexType>
- <xs:sequence>
- <xs:element minOccurs="0" ref="defaultMapping"/>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="realizes"/>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="extends"/>
- <xs:element minOccurs="0" maxOccurs="unbounded" ref="action"/>
- </xs:sequence>
- <xs:attribute name="type" use="required" type="xs:ID"/>
- <xs:attribute name="visible" default="true">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- <xs:enumeration value="false"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="changed"/>
- <xs:attribute name="deprecated">
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="true"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
</xs:schema>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="realizes" />
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="extends" />
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="action" />
+ </xs:sequence>
+ <xs:attribute name="type" use="required" type="xs:ID"/>
+ <xs:attribute name="visible" default="true">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="hasDefaultMapping" default="false">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ <xs:enumeration value="false"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="changed"/>
+ <xs:attribute name="deprecated">
+ <xs:simpleType>
+ <xs:restriction base="xs:token">
+ <xs:enumeration value="true"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
diff --git a/org.eclipse.jubula.toolkit.provider.concrete/resources/xml/ComponentConfiguration.xml b/org.eclipse.jubula.toolkit.provider.concrete/resources/xml/ComponentConfiguration.xml index 7adcc3386..2f06f9208 100644 --- a/org.eclipse.jubula.toolkit.provider.concrete/resources/xml/ComponentConfiguration.xml +++ b/org.eclipse.jubula.toolkit.provider.concrete/resources/xml/ComponentConfiguration.xml @@ -14,11 +14,7 @@ <minorVersion>6</minorVersion>
</configVersion>
- <concreteComponent type="guidancer.concrete.GraphicApplication"> - <defaultMapping logicalName="CompSystem.LogicalApplicationName" - technicalName="Application"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping>
+ <concreteComponent type="guidancer.concrete.GraphicApplication" hasDefaultMapping="true">
<action name="CompSystem.ClickInActiveWindow" changed="1.27">
<method>rcClickDirect</method>
<param name="CompSystem.ClickCount">
@@ -458,10 +454,7 @@ <realizes>guidancer.abstract.ButtonComp</realizes>
</concreteComponent>
- <concreteComponent type="guidancer.concrete.MenuBar">
- <defaultMapping technicalName="Menu" logicalName="CompSystem.LogicalMenuName"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping> + <concreteComponent type="guidancer.concrete.MenuBar" hasDefaultMapping="true"> <action name="CompSystem.SelectMenuItem" changed="1.12">
<method>selectMenuItem</method>
<param name="CompSystem.MenuPath">
diff --git a/org.eclipse.jubula.toolkit.provider.html/resources/xml/ComponentConfiguration.xml b/org.eclipse.jubula.toolkit.provider.html/resources/xml/ComponentConfiguration.xml index 1e6a3ab1d..93ff8920b 100644 --- a/org.eclipse.jubula.toolkit.provider.html/resources/xml/ComponentConfiguration.xml +++ b/org.eclipse.jubula.toolkit.provider.html/resources/xml/ComponentConfiguration.xml @@ -237,20 +237,12 @@ <property name="selector" value="input[type=image]" /> </componentClass> </toolkitComponent> - <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.GraphicApplication" visible="false"> - <defaultMapping logicalName="CompSystem.LogicalApplicationName" - technicalName="Application"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping> + <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.GraphicApplication" visible="false" hasDefaultMapping="true"> <realizes>guidancer.concrete.GraphicApplication</realizes> <testerClass>com.bredexsw.jubula.rc.html.web.implclasses.HtmlApplicationImplClass</testerClass> <componentClass name="com.bredexsw.guidancer.webautserver.web.implclasses.GraphicApplication" /> </toolkitComponent> - <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.WebBrowser" visible="true"> - <defaultMapping logicalName="CompSystem.LogicalHtmlApplicationName" - technicalName="Browser"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping> + <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.WebBrowser" visible="true" hasDefaultMapping="true"> <testerClass>com.bredexsw.jubula.rc.html.web.implclasses.HtmlApplicationImplClass</testerClass> <componentClass name="com.bredexsw.guidancer.webautserver.web.implclasses.WebBrowser" /> <action name="html.BrowserGotoAction" changed="1.0"> @@ -296,10 +288,7 @@ </param> </action> </toolkitComponent> - <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.MenuBar" visible="false"> - <defaultMapping technicalName="Menu" logicalName="CompSystem.LogicalMenuName"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping> + <toolkitComponent type="com.bredexsw.guidancer.webautserver.web.implclasses.MenuBar" visible="false" hasDefaultMapping="true"> <realizes>guidancer.concrete.MenuBar</realizes> <testerClass>com.bredexsw.jubula.rc.html.web.implclasses.HtmlMenuBarImplClass</testerClass> <componentClass name="com.bredexsw.guidancer.webautserver.web.implclasses.MenuBar" /> diff --git a/org.eclipse.jubula.toolkit.provider.swing/resources/xml/ComponentConfiguration.xml b/org.eclipse.jubula.toolkit.provider.swing/resources/xml/ComponentConfiguration.xml index 042e06178..c0d598f77 100644 --- a/org.eclipse.jubula.toolkit.provider.swing/resources/xml/ComponentConfiguration.xml +++ b/org.eclipse.jubula.toolkit.provider.swing/resources/xml/ComponentConfiguration.xml @@ -14,11 +14,7 @@ <minorVersion>0</minorVersion>
</configVersion>
<toolkitComponent
- type="com.bredexsw.guidancer.server.implclasses.GraphicApplication" visible="false">
- <defaultMapping logicalName="CompSystem.LogicalApplicationName"
- technicalName="Application">
- <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory>
- </defaultMapping>
+ type="com.bredexsw.guidancer.server.implclasses.GraphicApplication" visible="false" hasDefaultMapping="true">
<realizes>guidancer.concrete.GraphicApplication</realizes>
<testerClass>org.eclipse.jubula.rc.swing.tester.SwingApplicationTester</testerClass>
<componentClass name="com.bredexsw.guidancer.autserver.swing.implclasses.GraphicApplication" />
@@ -30,10 +26,7 @@ <componentClass name="javax.swing.AbstractButton" />
</toolkitComponent>
- <toolkitComponent type="javax.swing.JMenuBar" visible="false">
- <defaultMapping technicalName="Menu" logicalName="CompSystem.LogicalMenuName"> - <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory> - </defaultMapping> + <toolkitComponent type="javax.swing.JMenuBar" visible="false" hasDefaultMapping="true"> <realizes>guidancer.concrete.MenuBar</realizes>
<testerClass>org.eclipse.jubula.rc.swing.tester.JMenuBarTester</testerClass>
<componentClass name="com.bredexsw.guidancer.autserver.swing.implclasses.JMenuBarDefaultMapping" />
diff --git a/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml b/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml index ca99e0107..fbf906bc6 100644 --- a/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml +++ b/org.eclipse.jubula.toolkit.provider.swt/resources/xml/ComponentConfiguration.xml @@ -185,20 +185,13 @@ <componentClass name="org.eclipse.swt.widgets.Button" />
</toolkitComponent>
- <toolkitComponent type="org.eclipse.swt.GraphicApplication" visible="false">
- <defaultMapping logicalName="CompSystem.LogicalApplicationName"
- technicalName="Application">
- <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory>
- </defaultMapping>
+ <toolkitComponent type="org.eclipse.swt.GraphicApplication" visible="false" hasDefaultMapping="true">
<realizes>guidancer.concrete.GraphicApplication</realizes>
<testerClass>org.eclipse.jubula.rc.swt.tester.SwtApplicationTester</testerClass>
<componentClass name="com.bredexsw.guidancer.autswtserver.implclasses.GraphicApplication" />
</toolkitComponent>
- <toolkitComponent type="org.eclipse.swt.widgets.Menu" visible="false">
- <defaultMapping technicalName="Menu" logicalName="CompSystem.LogicalMenuName">
- <typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory>
- </defaultMapping>
+ <toolkitComponent type="org.eclipse.swt.widgets.Menu" visible="false" hasDefaultMapping="true">
<realizes>guidancer.concrete.MenuBar</realizes>
<testerClass>org.eclipse.jubula.rc.swt.tester.MenuTester</testerClass>
<componentClass name="com.bredexsw.guidancer.autswtserver.implclasses.MenuDefaultMapping" />
diff --git a/org.eclipse.jubula.toolkit.provider.win/resources/xml/ComponentConfiguration.xml b/org.eclipse.jubula.toolkit.provider.win/resources/xml/ComponentConfiguration.xml index 71558cab4..e12405c05 100644 --- a/org.eclipse.jubula.toolkit.provider.win/resources/xml/ComponentConfiguration.xml +++ b/org.eclipse.jubula.toolkit.provider.win/resources/xml/ComponentConfiguration.xml @@ -1 +1 @@ -<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2013 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
-->
<!-- CAUTION: don't format any entries, especially don't use line breaks!
The value of the formated item may contain formating characters like tabs or
newlines, making them unusable for class or data lookup!-->
<compSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../jubula/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd">
<configVersion>
<majorVersion>1</majorVersion>
<minorVersion>1</minorVersion>
</configVersion>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.button.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Button" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWPF" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWin32" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWin32" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.checkbox.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.CheckBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.CheckBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.radiobutton.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.RadioButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.RadioButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.edit.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Edit" visible="false">
<realizes>guidancer.concrete.TextComponent</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Edit</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.EditImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Edit</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.EditImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.document.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Document" visible="false">
<realizes>guidancer.concrete.TextComponent</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Document</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DocumentImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Document</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DocumentImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.text.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Text" visible="false">
<realizes>guidancer.concrete.Label</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Text</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TextImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Text</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TextImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.tree.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Tree" visible="false">
<realizes>guidancer.concrete.Tree</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tree</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TreeImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tree</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TreeImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.tab.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Tab" visible="false">
<realizes>guidancer.concrete.TabbedPane</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tab</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TabImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tab</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TabImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.list.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.List" visible="false">
<realizes>guidancer.concrete.List</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.List</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ListWinFormImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.List</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ListWPFImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.table.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Table" visible="false">
<realizes>guidancer.concrete.Table</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Table</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TableWinFormImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Table</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TableWPFImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.combobox.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox" visible="false">
<realizes>guidancer.concrete.ComboBox</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ComboBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ComboBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWPF" />
</toolkitComponent>
<!-- Concrete Components -->
<toolkitComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Application" visible="false">
<defaultMapping technicalName="controltype.Application" logicalName="Application">
<typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory>
</defaultMapping>
<realizes>guidancer.concrete.GraphicApplication</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DotNetApplicationImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.Application" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.menu.aspx -->
<toolkitComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Menu" visible="false">
<defaultMapping technicalName="controltype.Menu" logicalName="CompSystem.LogicalMenuName">
<typeFactory>org.eclipse.jubula.rc.common.components.DefaultComponentFactory</typeFactory>
</defaultMapping>
<realizes>guidancer.concrete.MenuBar</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.MenuImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.Menu" />
</toolkitComponent>
</compSystem>
\ No newline at end of file +<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright (c) 2013 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
-->
<!-- CAUTION: don't format any entries, especially don't use line breaks!
The value of the formated item may contain formating characters like tabs or
newlines, making them unusable for class or data lookup!-->
<compSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../jubula/org.eclipse.jubula.toolkit.common/resources/xml/ToolkitComponentConfiguration.xsd">
<configVersion>
<majorVersion>1</majorVersion>
<minorVersion>1</minorVersion>
</configVersion>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.button.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Button" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWPF" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWin32" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Button</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ButtonWin32" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.checkbox.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.CheckBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.CheckBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.CheckBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.CheckBoxWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.radiobutton.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton" visible="false">
<realizes>guidancer.concrete.Button</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.RadioButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.RadioButton</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.RadioButtonImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.RadioButtonWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.edit.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Edit" visible="false">
<realizes>guidancer.concrete.TextComponent</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Edit</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.EditImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Edit</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.EditImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.EditWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.document.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Document" visible="false">
<realizes>guidancer.concrete.TextComponent</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Document</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DocumentImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Document</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DocumentImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.DocumentWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.text.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Text" visible="false">
<realizes>guidancer.concrete.Label</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Text</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TextImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Text</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TextImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TextWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.tree.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Tree" visible="false">
<realizes>guidancer.concrete.Tree</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tree</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TreeImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tree</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TreeImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TreeWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.tab.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Tab" visible="false">
<realizes>guidancer.concrete.TabbedPane</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tab</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TabImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Tab</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TabImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TabWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.list.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.List" visible="false">
<realizes>guidancer.concrete.List</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.List</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ListWinFormImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.List</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ListWPFImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ListWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.table.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Table" visible="false">
<realizes>guidancer.concrete.Table</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Table</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TableWinFormImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.Table</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.TableWPFImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.TableWPF" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.combobox.aspx -->
<concreteComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox" visible="false">
<realizes>guidancer.concrete.ComboBox</realizes>
</concreteComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWinForm" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ComboBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWinForm" />
</toolkitComponent>
<toolkitComponent type="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWPF" visible="false">
<realizes>org.eclipse.jubula.rc.dotnet.components.controltype.ComboBox</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.ComboBoxImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.ComboBoxWPF" />
</toolkitComponent>
<!-- Concrete Components -->
<toolkitComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Application" visible="false" hasDefaultMapping="true">
<realizes>guidancer.concrete.GraphicApplication</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.DotNetApplicationImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.Application" />
</toolkitComponent>
<!-- referenced to http://msdn.microsoft.com/en-us/library/system.windows.automation.controltype.menu.aspx -->
<toolkitComponent type="org.eclipse.jubula.rc.dotnet.components.controltype.Menu" visible="false" hasDefaultMapping="true">
<realizes>guidancer.concrete.MenuBar</realizes>
<testerClass>com.bredexsw.guidancer.rc.dotnet.implclasses.MenuImplClass</testerClass>
<componentClass name="com.bredexsw.guidancer.rc.dotnet.components.controltype.Menu" />
</toolkitComponent>
</compSystem>
\ No newline at end of file diff --git a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/constants/CommandConstants.java b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/constants/CommandConstants.java index 232076b79..68484a29f 100644 --- a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/constants/CommandConstants.java +++ b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/constants/CommandConstants.java @@ -116,17 +116,9 @@ public abstract class CommandConstants { public static final String WIN_CAP_TEST_COMMAND = "com.bredexsw.guidancer.rc.win.commands.CAPTestCommand"; //$NON-NLS-1$
/** constant: "org.eclipse.jubula.rc.common.commands.ChangeAUTModeCommand" */
public static final String CHANGE_AUT_MODE_COMMAND = "org.eclipse.jubula.rc.common.commands.ChangeAUTModeCommand"; //$NON-NLS-1$
- /** constant: "org.eclipse.jubula.rc.swing.commands.ChangeAUTModeCommand" */
- public static final String SWING_SEND_COMPONENTS_COMMAND = "org.eclipse.jubula.rc.swing.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$
- /** constant: "org.eclipse.jubula.rc.swt.commands.SendAUTListOfSupportedComponentsCommand" */
- public static final String SWT_SEND_COMPONENTS_COMMAND = "org.eclipse.jubula.rc.swt.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$
- /** constant: "com.bredexsw.jubula.rc.html.commands.SendAUTListOfSupportedComponentsCommand" */
- public static final String HTML_SEND_COMPONENTS_COMMAND = "com.bredexsw.jubula.rc.html.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$ - /** constant: "com.bredexsw.guidancer.rc.win.message.SendWinAUTListOfSupportedComponentsMessage" */ - public static final String WIN_SEND_COMPONENTS_COMMAND = "com.bredexsw.guidancer.rc.win.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$
- /** command constant */ - public static final String IOS_SEND_COMPONENTS_COMMAND = "com.bredexsw.guidancer.rc.mobile.ios.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$ - /** constant: "org.eclipse.jubula.client.core.commands.AUTHighlightComponentCommand" */
+ /** constant: "org.eclipse.jubula.rc.swing.commands.ChangeAUTModeCommand" */ + public static final String SEND_COMPONENTS_COMMAND = "org.eclipse.jubula.rc.common.commands.SendAUTListOfSupportedComponentsCommand"; //$NON-NLS-1$ + /** constant: "org.eclipse.jubula.client.core.commands.AUTHighlightComponentCommand" */
public static final String HIGHLIGHT_COMPONENT_COMMAND = "org.eclipse.jubula.client.core.commands.AUTHighlightComponentCommand"; //$NON-NLS-1$
/** constant: "org.eclipse.jubula.client.core.commands.AUTModeChangedCommand" */
public static final String AUT_MODE_CHANGED_COMMAND = "org.eclipse.jubula.client.core.commands.AUTModeChangedCommand"; //$NON-NLS-1$
diff --git a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/utils/generator/XStreamGenerator.java b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/utils/generator/XStreamGenerator.java index 80028e4a1..5189d3a6a 100644 --- a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/utils/generator/XStreamGenerator.java +++ b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/utils/generator/XStreamGenerator.java @@ -16,7 +16,6 @@ import org.eclipse.jubula.tools.xml.businessmodell.CompSystem; import org.eclipse.jubula.tools.xml.businessmodell.Component; import org.eclipse.jubula.tools.xml.businessmodell.ComponentClass; import org.eclipse.jubula.tools.xml.businessmodell.ConcreteComponent; -import org.eclipse.jubula.tools.xml.businessmodell.DefaultMapping; import org.eclipse.jubula.tools.xml.businessmodell.Param; import org.eclipse.jubula.tools.xml.businessmodell.ParamValueSet; import org.eclipse.jubula.tools.xml.businessmodell.Property; @@ -78,8 +77,8 @@ public class XStreamGenerator { stream.alias("concreteComponent", ConcreteComponent.class); //$NON-NLS-1$ stream.aliasField("type", ConcreteComponent.class, "m_type"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("testerClass", ConcreteComponent.class, "m_testerClass"); //$NON-NLS-1$ //$NON-NLS-2$ - stream.aliasField("defaultMapping", ConcreteComponent.class, "m_defaultMapping"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("visible", ConcreteComponent.class, "m_visible"); //$NON-NLS-1$ //$NON-NLS-2$ + stream.aliasField("hasDefaultMapping", ConcreteComponent.class, "m_hasDefaultMapping"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("observable", ConcreteComponent.class, "m_observable"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("changed", ConcreteComponent.class, "m_changed"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("deprecated", ConcreteComponent.class, "m_deprecated"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -92,12 +91,7 @@ public class XStreamGenerator { stream.alias("property", Property.class); //$NON-NLS-1$ stream.aliasField("name", Property.class, "m_name"); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("value", Property.class, "m_value"); //$NON-NLS-1$ //$NON-NLS-2$ - - stream.alias("defaultMapping", DefaultMapping.class); //$NON-NLS-1$ - stream.aliasField("typeFactory", DefaultMapping.class, "m_typeFactory"); //$NON-NLS-1$ //$NON-NLS-2$ - stream.aliasField("logicalName", DefaultMapping.class, "m_logicalName"); //$NON-NLS-1$ //$NON-NLS-2$ - stream.aliasField("technicalName", DefaultMapping.class, "m_technicalName"); //$NON-NLS-1$ //$NON-NLS-2$ - + aliasActionClass(stream); stream.addImplicitCollection(Action.class, "m_params", "param", Param.class); //$NON-NLS-1$ //$NON-NLS-2$ stream.aliasField("name", Param.class, "m_name"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -128,7 +122,7 @@ public class XStreamGenerator { new String[] {"m_type", "m_visible", "m_observable", "m_changed", "m_deprecated"})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ stream.registerConverter(XStreamXmlAttributeConverter.create(stream, ConcreteComponent.class, - new String[] {"m_type", "m_visible", "m_observable", "m_changed", "m_deprecated"})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ + new String[] {"m_type", "m_visible", "m_observable", "m_changed", "m_deprecated", "m_hasDefaultMapping"})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ stream.registerConverter(XStreamXmlAttributeConverter.create(stream, Action.class, new String[] {"m_name", "m_clientAction", "m_deprecated", "m_changed"})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ @@ -138,9 +132,6 @@ public class XStreamGenerator { stream.registerConverter(XStreamXmlAttributeConverter.create(stream, ParamValueSet.class, "m_isCombinable")); //$NON-NLS-1$ stream.registerConverter(XStreamXmlAttributeConverter.create(stream, - DefaultMapping.class, new String[] { "m_logicalName", //$NON-NLS-1$ - "m_technicalName" })); //$NON-NLS-1$ - stream.registerConverter(XStreamXmlAttributeConverter.create(stream, ValueSetElement.class, new String[] { "m_name", "m_value" })); //$NON-NLS-1$//$NON-NLS-2$ stream.registerConverter(XStreamXmlAttributeConverter.create(stream, ConfigVersion.class, new String[] { "m_majorV", //$NON-NLS-1$ diff --git a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/CompSystem.java b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/CompSystem.java index a699cc0de..a4f2e6904 100644 --- a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/CompSystem.java +++ b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/CompSystem.java @@ -80,9 +80,6 @@ public class CompSystem { /** A List of all DataTypes */ private Set m_dataTypes = null; - /** All Component Names wich have a default mapping (Name => Type) */ - private Map m_defaultMappingNames = null; - /** Default constructor */ public CompSystem() { init(); @@ -547,7 +544,6 @@ public class CompSystem { handleDepender(component); } validateComponents(); - collectDefaultMappingNames(); for (Iterator it = getAbstractComponents().iterator(); it.hasNext();) { Component component = (Component)it.next(); @@ -678,31 +674,6 @@ public class CompSystem { } /** - * Collects all default mapping logical names. - */ - private void collectDefaultMappingNames() { - m_defaultMappingNames = new HashMap(); - final List concreteComponents = getConcreteComponents(); - for (Iterator it = concreteComponents.iterator(); it.hasNext();) { - final ConcreteComponent concComp = (ConcreteComponent)it.next(); - if (concComp.hasDefaultMapping()) { - final String technicalName = concComp.getDefaultMapping() - .getTechnicalName(); - final String componentType = concComp.getType(); - m_defaultMappingNames.put(technicalName, componentType); - } - } - } - - /** - * - * @return the default mapping logical names. - */ - public final Map getDefaultMappingNames() { - return m_defaultMappingNames; - } - - /** * * @param type a Component Type. * @return The Component of the given Component Type or null if no diff --git a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/ConcreteComponent.java b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/ConcreteComponent.java index 017ed43df..c2ed72b90 100644 --- a/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/ConcreteComponent.java +++ b/org.eclipse.jubula.tools/src/org/eclipse/jubula/tools/xml/businessmodell/ConcreteComponent.java @@ -34,8 +34,11 @@ public class ConcreteComponent extends Component { /** The testerClass of the component. */ private String m_testerClass; - /** The default mapping. */ - private DefaultMapping m_defaultMapping;
+ /** + * the information if for this component exists no real component so we are + * calling the tester class directly + */ + private boolean m_hasDefaultMapping; /** @return Returns the testerClass. */ public String getTesterClass() { @@ -86,18 +89,10 @@ public class ConcreteComponent extends Component { public boolean isConcrete() { return true; } - - /** - * @return The default mapping or <code>null</code>, if the component has - * not default mapping. - */ - public DefaultMapping getDefaultMapping() { - return m_defaultMapping; - } - - /** @return <code>true</code> if the component has a default mapping */ + + /** @return <code>true</code> if the component has no component */ public boolean hasDefaultMapping() { - return m_defaultMapping != null; + return m_hasDefaultMapping; } /** @return Returns the componentClass. */ |
