Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2011-07-27 23:40:46 +0000
committerRyan D. Brooks2011-07-27 23:40:46 +0000
commit6f2478437bcd3e047ca61d4acb5c8838e5c568f5 (patch)
treeb4722cb9adb296dd98c6ba1e1712a67faa5317fb /plugins/org.eclipse.osee.define
parentd5132035e4ecfa151a82ec77178c31d69fae48fc (diff)
downloadorg.eclipse.osee-6f2478437bcd3e047ca61d4acb5c8838e5c568f5.tar.gz
org.eclipse.osee-6f2478437bcd3e047ca61d4acb5c8838e5c568f5.tar.xz
org.eclipse.osee-6f2478437bcd3e047ca61d4acb5c8838e5c568f5.zip
feature: Create Detailed Test Status report
Diffstat (limited to 'plugins/org.eclipse.osee.define')
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/RequirementStatus.java86
1 files changed, 86 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/RequirementStatus.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/RequirementStatus.java
new file mode 100644
index 00000000000..e61c2788b1b
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/RequirementStatus.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.define.traceability.report;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.framework.core.model.IBasicUser;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class RequirementStatus implements Comparable<RequirementStatus> {
+ private final String requirementName;
+ private final String legacyId;
+ private final String swEnhancement;
+ private final StringBuilder partitionStatuses;
+ private final List<Integer> percents;
+ private final HashSet<IBasicUser> testPocs;
+
+ public RequirementStatus(String requirementName, String legacyId, String swEnhancement) {
+ this.requirementName = requirementName;
+ this.legacyId = legacyId;
+ this.swEnhancement = swEnhancement;
+ this.partitionStatuses = new StringBuilder();
+ this.percents = new LinkedList<Integer>();
+ this.testPocs = new HashSet<IBasicUser>();
+ }
+
+ public void addPartitionStatus(int percentComplete, String partition, String resolution) {
+ if (partition == null) {
+ System.out.println("Missing partiton for " + requirementName + ": " + legacyId);
+ partition = "";
+ }
+ partitionStatuses.append(partition);
+ partitionStatuses.append(':');
+ partitionStatuses.append(resolution);
+ partitionStatuses.append(' ');
+ percents.add(percentComplete);
+ }
+
+ public String getPartitionStatuses() {
+ return partitionStatuses.toString();
+ }
+
+ public int getRolledupPercentComplete() {
+ int total = 0;
+ for (int percent : percents) {
+ total += percent;
+ }
+ return total / percents.size();
+ }
+
+ public void setTestPocs(Collection<IBasicUser> poc) {
+ testPocs.addAll(poc);
+ }
+
+ public HashSet<IBasicUser> getTestPocs() {
+ return testPocs;
+ }
+
+ public String getLegacyId() {
+ return legacyId;
+ }
+
+ @Override
+ public int compareTo(RequirementStatus status) {
+ if (legacyId == null) {
+ return -1;
+ }
+ return legacyId.compareTo(status.legacyId);
+ }
+
+ public String getSwEnhancement() {
+ return swEnhancement;
+ }
+} \ No newline at end of file

Back to the top