airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject [2/4] airavata git commit: resolving bug 2 : removeUserComputeResourcePreference is working now
Date Thu, 20 Oct 2016 13:01:48 GMT
resolving bug 2 : removeUserComputeResourcePreference is working now


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

Branch: refs/heads/develop
Commit: ff48f8c898b7160da6e646e55681bf6a92637549
Parents: dd319ce
Author: Anuj Bhandar <bhandar.anuj@gmail.com>
Authored: Fri Oct 14 16:04:26 2016 -0400
Committer: Anuj Bhandar <bhandar.anuj@gmail.com>
Committed: Fri Oct 14 16:04:26 2016 -0400

----------------------------------------------------------------------
 .../registry/core/app/catalog/impl/UsrResourceProfileImpl.java   | 2 +-
 .../org/apache/airavata/app/catalog/UserResourceProfileTest.java | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/ff48f8c8/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
index 802c288..8d2e42a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/impl/UsrResourceProfileImpl.java
@@ -205,7 +205,7 @@ public class UsrResourceProfileImpl implements UsrResourceProfile {
     public boolean removeUserComputeResourcePreferenceFromGateway(String userId, String gatewayId,
String preferenceId) throws AppCatalogException {
         try {
             UserComputeHostPreferenceResource resource = new UserComputeHostPreferenceResource();
-            CompositeIdentifier ids = new CompositeIdentifier(userId,gatewayId);
+            CompositeIdentifier ids = new CompositeIdentifier(preferenceId, userId);
             resource.remove(ids);
             return true;
         }catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/ff48f8c8/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 a7adbb6..6453066 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
@@ -114,8 +114,12 @@ public class UserResourceProfileTest {
                 for (UserComputeResourcePreference cm : preferences){
                     System.out.println("******** host id ********* : " + cm.getComputeResourceId());
                     System.out.println(cm.getPreferredBatchQueue());
+                    // this statement will remove all the compute resources created
+                    System.out.println("Compute Preference removed : " + userProfile.removeUserComputeResourcePreferenceFromGateway(retrievedProfile.getUserId(),retrievedProfile.getGatewayID(),cm.getComputeResourceId()));
                 }
             }
+            //remove the user resource profile created.
+            System.out.println("User Resource profile removed : " + userProfile.removeUserResourceProfile(retrievedProfile.getUserId(),retrievedProfile.getGatewayID()));
         }else{
             System.out.println("User resource profile is null");
         }


Mime
View raw message