Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-08-04 12:12:37 -0400
committerdonald.g.dunne2017-08-08 16:49:50 -0400
commit138653a49097fcf8eaeeab14963cd644a12faa53 (patch)
tree452917abb3b264c95aaf47159328d43986cde4cc
parent9f2b95a0b66999a77378febbf33e64ce620089a0 (diff)
downloadorg.eclipse.osee-ats_decision_fail.tar.gz
org.eclipse.osee-ats_decision_fail.tar.xz
org.eclipse.osee-ats_decision_fail.zip
debugging: Attempt to catch TranstionManagerTest failure (do not review)ats_decision_fail
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java11
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java37
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java4
5 files changed, 52 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
index bd9c46bb0e..21e973a7cb 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
@@ -16,6 +16,7 @@ import java.util.List;
import java.util.Map;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.workdef.ITransitionResult;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.util.result.XResultData;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -31,6 +32,12 @@ public class TransitionResults {
private final Map<IAtsWorkItem, List<ITransitionResult>> workItemToResults =
new HashMap<IAtsWorkItem, List<ITransitionResult>>();
+ private TransactionId transactionId;
+
+ public TransactionId getTransactionId() {
+ return transactionId;
+ }
+
public void addResult(IAtsWorkItem workItem, ITransitionResult result) {
List<ITransitionResult> results = workItemToResults.get(workItem);
if (results == null) {
@@ -145,4 +152,8 @@ public class TransitionResults {
return workItemToResults;
}
+ public void setTransactionId(TransactionId transactionId) {
+ this.transactionId = transactionId;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.client.integration.tests/META-INF/MANIFEST.MF
index 3e268e2d15..b751e7fe12 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/META-INF/MANIFEST.MF
@@ -136,6 +136,7 @@ Import-Package: com.google.common.collect,
org.eclipse.osee.framework.ui.ws,
org.eclipse.osee.jaxrs,
org.eclipse.osee.jaxrs.client,
+ org.eclipse.osee.logger,
org.eclipse.osee.orcs.rest.model,
org.eclipse.osee.orcs.rest.model.writer.reader,
org.eclipse.osee.support.test.util,
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
index f7ba72b9b3..2fedd15b38 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/review/DecisionReviewDefinitionManagerTest.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.client.integration.tests.ats.core.client.review;
import java.util.Arrays;
+import java.util.List;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.JaxAtsWorkDef;
@@ -29,7 +30,11 @@ import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.core.workflow.transition.TransitionFactory;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.ws.AWorkspace;
import org.junit.AfterClass;
import org.junit.Assert;
@@ -62,7 +67,7 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + WORK_DEF_FILE_NAME);
}
@@ -77,7 +82,8 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
TeamState.Implement.getName(), Arrays.asList(AtsClientService.get().getUserService().getCurrentUser()), null,
changes, TransitionOption.None);
IAtsTransitionManager transitionMgr = TransitionFactory.getTransitionManager(helper);
- TransitionResults results = transitionMgr.handleAllAndPersist();
+ TransitionResults results =
+ transitionAndLogResults("testCreateDecisionReviewDuringTransition_ToDecision", transitionMgr);
Assert.assertTrue(results.toString(), results.isEmpty());
Assert.assertFalse(teamArt.isDirty());
@@ -108,7 +114,7 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
jaxWorkDef.setName(AtsTestUtil.WORK_DEF_NAME);
jaxWorkDef.setWorkDefDsl(atsDsl);
AtsTestUtil.importWorkDefinition(jaxWorkDef);
- AtsClientService.get().getWorkDefinitionService().clearCaches();
+ AtsClientService.get().clearCaches();
} catch (Exception ex) {
throw new OseeCoreException(ex, "Error importing " + WORK_DEF_FILE_NAME_PREPARE);
}
@@ -120,9 +126,10 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
MockTransitionHelper helper = new MockTransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
TeamState.Implement.getName(), Arrays.asList(AtsClientService.get().getUserService().getCurrentUser
- ()), null, changes, TransitionOption.None);
+ ()), null, changes, TransitionOption.None);
IAtsTransitionManager transitionMgr = TransitionFactory.getTransitionManager(helper);
- TransitionResults results = transitionMgr.handleAllAndPersist();
+ TransitionResults results =
+ transitionAndLogResults("testCreateDecisionReviewDuringTransition_Prepare", transitionMgr);
Assert.assertTrue(results.toString(), results.isEmpty());
@@ -141,4 +148,24 @@ public class DecisionReviewDefinitionManagerTest extends DecisionReviewDefinitio
AtsTestUtil.validateArtifactCache();
}
+ private TransitionResults transitionAndLogResults(String testName, IAtsTransitionManager transitionMgr) {
+ System.err.println("entering test " + testName);
+ TransitionResults results = transitionMgr.handleAllAndPersist();
+ TransactionId transId = results.getTransactionId();
+ System.err.println(String.format("transaction record [%s]", transId));
+ List<ArtifactId> artIds = AtsClientService.get().getQueryService().getArtifactIdsFromQuery(
+ "Select * From Osee_Txs Txs, Osee_Artifact Art Where Branch_Id = 570 And Transaction_Id = ? And Mod_Type = 1 And" //
+ + " Txs.Gamma_Id = Art.Gamma_Id",
+ transId);
+ System.err.println(String.format("Artifact Ids %s", artIds));
+ if (artIds.isEmpty()) {
+ Artifact artifactFromId =
+ ArtifactQuery.getArtifactFromId(artIds.iterator().next(), AtsClientService.get().getAtsBranch());
+ AtsClientService.get().getLogger().error("Artifact %s Type %s", artifactFromId.toStringWithId(),
+ artifactFromId.getArtifactType());
+ }
+ System.err.println("leaving test " + testName + " with results " + results);
+ return results;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
index 026a9c6df4..bf79cfde56 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/workflow/transition/TransitionManagerTest.java
@@ -90,6 +90,11 @@ public class TransitionManagerTest {
}
@BeforeClass
+ public static void before() throws OseeCoreException {
+ AtsClientService.get().clearCaches();
+ }
+
+ @BeforeClass
@AfterClass
public static void cleanup() throws OseeCoreException {
AtsTestUtil.cleanup();
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
index 91e8b15f8a..6d85fd21e8 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
@@ -49,6 +49,7 @@ import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.ats.core.workflow.WorkflowManagerCore;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
+import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -583,7 +584,8 @@ public class TransitionManager implements IAtsTransitionManager, IExecuteListene
public TransitionResults handleAllAndPersist() {
TransitionResults result = handleAll();
if (result.isEmpty()) {
- helper.getChangeSet().execute();
+ TransactionId transactionId = helper.getChangeSet().execute();
+ result.setTransactionId(transactionId);
}
return result;
}

Back to the top