Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2015-08-10 09:36:38 +0000
committerMarvin Mueller2015-08-10 09:54:46 +0000
commitbf7cd327a54f6c83fe34d86cc71bd1c8dfd10eea (patch)
treef9a581ca8eb248b78b81c130f39c845dafbb6b84
parent86537c1cac9ff8af6b2f589bf14643aadd585af5 (diff)
downloadorg.eclipse.jubula.core-bf7cd327a54f6c83fe34d86cc71bd1c8dfd10eea.tar.gz
org.eclipse.jubula.core-bf7cd327a54f6c83fe34d86cc71bd1c8dfd10eea.tar.xz
org.eclipse.jubula.core-bf7cd327a54f6c83fe34d86cc71bd1c8dfd10eea.zip
Sprint task - Fix for http://eclip.se/472028
Modifing Open/Show specification to mange new generated nodes, which have no backing node context.
-rw-r--r--org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/NodeMaker.java14
-rw-r--r--org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/UINodeBP.java8
-rw-r--r--org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/editors/TestResultViewer.java2
-rw-r--r--org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/provider/labelprovider/TestResultTreeViewLabelProvider.java8
4 files changed, 25 insertions, 7 deletions
diff --git a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/NodeMaker.java b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/NodeMaker.java
index a65ad0704..bc59b1033 100644
--- a/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/NodeMaker.java
+++ b/org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/model/NodeMaker.java
@@ -379,6 +379,20 @@ public abstract class NodeMaker {
String tsGuid, String autId) {
return new RefTestSuitePO(name, tsGuid, autId);
}
+
+ /**
+ * creates a TestCasePO (which could be a {@link ISpecTestCasePO} or {@link IExecTestCasePO} but we do not know.
+ * This is needed for the TestResult since we only have the name and the UUID of the {@link INodePO}.
+ * @param name the name
+ * @param uuid the guid
+ * @return a TestCasePO which is generated and has only a name and a uuid
+ */
+ public static ITestCasePO createTransientTestCasePO(String name,
+ String uuid) {
+ return new TestCasePO(name, uuid, true) {
+ // empty since this should only be a transient object used for TestResults
+ };
+ }
/**
* get the class instance of NodePO (needed by Persistor)
diff --git a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/UINodeBP.java b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/UINodeBP.java
index ba374df3b..082e8e24b 100644
--- a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/UINodeBP.java
+++ b/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/UINodeBP.java
@@ -22,8 +22,11 @@ import org.eclipse.jubula.client.core.events.InteractionEventDispatcher;
import org.eclipse.jubula.client.core.model.IExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
+import org.eclipse.jubula.client.core.model.ITestCasePO;
import org.eclipse.jubula.client.core.model.NodeMaker;
import org.eclipse.jubula.client.core.model.TestResultNode;
+import org.eclipse.jubula.client.core.persistence.GeneralStorage;
+import org.eclipse.jubula.client.core.persistence.NodePM;
/**
@@ -71,6 +74,11 @@ public class UINodeBP {
} else if (firstElement instanceof TestResultNode) {
TestResultNode trNode = (TestResultNode)firstElement;
INodePO nodePO = trNode.getNode();
+ if (nodePO instanceof ITestCasePO
+ && !(nodePO instanceof IExecTestCasePO)) {
+ nodePO = NodePM.getNode(GeneralStorage.getInstance()
+ .getProject().getId(), nodePO.getGuid());
+ }
while (!(nodePO instanceof IExecTestCasePO)) {
trNode = trNode.getParent();
if (trNode == null) {
diff --git a/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/editors/TestResultViewer.java b/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/editors/TestResultViewer.java
index e05ac64e9..98fe299fe 100644
--- a/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/editors/TestResultViewer.java
+++ b/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/editors/TestResultViewer.java
@@ -274,7 +274,7 @@ public class TestResultViewer extends EditorPart implements ISelectionProvider,
.getInternalActionName()
: StringConstants.SPACE);
case TestresultSummaryBP.TYPE_TEST_CASE:
- return NodeMaker.createSpecTestCasePO(
+ return NodeMaker.createTransientTestCasePO(
result.getKeywordName(),
result.getInternalKeywordGuid());
case TestresultSummaryBP.TYPE_TEST_SUITE:
diff --git a/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/provider/labelprovider/TestResultTreeViewLabelProvider.java b/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/provider/labelprovider/TestResultTreeViewLabelProvider.java
index 8e62cbff3..8e6dee82f 100644
--- a/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/provider/labelprovider/TestResultTreeViewLabelProvider.java
+++ b/org.eclipse.jubula.client.ui/src/org/eclipse/jubula/client/ui/provider/labelprovider/TestResultTreeViewLabelProvider.java
@@ -20,7 +20,7 @@ import org.eclipse.jubula.client.core.model.ICapPO;
import org.eclipse.jubula.client.core.model.IEventExecTestCasePO;
import org.eclipse.jubula.client.core.model.IExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
-import org.eclipse.jubula.client.core.model.ISpecTestCasePO;
+import org.eclipse.jubula.client.core.model.ITestCasePO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
import org.eclipse.jubula.client.core.model.TestResultNode;
import org.eclipse.jubula.client.ui.constants.IconConstants;
@@ -66,14 +66,10 @@ public class TestResultTreeViewLabelProvider extends LabelProvider {
Image image = null;
if (node instanceof ITestSuitePO) {
image = IconConstants.TS_IMAGE;
- } else if (node instanceof ISpecTestCasePO) {
+ } else if (node instanceof ITestCasePO) {
image = IconConstants.TC_IMAGE;
- }
- if (node instanceof IExecTestCasePO) {
if (node instanceof IEventExecTestCasePO) {
image = IconConstants.RESULT_EH_IMAGE;
- } else {
- image = IconConstants.TC_IMAGE;
}
}
if (node instanceof ICapPO) {

Back to the top