cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [37/50] [abbrv] ResourceMetaData (Resource details) fixes:
Date Thu, 24 Oct 2013 18:31:15 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/vpc/VpcManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
index 2a2ab7d..6e0b54d 100644
--- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java
+++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java
@@ -99,7 +99,7 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.org.Grouping;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.server.ConfigurationServer;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -875,7 +875,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.Vpc.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Vpc.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));
@@ -1918,7 +1918,7 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager,
VpcProvis
         
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.StaticRoute.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.StaticRoute.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/server/ManagementServerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index bce6b45..58513d7 100755
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -518,7 +518,7 @@ import com.cloud.projects.Project;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.projects.ProjectManager;
 import com.cloud.resource.ResourceManager;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.auth.UserAuthenticator;
 import com.cloud.storage.DiskOfferingVO;
 import com.cloud.storage.GuestOS;
@@ -1998,7 +1998,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.PublicIpAddress.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.PublicIpAddress.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
index 1e17de1..4bd1da8 100755
--- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
+++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java
@@ -81,7 +81,7 @@ import com.cloud.host.HostVO;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.resource.ResourceManager;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.CreateSnapshotPayload;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
@@ -609,7 +609,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.Snapshot.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Snapshot.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
index 9269dce..7d7692f 100644
--- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
+++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java
@@ -48,7 +48,7 @@ import com.cloud.network.vpc.dao.StaticRouteDao;
 import com.cloud.network.vpc.dao.VpcDao;
 import com.cloud.projects.dao.ProjectDao;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.TaggedResourceService;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.dao.SnapshotDao;
@@ -80,8 +80,8 @@ import com.cloud.vm.snapshot.dao.VMSnapshotDao;
 public class TaggedResourceManagerImpl extends ManagerBase implements TaggedResourceService
{
     public static final Logger s_logger = Logger.getLogger(TaggedResourceManagerImpl.class);
     
-    private static Map<TaggedResourceType, GenericDao<?, Long>> _daoMap= 
-            new HashMap<TaggedResourceType, GenericDao<?, Long>>();
+    private static Map<ResourceObjectType, GenericDao<?, Long>> _daoMap= 
+            new HashMap<ResourceObjectType, GenericDao<?, Long>>();
     
     @Inject
     AccountManager _accountMgr;
@@ -135,26 +135,26 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
-        _daoMap.put(TaggedResourceType.UserVm, _userVmDao);
-        _daoMap.put(TaggedResourceType.Volume, _volumeDao);
-        _daoMap.put(TaggedResourceType.Template, _templateDao);
-        _daoMap.put(TaggedResourceType.ISO, _templateDao);
-        _daoMap.put(TaggedResourceType.Snapshot, _snapshotDao);
-        _daoMap.put(TaggedResourceType.Network, _networkDao);
-        _daoMap.put(TaggedResourceType.LoadBalancer, _lbDao);
-        _daoMap.put(TaggedResourceType.PortForwardingRule, _pfDao);
-        _daoMap.put(TaggedResourceType.FirewallRule, _firewallDao);
-        _daoMap.put(TaggedResourceType.SecurityGroup, _securityGroupDao);
-        _daoMap.put(TaggedResourceType.PublicIpAddress, _publicIpDao);
-        _daoMap.put(TaggedResourceType.Project, _projectDao);
-        _daoMap.put(TaggedResourceType.Vpc, _vpcDao);
-        _daoMap.put(TaggedResourceType.Nic, _nicDao);
-        _daoMap.put(TaggedResourceType.NetworkACL, _networkACLItemDao);
-        _daoMap.put(TaggedResourceType.StaticRoute, _staticRouteDao);
-        _daoMap.put(TaggedResourceType.VMSnapshot, _vmSnapshotDao);
-        _daoMap.put(TaggedResourceType.RemoteAccessVpn, _vpnDao);
-        _daoMap.put(TaggedResourceType.Zone, _dataCenterDao);
-        _daoMap.put(TaggedResourceType.ServiceOffering, _serviceOffDao);
+        _daoMap.put(ResourceObjectType.UserVm, _userVmDao);
+        _daoMap.put(ResourceObjectType.Volume, _volumeDao);
+        _daoMap.put(ResourceObjectType.Template, _templateDao);
+        _daoMap.put(ResourceObjectType.ISO, _templateDao);
+        _daoMap.put(ResourceObjectType.Snapshot, _snapshotDao);
+        _daoMap.put(ResourceObjectType.Network, _networkDao);
+        _daoMap.put(ResourceObjectType.LoadBalancer, _lbDao);
+        _daoMap.put(ResourceObjectType.PortForwardingRule, _pfDao);
+        _daoMap.put(ResourceObjectType.FirewallRule, _firewallDao);
+        _daoMap.put(ResourceObjectType.SecurityGroup, _securityGroupDao);
+        _daoMap.put(ResourceObjectType.PublicIpAddress, _publicIpDao);
+        _daoMap.put(ResourceObjectType.Project, _projectDao);
+        _daoMap.put(ResourceObjectType.Vpc, _vpcDao);
+        _daoMap.put(ResourceObjectType.Nic, _nicDao);
+        _daoMap.put(ResourceObjectType.NetworkACL, _networkACLItemDao);
+        _daoMap.put(ResourceObjectType.StaticRoute, _staticRouteDao);
+        _daoMap.put(ResourceObjectType.VMSnapshot, _vmSnapshotDao);
+        _daoMap.put(ResourceObjectType.RemoteAccessVpn, _vpnDao);
+        _daoMap.put(ResourceObjectType.Zone, _dataCenterDao);
+        _daoMap.put(ResourceObjectType.ServiceOffering, _serviceOffDao);
 
         return true;
     }
@@ -170,7 +170,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     }
 
     @Override
-    public Long getResourceId(String resourceId, TaggedResourceType resourceType) {
+    public long getResourceId(String resourceId, ResourceObjectType resourceType) {
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
         if (dao == null) {
             throw new CloudRuntimeException("Dao is not loaded for the resource type " +
resourceType);
@@ -200,14 +200,9 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
         }
         return identityId;
     }
-
-    protected String getTableName(TaggedResourceType resourceType) {
-        GenericDao<?, Long> dao = _daoMap.get(resourceType);
-        Class<?> claz = DbUtil.getEntityBeanType(dao);
-        return DbUtil.getTableName(claz);
-    }
     
-    private Pair<Long, Long> getAccountDomain(long resourceId, TaggedResourceType resourceType)
{
+    
+    private Pair<Long, Long> getAccountDomain(long resourceId, ResourceObjectType resourceType)
{
        
         Pair<Long, Long> pair = null;
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
@@ -243,9 +238,9 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     }
 
     @Override
-    public TaggedResourceType getResourceType(String resourceTypeStr) {
+    public ResourceObjectType getResourceType(String resourceTypeStr) {
         
-        for (TaggedResourceType type : ResourceTag.TaggedResourceType.values()) {
+        for (ResourceObjectType type : ResourceTag.ResourceObjectType.values()) {
             if (type.toString().equalsIgnoreCase(resourceTypeStr)) {
                 return type;
             }
@@ -256,7 +251,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_TAGS_CREATE, eventDescription = "creating resource
tags")
-    public List<ResourceTag> createTags(final List<String> resourceIds, final
TaggedResourceType resourceType, 
+    public List<ResourceTag> createTags(final List<String> resourceIds, final
ResourceObjectType resourceType, 
             final Map<String, String> tags, final String customer) {
         final Account caller = CallContext.current().getCallingAccount();
         
@@ -267,15 +262,13 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
             public void doInTransactionWithoutResult(TransactionStatus status) {
                 for (String key : tags.keySet()) {
                     for (String resourceId : resourceIds) {
-                        Long id = getResourceId(resourceId, resourceType);
-                        String resourceUuid = getUuid(resourceId, resourceType);
-                        
-                        //check if object exists
-                        if (_daoMap.get(resourceType).findById(id) == null) {
-                            throw new InvalidParameterValueException("Unable to find resource
by id " + resourceId + 
-                                    " and type " + resourceType);
+                        if (!resourceType.resourceTagsSupport())  {
+                            throw new InvalidParameterValueException("The resource type "
+ resourceType + " doesn't support resource tags");
                         }
                         
+                        long id = getResourceId(resourceId, resourceType);
+                        String resourceUuid = getUuid(resourceId, resourceType);
+                        
                         Pair<Long, Long> accountDomainPair = getAccountDomain(id, resourceType);
                         Long domainId = accountDomainPair.second();
                         Long accountId = accountDomainPair.first();
@@ -307,9 +300,10 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
 
         return resourceTags;
     }
+    
 
     @Override
-    public String getUuid(String resourceId, TaggedResourceType resourceType) {
+    public String getUuid(String resourceId, ResourceObjectType resourceType) {
         GenericDao<?, Long> dao = _daoMap.get(resourceType);
         Class<?> claz = DbUtil.getEntityBeanType(dao);
 
@@ -341,7 +335,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_TAGS_DELETE, eventDescription = "deleting resource
tags")
-    public boolean deleteTags(List<String> resourceIds, TaggedResourceType resourceType,
Map<String, String> tags) {
+    public boolean deleteTags(List<String> resourceIds, ResourceObjectType resourceType,
Map<String, String> tags) {
         Account caller = CallContext.current().getCallingAccount();
         
         SearchBuilder<ResourceTagVO> sb = _resourceTagDao.createSearchBuilder();
@@ -407,7 +401,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements
TaggedReso
 
 
     @Override
-    public List<? extends ResourceTag> listByResourceTypeAndId(TaggedResourceType type,
long resourceId) {
+    public List<? extends ResourceTag> listByResourceTypeAndId(ResourceObjectType type,
long resourceId) {
         return _resourceTagDao.listBy(resourceId, type);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/uuididentity/dao/IdentityDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/uuididentity/dao/IdentityDao.java b/server/src/com/cloud/uuididentity/dao/IdentityDao.java
index e9149a0..be412f3 100644
--- a/server/src/com/cloud/uuididentity/dao/IdentityDao.java
+++ b/server/src/com/cloud/uuididentity/dao/IdentityDao.java
@@ -17,7 +17,7 @@
 
 package com.cloud.uuididentity.dao;
 
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.Pair;
 import com.cloud.utils.db.GenericDao;
 
@@ -31,5 +31,5 @@ public interface IdentityDao extends GenericDao<IdentityVO, Long>
{
      * @param resourceType TODO
      * @return
      */
-    Pair<Long, Long> getAccountDomainInfo(String tableName, Long identityId, TaggedResourceType
resourceType);
+    Pair<Long, Long> getAccountDomainInfo(String tableName, Long identityId, ResourceObjectType
resourceType);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java b/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java
index 7e14c69..9c54fb7 100644
--- a/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java
+++ b/server/src/com/cloud/uuididentity/dao/IdentityDaoImpl.java
@@ -28,7 +28,7 @@ import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.Pair;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
@@ -97,7 +97,7 @@ public class IdentityDaoImpl extends GenericDaoBase<IdentityVO, Long>
implements
     
     @DB
     @Override
-    public Pair<Long, Long> getAccountDomainInfo(String tableName, Long identityId,
TaggedResourceType resourceType) {
+    public Pair<Long, Long> getAccountDomainInfo(String tableName, Long identityId,
ResourceObjectType resourceType) {
         assert(tableName != null);
         
         PreparedStatement pstmt = null;
@@ -121,7 +121,7 @@ public class IdentityDaoImpl extends GenericDaoBase<IdentityVO, Long>
implements
             //get accountId
             try {
                 String account = "account_id";
-                if (resourceType == TaggedResourceType.Project) {
+                if (resourceType == ResourceObjectType.Project) {
                     account = "project_account_id";
                 }
                 pstmt = txn.prepareAutoCloseStatement(String.format("SELECT " + account +
" FROM `%s` WHERE id=?", tableName));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
index e2d33ac..b7cd231 100644
--- a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
+++ b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
@@ -57,7 +57,7 @@ import com.cloud.network.lb.LoadBalancingRulesService;
 import com.cloud.network.rules.FirewallRule.State;
 import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -459,7 +459,7 @@ public class ApplicationLoadBalancerManagerImpl extends ManagerBase implements
A
         
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.LoadBalancer.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.LoadBalancer.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java b/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
index 68762ef..b071955 100644
--- a/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
+++ b/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
@@ -17,42 +17,27 @@
 
 package com.cloud.metadata;
 
-import static org.mockito.Matchers.anyBoolean;
-import static org.mockito.Matchers.anyFloat;
-import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyLong;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.when;
 
-import java.lang.reflect.Field;
-import java.util.List;
 import java.util.Map;
 
-import com.cloud.server.TaggedResourceService;
-import com.cloud.utils.db.DB;
-import com.cloud.vm.dao.NicDetailDao;
-import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.command.user.vm.RestoreVMCmd;
-import org.apache.cloudstack.api.command.user.vm.ScaleVMCmd;
+import javax.naming.ConfigurationException;
+
 import org.apache.commons.collections.map.HashedMap;
 import org.junit.Before;
-import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 
 import com.cloud.exception.ResourceAllocationException;
-import com.cloud.metadata.ResourceMetaDataManager;
-import com.cloud.metadata.ResourceMetaDataManagerImpl;
 import com.cloud.server.ResourceTag;
-import com.cloud.storage.Volume;
+import com.cloud.server.TaggedResourceService;
 import com.cloud.storage.dao.VolumeDetailsDao;
-import com.cloud.user.dao.UserDao;
-
-import javax.naming.ConfigurationException;
+import com.cloud.vm.dao.NicDetailDao;
 
 
 public class ResourceMetaDataManagerTest {
@@ -88,12 +73,12 @@ public class ResourceMetaDataManagerTest {
 
 
         //when(_resourceMetaDataMgr.getResourceId(anyString(), eq(ResourceTag.TaggedResourceType.Volume))).thenReturn(1L);
-        doReturn(1L).when(_taggedResourceMgr).getResourceId(anyString(), eq(ResourceTag.TaggedResourceType.Volume));
+        doReturn(1L).when(_taggedResourceMgr).getResourceId(anyString(), eq(ResourceTag.ResourceObjectType.Volume));
         //           _volumeDetailDao.removeDetails(id, key);
 
         doNothing().when(_volumeDetailDao).removeDetails(anyLong(), anyString());
         doNothing().when(_nicDetailDao).removeDetails(anyLong(), anyString());
-        _resourceMetaDataMgr.deleteResourceMetaData(anyString(), eq(ResourceTag.TaggedResourceType.Volume),
anyString());
+        _resourceMetaDataMgr.deleteResourceMetaData(anyString(), eq(ResourceTag.ResourceObjectType.Volume),
anyString());
 
     }
 
@@ -103,14 +88,14 @@ public class ResourceMetaDataManagerTest {
 
 
 
-        doReturn(1L).when(_taggedResourceMgr).getResourceId("1", ResourceTag.TaggedResourceType.Volume);
+        doReturn(1L).when(_taggedResourceMgr).getResourceId("1", ResourceTag.ResourceObjectType.Volume);
         //           _volumeDetailDao.removeDetails(id, key);
 
         doNothing().when(_volumeDetailDao).removeDetails(anyLong(), anyString());
         doNothing().when(_nicDetailDao).removeDetails(anyLong(), anyString());
         Map<String, String> map = new HashedMap();
         map.put("key","value");
-        _resourceMetaDataMgr.addResourceMetaData("1", ResourceTag.TaggedResourceType.Volume,
map);
+        _resourceMetaDataMgr.addResourceMetaData("1", ResourceTag.ResourceObjectType.Volume,
map);
 
     }
 


Mime
View raw message