You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/12/02 16:05:50 UTC

[3/4] airavata git commit: writing test case for Airavata-2245 bug resolution

writing test case for Airavata-2245 bug resolution


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/1bb80426
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/1bb80426
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/1bb80426

Branch: refs/heads/develop
Commit: 1bb80426d1acaa6d65aa49951fbb5fd1bc6a1703
Parents: f3c60d0
Author: Anuj Bhandar <bh...@gmail.com>
Authored: Thu Dec 1 17:51:14 2016 -0500
Committer: Anuj Bhandar <bh...@gmail.com>
Committed: Thu Dec 1 17:51:14 2016 -0500

----------------------------------------------------------------------
 .../app/catalog/UserResourceProfileTest.java    | 33 ++++++++++++++++++++
 1 file changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/1bb80426/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/UserResourceProfileTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/UserResourceProfileTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/UserResourceProfileTest.java
index 1e013e2..d2e1466 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/UserResourceProfileTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/app/catalog/UserResourceProfileTest.java
@@ -116,6 +116,39 @@ public class UserResourceProfileTest {
 
         String gwId = userProfile.addUserResourceProfile(uf);
         UserResourceProfile retrievedProfile = null;
+
+
+        // This test is to check whether an existing user can add more compute preferences - AIRAVATA-2245
+
+        System.out.println("*********Start Airavata-2245************");
+
+        ComputeResource computeRs1 = appcatalog.getComputeResource();
+        ComputeResourceDescription cm12 = new ComputeResourceDescription();
+        cm12.setHostName("localhost123");
+        cm12.setResourceDescription("test compute host");
+        String hostId12 = computeRs1.addComputeResource(cm12);
+
+        UserComputeResourcePreference preference12 = new UserComputeResourcePreference();
+        preference12.setComputeResourceId(hostId12);
+        preference12.setPreferredBatchQueue("queue112");
+        preference12.setScratchLocation("/tmp21");
+        preference12.setAllocationProjectNumber("project12");
+
+        List<UserComputeResourcePreference> list12 = new ArrayList<UserComputeResourcePreference>();
+        list12.add(preference12);
+
+        UserResourceProfile uf12 = new UserResourceProfile();
+        uf12.setUserComputeResourcePreferences(list12);
+        uf12.setGatewayID("airavataPGA");
+        uf12.setUserId("Anuj");
+
+        String gwId12 = userProfile.addUserResourceProfile(uf12);
+
+        System.out.println("*******End Airavata-2245******* : success");
+
+        // End of test for AIRAVATA-2245
+
+
         //retrievedProfile = userProfile.getUserResourceProfile("hello",uf.getGatewayID());
         if (userProfile.isUserResourceProfileExists(uf.getUserId(),uf.getGatewayID())){
             retrievedProfile = userProfile.getUserResourceProfile(uf.getUserId(),uf.getGatewayID());