Change in ovirt-engine[master]: backend: Migrate SessionDataContainer to CDI
masayag at redhat.com
masayag at redhat.com
Tue Sep 8 14:26:40 UTC 2015
Moti Asayag has submitted this change and it was merged.
Change subject: backend: Migrate SessionDataContainer to CDI
......................................................................
backend: Migrate SessionDataContainer to CDI
* Made SessionDataContainer a proper CDI singleton.
* Replaced SessionDataContainer.getInstance() occurences with dependency
injection
* Removed unnecessary DbFacade usage and instead we now inject just the one
required EngineSessionDao
* Some changes to tests were necessary:
- Created abstract base class BaseCommandTest that mocks SessionDataContainer
with EngineSessionDao that is used in each instantiation of Command/Query.
- Since CommandBase accesses SessionDataContainer in constructor we need to
get it manually through the usage of Injector.get(). Injector mocking is
handled by BaseCommandTest rule.
- extracted the CommandBase constructor code touching SessionDataContainer
into new method initUser() that can be overriden when the injector rule
cannot be applied (e.g. Parametrized test runs).
Change-Id: Ib65a89454e2456a0eeab07ed3cd0976c325745b4
Signed-off-by: Martin Betak <mbetak at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachUserToVmFromPoolAndRunCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitBackendServicesOnStartupBean.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QueriesCommandBase.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmLogonCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolUserCommandBase.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/GetDbUserBySessionQuery.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/IsPasswordDelegationPossibleQuery.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/LoginBaseCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/LogoutSessionCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/SessionDataContainer.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/SetSesssionSoftLimitCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/TerminateSessionCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/aaa/ValidateSessionQuery.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AbstractGetEntitiesWithPermittedActionParametersQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AbstractQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AbstractRolesCommandTestBase.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddDiskCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddExternalStepCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddQuotaCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddRoleWithActionGroupsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddVmTemplateCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AttachDiskToVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BackwardCompatibilityTaskCreationTest.java
A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/BaseCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ClearExternalJobCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommandBaseTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ConfigureConsoleOptionsQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CreateAllSnapshotsFromVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/DbDependentTestBase.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/EndExternalJobCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/EndExternalStepCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ForceSelectSPMCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetConsoleDescriptorFileQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/GetDiskAlignmentCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/HotPlugDiskToVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportExportRepoImageCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVMFromConfigurationCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ImportVmTemplateCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/MoveDisksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/ProcessOvfUpdateForStoragePoolCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/QueriesCommandBaseTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveAuditLogByIdCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveDiskSnapshotsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveImageCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveQuotaCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveSnapshotCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveVdsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RestoreAllSnapshotCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/SetVmTicketCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/TryBackToAllSnapshotsOfVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateQuotaCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateRngDeviceTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVdsGroupCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmDiskCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmPoolWithVmsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateWatchdogCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/aaa/GetUserBySessionIdQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/aaa/RemoveAdGroupCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/aaa/SessionDataContainerTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/AbstractRemoveGlusterVolumeBricksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GeoRepSessionCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterHookCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/ManageGlusterServiceCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterHooksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/RefreshGlusterVolumeDetailsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/SetupGlusterGeoRepMountBrokerInternalCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StartRemoveGlusterVolumeBricksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StopRebalanceGlusterVolumeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterHostPubKeyToSlaveInternalCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/hostdeploy/InstallVdsInternalCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/hostdeploy/UpgradeOvirtNodeInternalCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/lsm/LiveMigrateVmDisksCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/cluster/AttachNetworkToClusterInternalCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/dc/GetManagementNetworkCandidatesQueryTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/network/host/UpdateHostNicVfsConfigCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/AddAffinityGroupCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/ClusterPolicyCRUDCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/scheduling/commands/EditAffinityGroupCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/ActivateStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddExistingBlockStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddExistingFileStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddStorageDomainCommonTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AttachStorageDomainToPoolCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AttachStorageServerConnectionToStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/ConnectStorageToVdsCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/DetachStorageConnectionFromStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/ReconstructMasterDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RefreshLunsSizeCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStoragePoolCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBaseTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StorageHandlingCommandBaseTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionTestCommon.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/SyncLunsInfoForBlockStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/UpdateStorageDomainCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommandTest.java
123 files changed, 427 insertions(+), 489 deletions(-)
Approvals:
Martin Peřina: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
Martin Betak: Verified
Omer Frenkel: Looks good to me, but someone else must approve
Moti Asayag: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/45232
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib65a89454e2456a0eeab07ed3cd0976c325745b4
Gerrit-PatchSet: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel at redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
More information about the Engine-commits
mailing list