Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-07-31 18:16:12 -0400
committerdonald.g.dunne2017-07-31 19:02:46 -0400
commite6bce1a7631c2fe18285b0d25ff6dfebba6cfd28 (patch)
tree43fb9ba28a13f932b8f7b631b04db853f88563cf
parent115fcdec3baaf50a2665106bd69f8af355d9eb9d (diff)
downloadorg.eclipse.osee-e6bce1a7631c2fe18285b0d25ff6dfebba6cfd28.tar.gz
org.eclipse.osee-e6bce1a7631c2fe18285b0d25ff6dfebba6cfd28.tar.xz
org.eclipse.osee-e6bce1a7631c2fe18285b0d25ff6dfebba6cfd28.zip
bug: fix ATS Admin serialization
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java7
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java5
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/support/WorkDef_Demo_AIs_And_Team_Definitions.ats6
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java26
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DemoUsers.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java9
7 files changed, 37 insertions, 20 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
index 05185480e0..d953483443 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsConfigurations.java
@@ -16,13 +16,11 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlRootElement;
-import org.codehaus.jackson.annotate.JsonIgnore;
import org.eclipse.osee.ats.api.user.AtsUser;
import org.eclipse.osee.ats.api.util.ColorColumns;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionStringProvider;
import org.eclipse.osee.ats.api.workdef.WorkDefData;
import org.eclipse.osee.framework.core.data.ArtifactId;
-import org.eclipse.osee.framework.core.data.UserId;
import org.eclipse.osee.framework.jdk.core.util.Collections;
/**
@@ -85,11 +83,6 @@ public class AtsConfigurations implements IAtsWorkDefinitionStringProvider {
this.validStateNames = validStateNames;
}
- public String getAtsAdminsStr() {
- return Collections.toString(",", atsAdmins);
- }
-
- @JsonIgnore
public List<ArtifactId> getAtsAdmins() {
return atsAdmins;
}
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
index a633b0eb6e..0868ef5e2f 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/config/AtsConfigAddDemoUsers.java
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.ats.core.client.util.AtsGroup;
import org.eclipse.osee.framework.core.data.UserToken;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.database.init.IDbInitializationTask;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -48,6 +49,10 @@ public class AtsConfigAddDemoUsers implements IDbInitializationTask {
SystemGroup.OseeAccessAdmin.getArtifact().persist(transaction1);
User joeSmith = UserManager.getUser(DemoUsers.Joe_Smith);
SystemGroup.OseeAccessAdmin.addMember(joeSmith);
+ for (User admin : admins) {
+ AtsGroup.AtsAdmin.getArtifact().addRelation(CoreRelationTypes.Users_User, admin);
+ admin.persist(transaction1);
+ }
AtsGroup.AtsAdmin.getArtifact().persist(transaction1);
AtsGroup.AtsTempAdmin.addMember(joeSmith);
AtsGroup.AtsTempAdmin.getArtifact().persist(transaction1);
diff --git a/plugins/org.eclipse.osee.ats.client.demo/support/WorkDef_Demo_AIs_And_Team_Definitions.ats b/plugins/org.eclipse.osee.ats.client.demo/support/WorkDef_Demo_AIs_And_Team_Definitions.ats
index 443be69182..81b15c46e8 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/support/WorkDef_Demo_AIs_And_Team_Definitions.ats
+++ b/plugins/org.eclipse.osee.ats.client.demo/support/WorkDef_Demo_AIs_And_Team_Definitions.ats
@@ -1,7 +1,11 @@
userDefinition "Joe Smith" GetOrCreate
userDefinition "Kay Jones" GetOrCreate
-userDefinition "Jason Michael" GetOrCreate
+userDefinition "Jason Michael" GetOrCreate {
+ active False userId "Jason Michael"
+ email "Jason Michael"
+ isAdmin True
+}
userDefinition "Alex Kay" GetOrCreate
userDefinition "Kay Jason" GetOrCreate
userDefinition "Steven Kohn" GetOrCreate
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
index d40afd4bc2..76079ca5bc 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/PopulateDemoActionsTest.java
@@ -41,6 +41,7 @@ import org.eclipse.osee.ats.demo.api.DemoArtifactTypes;
import org.eclipse.osee.ats.demo.api.DemoTeam;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -78,6 +79,15 @@ public class PopulateDemoActionsTest {
}
@org.junit.Test
+ public void testAtsAdmin() throws OseeCoreException {
+ Assert.assertEquals(DemoUsers.Joe_Smith.getUserId(),
+ AtsClientService.get().getUserService().getCurrentUser().getUserId());
+ Assert.assertFalse(AtsClientService.get().getUserService().isAtsAdmin());
+ Assert.assertTrue(AtsClientService.get().getUserService().isAtsAdmin(
+ AtsClientService.get().getUserServiceClient().getUserById(DemoUsers.Jason_Michael.getUserId())));
+ }
+
+ @org.junit.Test
public void testSawBuild2Action1() throws OseeCoreException {
// {@link DemoDbActionData.getReqSawActionsData()} - 1
@@ -288,7 +298,8 @@ public class PopulateDemoActionsTest {
TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
testTeamContents(teamArt, title, "1", SAW_Bld_2.getName(), TeamState.Implement.getName(), "Adapter",
- "Jason Michael", DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ DemoUsers.Jason_Michael.getName(), DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
}
@org.junit.Test
@@ -301,7 +312,8 @@ public class PopulateDemoActionsTest {
TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
testTeamContents(teamArt, title, "1", SAW_Bld_3.getName(), TeamState.Implement.getName(), "Adapter",
- "Jason Michael", DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ DemoUsers.Jason_Michael.getName(), DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
}
@org.junit.Test
@@ -407,8 +419,9 @@ public class PopulateDemoActionsTest {
Assert.assertEquals(1, action.getTeams().size());
TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
- testTeamContents(teamArt, title, "1", "", TeamState.Implement.getName(), "Adapter", "Jason Michael",
- DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ testTeamContents(teamArt, title, "1", "", TeamState.Implement.getName(), "Adapter",
+ DemoUsers.Jason_Michael.getName(), DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
}
@@ -435,8 +448,9 @@ public class PopulateDemoActionsTest {
Assert.assertEquals(1, action.getTeams().size());
TeamWorkFlowArtifact teamArt = action.getTeams().iterator().next();
- testTeamContents(teamArt, title, "1", "", TeamState.Implement.getName(), "Adapter", "Jason Michael",
- DemoArtifactTypes.DemoReqTeamWorkflow, DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
+ testTeamContents(teamArt, title, "1", "", TeamState.Implement.getName(), "Adapter",
+ DemoUsers.Jason_Michael.getName(), DemoArtifactTypes.DemoReqTeamWorkflow,
+ DemoTestUtil.getTeamDef(DemoTeam.SAW_HW));
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
index 8a58d98ac2..73c781c0fb 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUserServiceClientImpl.java
@@ -148,7 +148,7 @@ public class AtsUserServiceClientImpl extends AbstractAtsUserService implements
@Override
public boolean isAtsAdmin(IAtsUser user) {
- return configurationProvider.getConfigurations().getAtsAdmins().contains(user.getId());
+ return configurationProvider.getConfigurations().getAtsAdmins().contains(user.getStoreObject());
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DemoUsers.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DemoUsers.java
index 8c9d7572e1..2925283c97 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DemoUsers.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/DemoUsers.java
@@ -22,7 +22,7 @@ public final class DemoUsers {
// @formatter:off
public static final UserToken Joe_Smith = UserToken.create(61106791, "ABNRvbZxXHICYklfslwA", "Joe Smith", "joe@boeing.com", "3333", true, false, false);
public static final UserToken Kay_Jones = UserToken.create(5896672, "ABNRvuB8x3VARkkn3YAA", "Kay Jones", "kay@boeing.com", "4444", true, false, false);
- public static final UserToken Jason_Michael = UserToken.create(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "jason@boeing.com", "5555", true, false, false);
+ public static final UserToken Jason_Michael = UserToken.create(277990, "ABNRvuHWtXAdxbG3mUAA", "Jason Michael", "jason@boeing.com", "5555", true, true, false);
public static final UserToken Alex_Kay = UserToken.create(8006939, "ABNRvuKDIWOcPDe4X0wA", "Alex Kay", "", "6666", true, false, false);
public static final UserToken Inactive_Steve = UserToken.create(5808093, "ABNRvuRG6jKwKnEoX4gA", "Inactive Steve", "insactiveSteve@boeing.com", "7777", false, false, false);
public static List<UserToken> values = Arrays.asList(Joe_Smith, Kay_Jones, Jason_Michael, Alex_Kay, Inactive_Steve);
diff --git a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
index a64fb288f3..08da6df818 100644
--- a/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
+++ b/plugins/org.eclipse.osee.orcs.test/src/org/eclipse/osee/orcs/api/OrcsQueryTest.java
@@ -20,7 +20,6 @@ import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_2;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import com.google.common.collect.Ordering;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
@@ -37,6 +36,7 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.QueryOption;
import org.eclipse.osee.framework.core.enums.SystemUser;
import org.eclipse.osee.framework.jdk.core.type.MatchLocation;
@@ -66,6 +66,7 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestRule;
+import com.google.common.collect.Ordering;
/**
* @author Roberto E. Escobar
@@ -266,9 +267,9 @@ public class OrcsQueryTest {
for (String name : Arrays.asList("Alex Kay", "Anonymous", "Boot Strap", "Default Hierarchy Root",
"Document Templates", "Everyone", "Framework Access Model", "Global Preferences", "Inactive Steve",
- "Jason Michael", "Joe Smith", "Kay Jones", "OSEE System", "OseeAdmin", "PREVIEW_ALL", "PREVIEW_ALL_RECURSE",
- "Root Artifact", "UnAssigned", "User Groups", "Word Edit Template", "Word Edit Template",
- "XViewer Global Customization", "org.eclipse.osee.client.demo.OseeTypes_ClientDemo",
+ DemoUsers.Jason_Michael.getName(), "Joe Smith", "Kay Jones", "OSEE System", "OseeAdmin", "PREVIEW_ALL",
+ "PREVIEW_ALL_RECURSE", "Root Artifact", "UnAssigned", "User Groups", "Word Edit Template",
+ "Word Edit Template", "XViewer Global Customization", "org.eclipse.osee.client.demo.OseeTypes_ClientDemo",
"org.eclipse.osee.framework.skynet.core.OseeTypes_Framework", "org.eclipse.osee.ote.define.OseeTypesOTE")) {
assertTrue("Missing expected artifact named [" + name + "]", names.contains(name));
}

Back to the top