You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2016/09/16 16:11:56 UTC

[21/48] airavata git commit: updating the registry refactoring code

http://git-wip-us.apache.org/repos/asf/airavata/blob/3ce49b9a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/RepositoryTest.java
----------------------------------------------------------------------
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/RepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/RepositoryTest.java
index 3561d5a..342b73c 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/RepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/RepositoryTest.java
@@ -20,13 +20,23 @@
 */
 package org.apache.airavata.registry.core.repositories;
 
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
+import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.model.workspace.Gateway;
 import org.apache.airavata.model.workspace.GatewayApprovalStatus;
 import org.apache.airavata.model.workspace.Notification;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.registry.core.entities.expcatalog.ExperimentEntity;
 import org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity;
 import org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity;
+import org.apache.airavata.registry.core.entities.workspacecatalog.ProjectEntity;
+import org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity;
+import org.apache.airavata.registry.core.repositories.expcatalog.ExperimentRepository;
 import org.apache.airavata.registry.core.repositories.workspacecatalog.GatewayRepository;
 import org.apache.airavata.registry.core.repositories.workspacecatalog.NotificationRepository;
+import org.apache.airavata.registry.core.repositories.workspacecatalog.ProjectRepository;
+import org.apache.airavata.registry.core.repositories.workspacecatalog.UserProfileRepository;
 import org.junit.Assert;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -56,5 +66,35 @@ public class RepositoryTest {
         notificationRepository.create(notification);
 
         notificationRepository.get(notification.getNotificationId());
+
+        UserProfile userProfile = new UserProfile();
+        userProfile.setAiravataInternalUserId(UUID.randomUUID().toString());
+        userProfile.setGatewayId(gateway.getGatewayId());
+        UserProfileRepository userProfileRepository = new UserProfileRepository(UserProfile.class, UserProfileEntity.class);
+        userProfileRepository.create(userProfile);
+
+
+        Project project = new Project();
+        project.setProjectID(UUID.randomUUID().toString());
+        project.setOwner(userProfile.getAiravataInternalUserId());
+        project.setGatewayId(gateway.getGatewayId());
+        project.setName("Project Name");
+
+        ProjectRepository projectRepository = new ProjectRepository(Project.class, ProjectEntity.class);
+        projectRepository.create(project);
+
+        ExperimentModel experiment = new ExperimentModel();
+        experiment.setExperimentId(UUID.randomUUID().toString());
+        experiment.setUserName(userProfile.getAiravataInternalUserId());
+        experiment.setProjectId(project.getProjectID());
+        experiment.setGatewayId(gateway.getGatewayId());
+        experiment.setExperimentName("Dummy Experiment");
+
+        UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
+        userConfigurationData.setExperimentDataDir("some/path");
+        experiment.setUserConfigurationData(userConfigurationData);
+
+        ExperimentRepository experimentRepository = new ExperimentRepository(ExperimentModel.class, ExperimentEntity.class);
+        experimentRepository.create(experiment);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/3ce49b9a/thrift-interface-descriptions/data-models/user-group-models/user_profile_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/user-group-models/user_profile_model.thrift b/thrift-interface-descriptions/data-models/user-group-models/user_profile_model.thrift
index e0c939d..e6b17ba 100644
--- a/thrift-interface-descriptions/data-models/user-group-models/user_profile_model.thrift
+++ b/thrift-interface-descriptions/data-models/user-group-models/user_profile_model.thrift
@@ -164,21 +164,22 @@ struct UserProfile {
     1: required string userModelVersion = USER_PROFILE_VERSION,
     2: required string airavataInternalUserId = airavata_commons.DEFAULT_ID,
     3: required string userId,
-    4: required list<string> emails,
-    5: optional string userName,
-    6: optional string orcidId,
-    7: optional list<string> phones,
-    8: optional string country,
-    9: optional list<string> nationality,
-    10: optional string homeOrganization,
-    11: optional string orginationAffiliation,
-    12: required string creationTime,
-    13: required string lastAccessTime,
-    14: required string validUntil,
-    15: required Status State,
-    16: optional string comments,
-    17: optional list<string> labeledURI,
-    18: optional string gpgKey,
-    19: optional string timeZone,
-    20: optional NSFDemographics nsfDemographics
+    4: required string gatewayId,
+    5: required list<string> emails,
+    6: optional string userName,
+    7: optional string orcidId,
+    8: optional list<string> phones,
+    9: optional string country,
+    10: optional list<string> nationality,
+    11: optional string homeOrganization,
+    12: optional string orginationAffiliation,
+    13: required string creationTime,
+    14: required string lastAccessTime,
+    15: required string validUntil,
+    16: required Status State,
+    17: optional string comments,
+    18: optional list<string> labeledURI,
+    19: optional string gpgKey,
+    20: optional string timeZone,
+    21: optional NSFDemographics nsfDemographics
 }
\ No newline at end of file