Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.ats.config.demo.test')
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/.classpath7
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/.project28
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/META-INF/MANIFEST.MF11
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/build.properties4
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/PopulateActionsTest.java492
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/Populate_DemoDb_Suite.java57
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfigTest.java158
-rw-r--r--plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDbGroupsTest.java53
8 files changed, 810 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/.classpath b/plugins/org.eclipse.osee.ats.config.demo.test/.classpath
new file mode 100644
index 00000000000..ad32c83a788
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/.project b/plugins/org.eclipse.osee.ats.config.demo.test/.project
new file mode 100644
index 00000000000..ebb4ba08892
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.ats.config.demo.test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.config.demo.test/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..7e23b57a3d7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ATS Config Demo Test
+Bundle-SymbolicName: org.eclipse.osee.ats.config.demo.test
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: The Boeing Company
+Fragment-Host: org.eclipse.osee.ats.config.demo
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.eclipse.osee.ats.config.demo,
+ org.eclipse.osee.ats.config.demo.config
+Require-Bundle: org.junit4;bundle-version="4.8.1"
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/build.properties b/plugins/org.eclipse.osee.ats.config.demo.test/build.properties
new file mode 100644
index 00000000000..34d2e4d2dad
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/PopulateActionsTest.java b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/PopulateActionsTest.java
new file mode 100644
index 00000000000..ce729ba6ff2
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/PopulateActionsTest.java
@@ -0,0 +1,492 @@
+/*
+ * Created on May 25, 2011
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.config.demo;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.config.demo.config.DemoDbUtil;
+import org.eclipse.osee.ats.core.config.AtsBulkLoad;
+import org.eclipse.osee.ats.core.config.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.core.review.AbstractReviewArtifact;
+import org.eclipse.osee.ats.core.review.DecisionReviewArtifact;
+import org.eclipse.osee.ats.core.review.DecisionReviewState;
+import org.eclipse.osee.ats.core.review.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.core.review.PeerToPeerReviewState;
+import org.eclipse.osee.ats.core.review.ReviewManager;
+import org.eclipse.osee.ats.core.task.TaskArtifact;
+import org.eclipse.osee.ats.core.task.TaskStates;
+import org.eclipse.osee.ats.core.team.TeamState;
+import org.eclipse.osee.ats.core.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
+import org.eclipse.osee.ats.core.type.AtsAttributeTypes;
+import org.eclipse.osee.ats.core.workflow.ActionArtifact;
+import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.ats.util.DemoTestUtil;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.support.test.util.DemoArtifactTypes;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.eclipse.osee.support.test.util.DemoTeam;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class PopulateActionsTest {
+ @BeforeClass
+ public static void validateDbInit() throws OseeCoreException {
+ DemoDbUtil.checkDbInitAndPopulateSuccess();
+ }
+
+ @Before
+ public void setup() {
+ AtsBulkLoad.reloadConfig(true);
+ }
+
+ @org.junit.Test
+ public void testSawBuild2Action1() throws OseeCoreException {
+ // {@link DemoDbActionData.getReqSawActionsData()} - 1
+ String title = "SAW (committed) Reqt Changes for Diagram View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ // test teams
+ Assert.assertEquals(3, action.getTeams().size());
+ TeamWorkFlowArtifact codeTeamArt = null;
+ int numTested = 0;
+ for (TeamWorkFlowArtifact teamArt : action.getTeams()) {
+ teamArt.getActionableItemsDam().getActionableItemGuids();
+ if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Code")) {
+ numTested++;
+ codeTeamArt = teamArt;
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Code", "Joe Smith", DemoArtifactTypes.DemoCodeTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Code));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Test")) {
+ numTested++;
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Test", "Kay Jones", DemoArtifactTypes.DemoTestTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Test));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Req")) {
+ numTested++;
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Requirements", "Joe Smith", DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Requirements));
+ }
+ }
+ Assert.assertEquals(3, numTested);
+ Assert.assertNotNull(codeTeamArt);
+ // test reviews
+ Assert.assertEquals("Should only be two reviews", 2, ReviewManager.getReviews(codeTeamArt).size());
+ PeerToPeerReviewArtifact rev1 = null;
+ PeerToPeerReviewArtifact rev2 = null;
+ for (AbstractReviewArtifact revArt : ReviewManager.getReviews(codeTeamArt)) {
+ if (revArt.getName().contains("algorithm")) {
+ rev1 = (PeerToPeerReviewArtifact) revArt;
+ } else {
+ rev2 = (PeerToPeerReviewArtifact) revArt;
+ }
+ }
+ Assert.assertNotNull(rev1);
+ Assert.assertNotNull(rev2);
+ testReviewContents(rev1, "Peer Review algorithm used in code", PeerToPeerReviewState.Review.getPageName(),
+ "Joe Smith; Kay Jones");
+ testReviewContents(rev2, "Peer Review first set of code changes", PeerToPeerReviewState.Prepare.getPageName(),
+ "Joe Smith");
+ // test tasks
+ List<String> taskNames = new ArrayList<String>();
+ taskNames.addAll(DemoTestUtil.getTaskTitles(true));
+ for (TaskArtifact task : codeTeamArt.getTaskArtifacts()) {
+ testTaskContents(task, TaskStates.InWork.getPageName(), TeamState.Implement.getPageName());
+ taskNames.remove(task.getName());
+ task.getStateMgr().getAssigneesStr().equals("Joe Smith; Kay Jones");
+ }
+ Assert.assertEquals(
+ String.format("Not all tasks exist for [%s]; [%s] remain", codeTeamArt.toStringWithId(), taskNames), 0,
+ taskNames.size());
+ }
+
+ @org.junit.Test
+ public void testSawBuild2Action2() throws OseeCoreException {
+ // {@link DemoDbActionData.getReqSawActionsData()} - 2
+ String title = "SAW (uncommitted) More Reqt Changes for Diagram View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(4, action.getTeams().size());
+ TeamWorkFlowArtifact codeTeam = null, designTeam = null;
+ int numTested = 0;
+ for (TeamWorkFlowArtifact teamArt : action.getTeams()) {
+ if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Code")) {
+ numTested++;
+
+ codeTeam = teamArt;
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Code", "Joe Smith", DemoArtifactTypes.DemoCodeTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Code));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Test")) {
+ numTested++;
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Test", "Kay Jones", DemoArtifactTypes.DemoTestTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Test));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Req")) {
+ numTested++;
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Requirements", "Joe Smith", DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Requirements));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Design")) {
+ numTested++;
+
+ designTeam = teamArt;
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW SW Design", "Kay Jones", AtsArtifactTypes.TeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_SW_Design));
+ }
+ }
+ Assert.assertEquals(4, numTested);
+ // test code team 1 review and 6 tasks
+ // - test review
+ Assert.assertNotNull(codeTeam);
+ Collection<AbstractReviewArtifact> reviews = ReviewManager.getReviews(codeTeam);
+ Assert.assertEquals(1, reviews.size());
+ PeerToPeerReviewArtifact revArt = (PeerToPeerReviewArtifact) reviews.iterator().next();
+ testReviewContents(revArt, "Review new logic", PeerToPeerReviewState.Completed.getPageName(), "");
+
+ // - test tasks
+ List<String> taskNames = new ArrayList<String>();
+ taskNames.addAll(DemoTestUtil.getTaskTitles(false));
+ for (TaskArtifact task : codeTeam.getTaskArtifacts()) {
+ testTaskContents(task, TaskStates.InWork.getPageName(), TeamState.Implement.getPageName());
+ taskNames.remove(task.getName());
+ task.getStateMgr().getAssigneesStr().equals("Joe Smith");
+ }
+ Assert.assertEquals(
+ String.format("Not all tasks exist for [%s]; [%s] remain", codeTeam.toStringWithId(), taskNames), 0,
+ taskNames.size());
+
+ // test sw_design 1 peer and 1 decision review
+ testSwDesign1PeerAnd1DecisionReview(designTeam);
+
+ }
+
+ @org.junit.Test
+ public void testSawBuild2Action3() throws OseeCoreException {
+ // {@link DemoDbActionData.getReqSawActionsData()} - 3
+ String title = "SAW (no-branch) Even More Requirement Changes for Diagram View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(4, action.getTeams().size());
+ Assert.assertEquals(4, action.getTeams().size());
+ TeamWorkFlowArtifact designTeam = null;
+ int numTested = 0;
+ for (TeamWorkFlowArtifact teamArt : action.getTeams()) {
+ if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Code")) {
+ numTested++;
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Code", "Joe Smith", DemoArtifactTypes.DemoCodeTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Code));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Test")) {
+ numTested++;
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Test", "Kay Jones", DemoArtifactTypes.DemoTestTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Test));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Req")) {
+ numTested++;
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Requirements", "Joe Smith", DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Requirements));
+ } else if (teamArt.getActionableItemsDam().getActionableItemsStr().contains("Design")) {
+ numTested++;
+
+ designTeam = teamArt;
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW SW Design", "Kay Jones", AtsArtifactTypes.TeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_SW_Design));
+ }
+ }
+ Assert.assertEquals(4, numTested);
+ // test sw_design 1 peer and 1 decision review
+ testSwDesign1PeerAnd1DecisionReview(designTeam);
+
+ }
+
+ @org.junit.Test
+ public void testSawBuild2Action4() throws OseeCoreException {
+ // {@link DemoDbActionData.getReqSawActionsData()} - 4
+ String title = "SAW (uncommitted-conflicted) More Requirement Changes for Diagram View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "SAW Requirements", "Joe Smith", DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_Requirements));
+ }
+
+ @org.junit.Test
+ public void testWorkaroundForGraphViewBld1Action() throws OseeCoreException {
+ String title = "Workaround for Graph View for SAW_Bld_1";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_1.getName(), TeamState.Completed.getPageName(),
+ "Adapter", "", DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ }
+
+ @org.junit.Test
+ public void testWorkaroundForGraphViewBld2Action() throws OseeCoreException {
+ String title = "Workaround for Graph View for SAW_Bld_2";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Implement.getPageName(),
+ "Adapter", "Jason Michael", DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ }
+
+ @org.junit.Test
+ public void testWorkaroundForGraphViewBld3Action() throws OseeCoreException {
+ String title = "Workaround for Graph View for SAW_Bld_3";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "1", DemoSawBuilds.SAW_Bld_3.getName(), TeamState.Implement.getPageName(),
+ "Adapter", "Jason Michael", DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ }
+
+ @org.junit.Test
+ public void testWorkingWithDiagramTreeBld1Action() throws OseeCoreException {
+ String title = "Working with Diagram Tree for SAW_Bld_1";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_1.getName(), TeamState.Completed.getPageName(),
+ "SAW SW Design", "", AtsArtifactTypes.TeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_SW_Design));
+ }
+
+ @org.junit.Test
+ public void testWorkingWithDiagramTreeBld2Action() throws OseeCoreException {
+ String title = "Working with Diagram Tree for SAW_Bld_2";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_2.getName(), TeamState.Completed.getPageName(),
+ "SAW SW Design", "", AtsArtifactTypes.TeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_SW_Design));
+ }
+
+ @org.junit.Test
+ public void testWorkingWithDiagramTreeBld3Action() throws OseeCoreException {
+ String title = "Working with Diagram Tree for SAW_Bld_3";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", DemoSawBuilds.SAW_Bld_3.getName(), TeamState.Completed.getPageName(),
+ "SAW SW Design", "", AtsArtifactTypes.TeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_SW_Design));
+ }
+
+ @org.junit.Test
+ public void testButton2DoesntWorkOnHelpAction() throws OseeCoreException {
+ String title = "Button S doesn't work on help";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", "", TeamState.Completed.getPageName(), "Reader", "",
+ AtsArtifactTypes.TeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.Tools_Team));
+
+ // test decision review
+ Collection<AbstractReviewArtifact> reviews = ReviewManager.getReviews(teamArt);
+ Assert.assertEquals(1, reviews.size());
+ DecisionReviewArtifact revArt = (DecisionReviewArtifact) reviews.iterator().next();
+ testReviewContents(revArt, "Is the resolution of this Action valid?", DecisionReviewState.Decision.getPageName(),
+ "Joe Smith");
+
+ }
+
+ @org.junit.Test
+ public void testButtonWDoesntWorkOnSituationPageAction() throws OseeCoreException {
+ String title = "Button W doesn't work on Situation Page";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", "", TeamState.Analyze.getPageName(), "CIS Test", "Kay Jones",
+ DemoArtifactTypes.DemoTestTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.CIS_Test));
+
+ // test decision review
+ Collection<AbstractReviewArtifact> reviews = ReviewManager.getReviews(teamArt);
+ Assert.assertEquals(1, reviews.size());
+ DecisionReviewArtifact revArt = (DecisionReviewArtifact) reviews.iterator().next();
+ testReviewContents(revArt, "Is the resolution of this Action valid?", DecisionReviewState.Followup.getPageName(),
+ "Joe Smith");
+
+ }
+
+ @org.junit.Test
+ public void testCantLoadDiagramTreeAction() throws OseeCoreException {
+ String title = "Can't load Diagram Tree";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", "", TeamState.Completed.getPageName(), "CIS Test", "",
+ DemoArtifactTypes.DemoTestTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.CIS_Test));
+ }
+
+ @org.junit.Test
+ public void testCantSeeTheGraphViewAction() throws OseeCoreException {
+ String title = "Can't see the Graph View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "1", "", TeamState.Implement.getPageName(), "Adapter", "Jason Michael",
+ DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+
+ }
+
+ @org.junit.Test
+ public void testProblemInDiagramTreeAction() throws OseeCoreException {
+ String title = "Problem in Diagram Tree";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "3", "", TeamState.Completed.getPageName(), "CIS Test", "",
+ DemoArtifactTypes.DemoTestTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.CIS_Test));
+
+ }
+
+ @org.junit.Test
+ public void testProblemWithTheGraphViewAction() throws OseeCoreException {
+ String title = "Problem with the Graph View";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "1", "", TeamState.Implement.getPageName(), "Adapter", "Jason Michael",
+ DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+
+ }
+
+ @org.junit.Test
+ public void testProblemWithTheUserWindowAction() throws OseeCoreException {
+ String title = "Problem with the user window";
+ ActionArtifact action =
+ (ActionArtifact) ArtifactQuery.getArtifactFromTypeAndName(AtsArtifactTypes.Action, title,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(action);
+ Assert.assertEquals(1, action.getTeams().size());
+ TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
+
+ testTeamContents(teamArt, title, "4", "", TeamState.Implement.getPageName(), "Timesheet", "Jeffery Kay",
+ AtsArtifactTypes.TeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.Tools_Team));
+
+ }
+
+ private static void testReviewContents(AbstractReviewArtifact revArt, String title, String currentStateName, String assigneeStr) throws OseeCoreException {
+ Assert.assertEquals(title, revArt.getName());
+ Assert.assertEquals(currentStateName, revArt.getCurrentStateName());
+ Assert.assertEquals(assigneeStr, revArt.getStateMgr().getAssigneesStr());
+ }
+
+ private static void testTeamContents(TeamWorkFlowArtifact teamArt, String title, String priority, String versionName, String currentStateName, String actionableItemStr, String assigneeStr, IArtifactType artifactType, TeamDefinitionArtifact teamDef) throws OseeCoreException {
+ Assert.assertEquals(currentStateName, teamArt.getCurrentStateName());
+ Assert.assertEquals(priority, teamArt.getSoleAttributeValue(AtsAttributeTypes.PriorityType, ""));
+ Assert.assertEquals(versionName, teamArt.getTargetedVersionStr());
+ Assert.assertEquals(artifactType, teamArt.getArtifactType());
+ Assert.assertEquals(teamDef, teamArt.getTeamDefinition());
+ Assert.assertEquals(assigneeStr, teamArt.getStateMgr().getAssigneesStr());
+ Assert.assertEquals(actionableItemStr, teamArt.getActionableItemsDam().getActionableItemsStr());
+ }
+
+ private void testTaskContents(TaskArtifact task, String currentStateName, String relatedToState) throws OseeCoreException {
+ Assert.assertEquals(currentStateName, task.getCurrentStateName());
+ Assert.assertEquals(relatedToState, task.getSoleAttributeValue(AtsAttributeTypes.RelatedToState, ""));
+ }
+
+ private void testSwDesign1PeerAnd1DecisionReview(TeamWorkFlowArtifact designTeam) throws OseeCoreException {
+ Assert.assertNotNull(designTeam);
+ PeerToPeerReviewArtifact peerArt = null;
+ DecisionReviewArtifact decArt = null;
+ for (AbstractReviewArtifact revArt1 : ReviewManager.getReviews(designTeam)) {
+ if (revArt1.getName().contains("PeerToPeer")) {
+ peerArt = (PeerToPeerReviewArtifact) revArt1;
+ } else {
+ decArt = (DecisionReviewArtifact) revArt1;
+ }
+ }
+ Assert.assertNotNull(peerArt);
+ Assert.assertNotNull(decArt);
+ testReviewContents(
+ peerArt,
+ "Auto-created Decision Review from ruleId atsAddPeerToPeerReview.test.addPeerToPeerReview.Authorize.None.TransitionTo",
+ PeerToPeerReviewState.Prepare.getPageName(), "UnAssigned");
+ testReviewContents(
+ decArt,
+ "Auto-created Decision Review from ruleId: atsAddDecisionReview.test.addDecisionReview.Analyze.None.TransitionTo",
+ DecisionReviewState.Decision.getPageName(), "UnAssigned");
+
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/Populate_DemoDb_Suite.java b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/Populate_DemoDb_Suite.java
new file mode 100644
index 00000000000..2ee0ea3b6fd
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/Populate_DemoDb_Suite.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.ats.config.demo;
+
+import static org.junit.Assert.assertTrue;
+import org.eclipse.osee.ats.config.demo.config.DemoDbGroupsTest;
+import org.eclipse.osee.ats.config.demo.config.DemoDbUtil;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({DemoDbGroupsTest.class, PopulateActionsTest.class})
+/**
+ * Tests related to validating the population of demo data. Note the above 2 classes
+ * are also done at end of DemoDbInit, but need to remain here to ensure that db hasn't been
+ * corrupted on multiple runs of DemoDbTests
+ *
+ * @author Donald G. Dunne
+ */
+public class Populate_DemoDb_Suite {
+ @BeforeClass
+ public static void setUp() throws Exception {
+ DemoDbUtil.checkDbInitAndPopulateSuccess();
+ OseeProperties.setIsInTest(true);
+ assertTrue("Demo Application Server must be running.",
+ ClientSessionManager.getAuthenticationProtocols().contains("demo"));
+ assertTrue("Client must authenticate using demo protocol",
+ ClientSessionManager.getSession().getAuthenticationProtocol().equals("demo"));
+ System.out.println("\n\nBegin " + Populate_DemoDb_Suite.class.getSimpleName());
+ if (!OseeData.isProjectOpen()) {
+ System.err.println("osee.data project should be open");
+ OseeData.ensureProjectOpen();
+ }
+ }
+
+ @AfterClass
+ public static void tearDown() throws Exception {
+ if (!OseeData.isProjectOpen()) {
+ System.err.println("osee.data project should be open");
+ OseeData.ensureProjectOpen();
+ }
+ System.out.println("End " + Populate_DemoDb_Suite.class.getSimpleName());
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfigTest.java b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfigTest.java
new file mode 100644
index 00000000000..29d5fb07708
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDatabaseConfigTest.java
@@ -0,0 +1,158 @@
+/*
+ * Created on May 25, 2011
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.config.demo.config;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.config.demo.DemoCISBuilds;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+/**
+ * Test unit for {@link DemoDatabaseConfig}
+ *
+ * @author Donald G. Dunne
+ */
+public class DemoDatabaseConfigTest {
+
+ @BeforeClass
+ public static void validateDbInit() throws OseeCoreException {
+ DemoDbUtil.checkDbInitAndPopulateSuccess();
+ }
+
+ @org.junit.Test
+ public void test_SAW_Bld_1__creation() throws OseeCoreException {
+ Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid());
+ Assert.assertNotNull(branch);
+ Artifact programRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
+ Assert.assertNotNull(programRoot);
+
+ Assert.assertEquals(8, programRoot.getChildren().size());
+ List<String> topFolders = new ArrayList<String>();
+ topFolders.addAll(Arrays.asList("Hardware Requirements", "Integration Tests", "SAW Product Decomposition",
+ "Software Requirements", "Subsystem Requirements", "System Requirements", "Validation Tests",
+ "Verification Tests"));
+
+ for (Artifact child : programRoot.getChildren()) {
+ if (child.getName().equals("Integration Tests")) {
+ Assert.assertEquals(3, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Hardware Requirements")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("SAW Product Decomposition")) {
+ Assert.assertEquals(14, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Software Requirements")) {
+ Assert.assertEquals(1, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Subsystem Requirements")) {
+ Assert.assertEquals(1, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("System Requirements")) {
+ Assert.assertEquals(6, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Validation Tests")) {
+ Assert.assertEquals(3, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Verification Tests")) {
+ Assert.assertEquals(3, child.getChildren().size());
+ topFolders.remove(child.getName());
+ }
+ }
+
+ Assert.assertEquals(String.format("All top folders not created; missing [%s]", topFolders), 0, topFolders.size());
+ }
+
+ @org.junit.Test
+ public void test_SAW_Bld_1__SoftwareRequirementImport() throws OseeCoreException {
+ Branch branch = BranchManager.getBranchByGuid(DemoSawBuilds.SAW_Bld_1.getGuid());
+ Assert.assertNotNull(branch);
+
+ Collection<Artifact> artifacts =
+ ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SystemRequirement, branch);
+ Assert.assertEquals(67, artifacts.size());
+
+ artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SubsystemRequirement, branch);
+ Assert.assertEquals(59, artifacts.size());
+
+ artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, branch);
+ Assert.assertEquals(24, artifacts.size());
+
+ }
+
+ @org.junit.Test
+ public void test_CIS_Bld_1__creation() throws OseeCoreException {
+ Branch branch = BranchManager.getBranchByGuid(DemoCISBuilds.CIS_Bld_1.getGuid());
+ Assert.assertNotNull(branch);
+ Artifact programRoot = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
+ Assert.assertNotNull(programRoot);
+
+ Assert.assertEquals(8, programRoot.getChildren().size());
+ List<String> topFolders = new ArrayList<String>();
+ topFolders.addAll(Arrays.asList("Hardware Requirements", "Integration Tests", "SAW Product Decomposition",
+ "Software Requirements", "Subsystem Requirements", "System Requirements", "Validation Tests",
+ "Verification Tests"));
+
+ for (Artifact child : programRoot.getChildren()) {
+ if (child.getName().equals("Integration Tests")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Hardware Requirements")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("SAW Product Decomposition")) {
+ Assert.assertEquals(14, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Software Requirements")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Subsystem Requirements")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("System Requirements")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Validation Tests")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ } else if (child.getName().equals("Verification Tests")) {
+ Assert.assertEquals(0, child.getChildren().size());
+ topFolders.remove(child.getName());
+ }
+ }
+
+ Assert.assertEquals(String.format("All top folders not created; missing [%s]", topFolders), 0, topFolders.size());
+ }
+
+ @org.junit.Test
+ public void test_CIS_Bld_1__SoftwareRequirementImport() throws OseeCoreException {
+ Branch branch = BranchManager.getBranchByGuid(DemoCISBuilds.CIS_Bld_1.getGuid());
+ Assert.assertNotNull(branch);
+
+ Collection<Artifact> artifacts =
+ ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SystemRequirement, branch);
+ Assert.assertEquals(0, artifacts.size());
+
+ artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SubsystemRequirement, branch);
+ Assert.assertEquals(0, artifacts.size());
+
+ artifacts = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, branch);
+ Assert.assertEquals(0, artifacts.size());
+
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDbGroupsTest.java b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDbGroupsTest.java
new file mode 100644
index 00000000000..73a5d54b67a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.config.demo.test/src/org/eclipse/osee/ats/config/demo/config/DemoDbGroupsTest.java
@@ -0,0 +1,53 @@
+/*
+ * Created on May 25, 2011
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.config.demo.config;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.core.type.AtsArtifactTypes;
+import org.eclipse.osee.ats.util.AtsUtil;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.exception.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.skynet.core.utility.Artifacts;
+import org.eclipse.osee.support.test.util.DemoArtifactTypes;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DemoDbGroupsTest {
+ @BeforeClass
+ public static void validateDbInit() throws OseeCoreException {
+ DemoDbUtil.checkDbInitAndPopulateSuccess();
+ }
+
+ /**
+ * Test method for {@link DemoDbGroups}.
+ *
+ * @throws OseeCoreException
+ */
+ @Test
+ public void testCreateGroups() throws OseeCoreException {
+ Artifact groupArt =
+ ArtifactQuery.getArtifactFromTypeAndName(CoreArtifactTypes.UniversalGroup, DemoDbGroups.TEST_GROUP_NAME,
+ AtsUtil.getAtsBranchToken());
+ Assert.assertNotNull(groupArt);
+
+ Collection<Artifact> members = groupArt.getRelatedArtifacts(CoreRelationTypes.Universal_Grouping__Members);
+ Assert.assertEquals(23, members.size());
+
+ Assert.assertEquals(2, Artifacts.getOfType(AtsArtifactTypes.Action, members).size());
+ Assert.assertEquals(14, Artifacts.getOfType(AtsArtifactTypes.Task, members).size());
+ Assert.assertEquals(2, Artifacts.getOfType(DemoArtifactTypes.DemoCodeTeamWorkflow, members).size());
+ Assert.assertEquals(2, Artifacts.getOfType(DemoArtifactTypes.DemoTestTeamWorkflow, members).size());
+ Assert.assertEquals(2, Artifacts.getOfType(DemoArtifactTypes.DemoReqTeamWorkflow, members).size());
+ Assert.assertEquals(7, Artifacts.getOfType(AtsArtifactTypes.TeamWorkflow, members).size());
+ }
+}

Back to the top