summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn F. Cook2011-08-18 18:53:23 (EDT)
committerRyan D. Brooks2011-08-18 18:53:23 (EDT)
commite6d079d4d5d3ed4dac66edaa46cc3ca48350c111 (patch)
tree3afd6ab564d227cc07059e06de84624ae5cc8b3c
parentfa6cecfed1074c745b5d0a3967b3118a31ac172d (diff)
downloadorg.eclipse.osee-e6d079d4d5d3ed4dac66edaa46cc3ca48350c111.zip
org.eclipse.osee-e6d079d4d5d3ed4dac66edaa46cc3ca48350c111.tar.gz
org.eclipse.osee-e6d079d4d5d3ed4dac66edaa46cc3ca48350c111.tar.bz2
refinement[ats_6YQSV]: Perform validation before allowing commit
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidateReqChangeReport.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java17
2 files changed, 19 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidateReqChangeReport.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidateReqChangeReport.java
index b02d3ce..5e2b207 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidateReqChangeReport.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidateReqChangeReport.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.util.validate;
import java.util.Set;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.util.XResultData;
@@ -30,6 +31,13 @@ public class ValidateReqChangeReport {
Operations.executeAsJob(operation, true);
}
+ public static String performValidation(TeamWorkFlowArtifact teamArt, Set<AttributeSetRule> attributeSetRules, Set<RelationSetRule> relationSetRules) throws OseeCoreException {
+ XResultData resultData = new XResultData(false);
+ ValidationReportOperation operation =
+ new ValidationReportOperation(resultData, teamArt, attributeSetRules, relationSetRules);
+ return operation.performValidation();
+ }
+
static void reportStatus(XResultData rd, IStatus status) {
String message = status.getMessage();
switch (status.getSeverity()) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
index fa7adf2..3842b09 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
@@ -21,6 +21,7 @@ import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.util.AtsBranchManager;
import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.CompositeOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
@@ -64,12 +65,7 @@ public class ValidationReportOperation extends AbstractOperation {
rd.log("<b>Artifact Validation Checks: </b> All Errors reported must be fixed.");
rd.log("<br><br><b>NOTE: </b>All errors are shown for artifact state on branch or at time of commit. Select hyperlink to open most recent version of artifact.");
try {
- ChangeData changeData = AtsBranchManager.getChangeDataFromEarliestTransactionId(teamArt);
- Collection<Artifact> changedArtifacts =
- changeData.getArtifacts(KindType.ArtifactOrRelation, ModificationType.NEW, ModificationType.MODIFIED);
-
- runOperations(changedArtifacts, rd);
-
+ performValidation();
rd.log("Validation Complete");
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
@@ -92,6 +88,15 @@ public class ValidationReportOperation extends AbstractOperation {
});
}
+ public String performValidation() throws OseeCoreException {
+ ChangeData changeData = AtsBranchManager.getChangeDataFromEarliestTransactionId(teamArt);
+ Collection<Artifact> changedArtifacts =
+ changeData.getArtifacts(KindType.ArtifactOrRelation, ModificationType.NEW, ModificationType.MODIFIED);
+
+ runOperations(changedArtifacts, rd);
+ return rd.toString();
+ }
+
private void runOperations(Collection<Artifact> itemsToCheck, XResultData rd) {
List<IOperation> operations = new ArrayList<IOperation>();
operations.add(new AttributeRuleCheckOperation(itemsToCheck, rd, attributeSetRules));