Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAchim Loerke2012-03-13 05:26:20 -0400
committerGerrit Code Review @ Eclipse.org2012-03-13 05:26:20 -0400
commit344a662620dc5c3804e600843d75f830c73f7ec0 (patch)
tree2766bc2bdd56a7632332bd6879ec2e95aa1e583c /org.eclipse.jubula.client.analyze.impl.standard
parent49da943019a533b736341544854b490fbf759be5 (diff)
parentffb9c9524c44749b174f7954fa4b1a69ae0a4843 (diff)
downloadorg.eclipse.jubula.core-344a662620dc5c3804e600843d75f830c73f7ec0.tar.gz
org.eclipse.jubula.core-344a662620dc5c3804e600843d75f830c73f7ec0.tar.xz
org.eclipse.jubula.core-344a662620dc5c3804e600843d75f830c73f7ec0.zip
Merge "fixed the the problem, that this metric counted nodes from reused projects"
Diffstat (limited to 'org.eclipse.jubula.client.analyze.impl.standard')
-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