Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hotzan2012-03-13 06:33:59 -0400
committerVolker Hotzan2012-03-13 06:33:59 -0400
commit114a3c4acd8649a5eb183e88720920e95dcf0c00 (patch)
tree7c4bc0392782076da5e816d134a031eab7adba66 /org.eclipse.jubula.client.analyze.impl.standard
parent050f9d817ec190c06163f3de4d917e01da2133d9 (diff)
downloadorg.eclipse.jubula.core-114a3c4acd8649a5eb183e88720920e95dcf0c00.tar.gz
org.eclipse.jubula.core-114a3c4acd8649a5eb183e88720920e95dcf0c00.tar.xz
org.eclipse.jubula.core-114a3c4acd8649a5eb183e88720920e95dcf0c00.zip
Refactored the NumericalProjectElementCounter metric. Changed the counting of Test Case References, Event Handlers and Test Steps from transitive to direct counting
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, 15 insertions, 10 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 4928b487c..5254b8716 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
@@ -52,6 +52,7 @@ public class NumericalProjectElementCounter implements IAnalyze {
*/
static class CountElementOperation extends
AbstractNonPostOperatingTreeNodeOperation<INodePO> {
+
/**
* This Map is used to save the amount of the different NodeTypes
*/
@@ -76,10 +77,6 @@ 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;
}
@@ -92,14 +89,22 @@ public class NumericalProjectElementCounter implements IAnalyze {
}
Class<? extends INodePO> nodeType = null;
- if (node instanceof ICategoryPO || node instanceof ISpecTestCasePO
- || node instanceof ICapPO || node instanceof ITestSuitePO
- || node instanceof IExecTestCasePO
+ if (node instanceof ICategoryPO
+ || node instanceof ISpecTestCasePO
+ || node instanceof ITestSuitePO
|| node instanceof ITestJobPO
- || node instanceof IRefTestSuitePO
- || node instanceof IEventExecTestCasePO) {
+ || node instanceof IRefTestSuitePO) {
nodeType = node.getClass();
}
+
+ if (node instanceof IEventExecTestCasePO
+ || node instanceof ICapPO
+ || node instanceof IExecTestCasePO) {
+
+ if (!(parent instanceof IExecTestCasePO)) {
+ nodeType = node.getClass();
+ }
+ }
if (nodeType != null) {
Integer ccount = getAmount().get(nodeType);
@@ -240,4 +245,4 @@ public class NumericalProjectElementCounter implements IAnalyze {
tt.traverse(true);
}
}
-}
+} \ No newline at end of file

Back to the top