Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Struckmann2014-10-20 14:48:31 +0000
committerSebastian Struckmann2014-10-20 14:48:39 +0000
commita53457563249e5375631c93aa6e68d20175236c8 (patch)
tree74a011c6dfa0949351be0263e7a8878ce8315d7f /org.eclipse.jubula.toolkit.api.gen
parentb70df8aadd79d0b0c29787aef0b0812ea432f1b5 (diff)
downloadorg.eclipse.jubula.core-a53457563249e5375631c93aa6e68d20175236c8.tar.gz
org.eclipse.jubula.core-a53457563249e5375631c93aa6e68d20175236c8.tar.xz
org.eclipse.jubula.core-a53457563249e5375631c93aa6e68d20175236c8.zip
Sprint task - Java API - Added use of pseudo component identifier for components with default mapping
Diffstat (limited to 'org.eclipse.jubula.toolkit.api.gen')
-rw-r--r--org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet23
1 files changed, 22 insertions, 1 deletions
diff --git a/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet b/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
index 0fe02eb38..02c07dbf2 100644
--- a/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
+++ b/org.eclipse.jubula.toolkit.api.gen/templates/ClassGenerator.javajet
@@ -51,9 +51,15 @@ if (specInfo instanceof ComponentGenInfo) {
}
}
String testerClass = "";
+ String componentClassName = "";
+ Boolean hasComponentClass = false;
if (component instanceof ConcreteComponent) {
ConcreteComponent concreteComponent = (ConcreteComponent)component;
testerClass = concreteComponent.getTesterClass();
+ componentClassName = concreteComponent.getComponentClass().getName();
+ if (!componentClassName.isEmpty()) {
+ hasComponentClass = true;
+ }
}
%>
/*******************************************************************************
@@ -117,6 +123,19 @@ public <%if (genInterface) {%>interface<%} else {%>class<%}%> <%=className%>
}<%}%>
<%}%>
<%}%>
+
+ <%if (!genInterface) {%>
+ protected IComponentIdentifier getPseudoComponentIdentifier() {
+ <%if (hasComponentClass) {%>
+ org.eclipse.jubula.tools.internal.objects.ComponentIdentifier pseudoIdentifier =
+ new org.eclipse.jubula.tools.internal.objects.ComponentIdentifier();
+ pseudoIdentifier.setComponentClassName("<%=componentClassName%>");
+ return pseudoIdentifier;
+ <%} else {%>
+ return null;
+ <%}%>
+ }<%}%>
+
<%
if (superActions != null) {
// generate only methods for non-inherited actions
@@ -153,7 +172,9 @@ public <%if (genInterface) {%>interface<%} else {%>class<%}%> <%=className%>
messageCap.setMethod("<%=action.getMethod()%>");
messageCap.sethasDefaultMapping(<%=hasDefaultMapping%>);
<%if (!hasDefaultMapping) {%>
- messageCap.setCi(m_componentIdentifier);<%}%>
+ messageCap.setCi(m_componentIdentifier);
+ <%} else {%>
+ messageCap.setCi(getPseudoComponentIdentifier());<%}%>
<%for (Param parameter : params) {
String paramName = parameter.getName();%>
<%String translatedParamName = nameLoader.translateFromCompSystem(paramName);%>

Back to the top