Allon Mureinik has uploaded a new change for review. Change subject: core: Remove StorageDomain ctor only used in tests ......................................................................
core: Remove StorageDomain ctor only used in tests Removed the ctor that isn't used anywhere in production code. This in fact also makes the tests easier to understand, as now the test StorageDomains instances only have the relevant field values and not all the values demanded by this useless constructor. Change-Id: I9503562dc30dd3a74929d68f533f2612f4dfb2b0 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsByImageIdQueryTest.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomain.java 2 files changed, 5 insertions(+), 52 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/09/18109/1 diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsByImageIdQueryTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsByImageIdQueryTest.java index 6363cd0..0fc5824 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsByImageIdQueryTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/GetStorageDomainsByImageIdQueryTest.java @@ -11,7 +11,6 @@ import org.junit.Test; import org.ovirt.engine.core.bll.AbstractQueryTest; import org.ovirt.engine.core.common.businessentities.StorageDomain; -import org.ovirt.engine.core.common.businessentities.StorageDomainStatus; import org.ovirt.engine.core.common.queries.IdQueryParameters; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dao.StorageDomainDAO; @@ -45,30 +44,11 @@ Guid imageId = Guid.newGuid(); when(params.getId()).thenReturn(imageId); - StorageDomain firstStorageDomain = - new StorageDomain(Guid.newGuid(), - Guid.newGuid().toString(), - "FirstStorage", - Guid.newGuid(), - 0, - 0, - StorageDomainStatus.Active, - "StoragePoolName", - 0, - 0, - "First Storage Description"); - StorageDomain secondStorageDomain = - new StorageDomain(Guid.newGuid(), - Guid.newGuid().toString(), - "SecondStorage", - Guid.newGuid(), - 0, - 0, - StorageDomainStatus.Active, - "StoragePoolName", - 0, - 0, - "Second Storage Description"); + StorageDomain firstStorageDomain = new StorageDomain(); + firstStorageDomain.setId(Guid.newGuid()); + StorageDomain secondStorageDomain = new StorageDomain(); + secondStorageDomain.setId(Guid.newGuid()); + List<StorageDomain> expected = new ArrayList<StorageDomain>(); expected.add(firstStorageDomain); expected.add(secondStorageDomain); diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomain.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomain.java index efc0457..a569a04 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomain.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/StorageDomain.java @@ -16,33 +16,6 @@ setStoragePoolIsoMapData(new StoragePoolIsoMap()); } - public StorageDomain(Guid id, - String storage, - String storageName, - Guid storagePoolId, - Integer availableDiskSize, - Integer usedDiskSize, - StorageDomainStatus status, - String storagePoolName, - int storagePoolType, - int storageType, - String description) { - staticData = new StorageDomainStatic(); - dynamicData = new StorageDomainDynamic(); - setStoragePoolIsoMapData(new StoragePoolIsoMap()); - this.setId(id); - this.setStorage(storage); - this.setStorageName(storageName); - this.setStoragePoolId(storagePoolId); - this.setAvailableDiskSize(availableDiskSize); - this.setUsedDiskSize(usedDiskSize); - this.setStatus(status); - this.setStoragePoolName(storagePoolName); - this.setStorageType(StorageType.forValue(storagePoolType)); - this.setStorageDomainType(StorageDomainType.forValue(storageType)); - setDescription(description); - } - //this member is in use only by the Frontend project private String vdcQueryableId; -- To view, visit http://gerrit.ovirt.org/18109 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9503562dc30dd3a74929d68f533f2612f4dfb2b0 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
