Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hotzan2012-03-07 13:13:31 +0000
committerVolker Hotzan2012-03-07 13:13:31 +0000
commitffb9c9524c44749b174f7954fa4b1a69ae0a4843 (patch)
treeb2a44a9efc78da461bccd9850fc25f059ad97299
parent0de631fbd19b2c05ca3932cc273e3608a412bd8b (diff)
downloadorg.eclipse.jubula.core-ffb9c9524c44749b174f7954fa4b1a69ae0a4843.tar.gz
org.eclipse.jubula.core-ffb9c9524c44749b174f7954fa4b1a69ae0a4843.tar.xz
org.eclipse.jubula.core-ffb9c9524c44749b174f7954fa4b1a69ae0a4843.zip
fixed the the problem, that this metric counted nodes from reused projects
-rw-r--r--org.eclipse.jubula.client.analyze.impl.standard/src/org/eclipse/jubula/client/analyze/impl/standard/analyze/NumericalProjectElementCounter.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/org.eclipse.jubula.client.analyze.impl.standard/src/org/eclipse/jubula/client/analyze/impl/standard/analyze/NumericalProjectElementCounter.java b/org.eclipse.jubula.client.analyze.impl.standard/src/org/eclipse/jubula/client/analyze/impl/standard/analyze/NumericalProjectElementCounter.java
index a14c4242f..4928b487c 100644
--- a/org.eclipse.jubula.client.analyze.impl.standard/src/org/eclipse/jubula/client/analyze/impl/standard/analyze/NumericalProjectElementCounter.java
+++ b/org.eclipse.jubula.client.analyze.impl.standard/src/org/eclipse/jubula/client/analyze/impl/standard/analyze/NumericalProjectElementCounter.java
@@ -22,7 +22,6 @@ import org.eclipse.jubula.client.analyze.internal.AnalyzeResult;
import org.eclipse.jubula.client.analyze.internal.helper.ProjectContextHelper;
import org.eclipse.jubula.client.core.model.ICapPO;
import org.eclipse.jubula.client.core.model.ICategoryPO;
-import org.eclipse.jubula.client.core.model.IComponentNamePO;
import org.eclipse.jubula.client.core.model.IEventExecTestCasePO;
import org.eclipse.jubula.client.core.model.IExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
@@ -77,18 +76,31 @@ public class NumericalProjectElementCounter implements IAnalyze {
public boolean operate(ITreeTraverserContext<INodePO> ctx,
INodePO parent, INodePO node, boolean alreadyVisited) {
+ // if (ProjectContextHelper.getObjContType().equals("project")) {
+ // System.out.println(GeneralStorage.getInstance().getProject().getId()
+ // + " " + node.getClass() + " " + node.getName() + " " +
+ // node.getParentProjectId());
+ if (node instanceof IProjectPO) {
+ return !alreadyVisited;
+ }
+ long currentProjectID = GeneralStorage.getInstance().getProject()
+ .getId();
+ long nodeParentProjectID = node.getParentProjectId();
+
+ if (currentProjectID != nodeParentProjectID) {
+ return alreadyVisited;
+ }
+
Class<? extends INodePO> nodeType = null;
- if (node instanceof ICategoryPO
- || node instanceof ISpecTestCasePO
- || node instanceof ICapPO
- || node instanceof ITestSuitePO
+ if (node instanceof ICategoryPO || node instanceof ISpecTestCasePO
+ || node instanceof ICapPO || node instanceof ITestSuitePO
|| node instanceof IExecTestCasePO
|| node instanceof ITestJobPO
|| node instanceof IRefTestSuitePO
- || node instanceof IComponentNamePO
|| node instanceof IEventExecTestCasePO) {
nodeType = node.getClass();
}
+
if (nodeType != null) {
Integer ccount = getAmount().get(nodeType);
if (ccount == null) {
@@ -105,7 +117,6 @@ public class NumericalProjectElementCounter implements IAnalyze {
}
return !alreadyVisited;
}
-
/**
* @return The AmountMap containing the amounts of the different NodeTypes
*/

Back to the top