diff options
Diffstat (limited to 'org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet')
-rw-r--r-- | org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet b/org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet index 9323b41e8..772847db1 100644 --- a/org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet +++ b/org.eclipse.jubula.client.api.converter/templates/NodeGenerator.javajet @@ -16,6 +16,7 @@ imports="java.util.* org.eclipse.jubula.client.core.model.IProjectPO org.eclipse.jubula.client.core.model.IRefTestSuitePO org.eclipse.jubula.client.core.model.ISpecTestCasePO + org.eclipse.jubula.client.core.model.ITestJobPO org.eclipse.jubula.client.core.model.ITestSuitePO org.eclipse.jubula.client.ui.rcp.Plugin org.eclipse.jubula.toolkit.api.gen.internal.utils.NameLoader @@ -26,6 +27,7 @@ imports="java.util.* org.eclipse.jubula.tools.internal.xml.businessmodell.ConcreteComponent org.eclipse.jubula.tools.internal.xml.businessmodell.CompSystem org.eclipse.jubula.tools.internal.xml.businessmodell.Component + org.eclipse.jubula.client.api.converter.annotations.NodeType org.slf4j.Logger org.slf4j.LoggerFactory" class="NodeGenerator"%> @@ -38,6 +40,8 @@ INodePO node = info.getNode(); String uuid = node.getGuid(); String comment = node.getComment(); boolean hasComment = StringUtils.isNotBlank(comment); +String taskId = node.getTaskId(); +boolean hasTaskId = StringUtils.isNotBlank(taskId); Locale locale = info.getLanguage(); Iterator<INodePO> iterator = node.getNodeListIterator(); String packageBase = info.getPackageBasePath(); @@ -59,6 +63,16 @@ try { String fqName = Utils.getFullyQualifiedTranslatedName(node, packageBase, projectName); String packageName = StringUtils.substringBeforeLast(fqName, StringConstants.DOT); String ctdsPath = Utils.getProjectPath(info.getPackageBasePath(), projectName); + +NodeType type = NodeType.UNKNOWN; +if (node instanceof ISpecTestCasePO) { + type = NodeType.TEST_CASE; +} else if (node instanceof ITestJobPO) { + type = NodeType.TEST_JOB; +} else if (node instanceof ITestSuitePO) { + type = NodeType.TEST_SUITE; +} + %> package <%=packageName%>; @@ -68,11 +82,11 @@ import org.eclipse.jubula.client.api.converter.annotations.NodeType; import <%=ctdsPath%>.CTDS; -<%if (hasComment) {%>/** <%=comment%> */<%}%> @SrcNode(UUID = "<%=uuid%>", - type = NodeType.UNKNOWN) + type = NodeType.<%=type%><%if (hasTaskId) {%>, taskId = "<%=taskId%>"<%}%>) public class <%=className%> { + <%if (hasComment) {%>/** <%=comment%> */<%}%> public static void execute( <%if (node instanceof ISpecTestCasePO) { ISpecTestCasePO tc = (ISpecTestCasePO) node; @@ -90,6 +104,10 @@ public class <%=className%> { <%while (iterator.hasNext()) { INodePO child = iterator.next(); boolean isActive = child.isActive(); + comment = child.getComment(); + hasComment = StringUtils.isNotBlank(comment); + + if (hasComment) {%>// <%=comment%><%} if (child instanceof ICapPO) { ICapPO cap = (ICapPO) child; String componentFromCap = cap.getComponentType(); @@ -99,11 +117,11 @@ public class <%=className%> { String componentNameToCreate; String factoryName; ConcreteComponent cc = null; - CompSystem compSystem = ComponentBuilder.getInstance().getCompSystem(); - Component c = compSystem.getComponentForType(componentFromCap); - if (c instanceof ConcreteComponent) { - cc = (ConcreteComponent)c; - } + CompSystem compSystem = ComponentBuilder.getInstance().getCompSystem(); + Component c = compSystem.getComponentForType(componentFromCap); + if (c instanceof ConcreteComponent) { + cc = (ConcreteComponent)c; + } if (hasDefaultMapping) { String toolkitID = info.getDefaultToolkit(); factoryName = Utils.getFactoryName(toolkitID); @@ -259,7 +277,7 @@ public class <%=className%> { log.error(e.getLocalizedMessage()); } testSuiteName = Utils.getFullyQualifiedTranslatedName(testSuite, packageBase, projectName);%> - + <%if (!isActive) {%>/* <%}%><%=testSuiteName%>.execute();<%if (!isActive) {%>*/<%}%> <%}%> |