auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void quota_storageSelectedItemChanged ( final org.ovirt.engine.core.compat.Guid defaultQuotaId ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { getStorageQuota ( defaultQuotaId ) ; } getStorageDomain ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getStorageQuota ( defaultQuotaId ) ; } } ) ; }

Target:
public void quota_storageSelectedItemChanged ( final org.ovirt.engine.core.compat.Guid defaultQuotaId ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { getStorageQuota ( defaultQuotaId ) ; } getStorageDomain ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getStorageQuota ( defaultQuotaId ) ; } } ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Problematic ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }

Target:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
static java.util.List < org.ovirt.engine.api.model.Bookmark > setUpBookmarks ( ) { java.util.List < org.ovirt.engine.api.model.Bookmark > bookmarks = new java.util.ArrayList < org.ovirt.engine.api.model.Bookmark > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.api.model.Bookmark bookmark = new org.ovirt.engine.api.model.Bookmark ( ) ; bookmark.setbookmark_id ( GUIDS [ i ] ) ; bookmark.setbookmark_name ( NAMES [ i ] ) ; bookmark.setbookmark_value ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ i ] ) ; bookmarks.add ( bookmark ) ; } return bookmarks ; }

Target:
static java.util.List < org.ovirt.engine.api.model.Bookmark > setUpBookmarks ( ) { java.util.List < org.ovirt.engine.api.model.Bookmark > bookmarks = new java.util.ArrayList < org.ovirt.engine.api.model.Bookmark > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.api.model.Bookmark bookmark = new org.ovirt.engine.api.model.Bookmark ( ) ; bookmark.setId ( GUIDS [ i ] ) ; bookmark.setName ( NAMES [ i ] ) ; bookmark.setValue ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ i ] ) ; bookmarks.add ( bookmark ) ; } return bookmarks ; }
Source:
private void UpdateIsSysprepEnabled ( ) { boolean isFloppyAttached = ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ; boolean isVmFirstRun = ( ( java.lang.Boolean ) ( getIsVmFirstRun ( ) . getEntity ( ) ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getIsWindowsOS ( ) ) && ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ) ; }

Target:
public void updateInitialRunFields ( ) { getIsSysprepPossible ( ) . setEntity ( getIsWindowsOS ( ) ) ; getIsSysprepEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ) ) ; getIsCloudInitPossible ( ) . setEntity ( getIsLinuxOS ( ) ) ; getIsCloudInitEnabled ( ) . setEntity ( ( ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.CloudInit ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult numOfVfsInValidRange ( int numOfVfs ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NUM_OF_VFS_REPLACEMENT , numOfVfs ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.MAX_NUM_OF_VFS_REPLACEMENT , oldVfsConfig.getMaxNumOfVfs ( ) ) ) . when ( ( ( numOfVfs > ( oldVfsConfig.getMaxNumOfVfs ( ) ) ) || ( numOfVfs < 0 ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult numOfVfsInValidRange ( int numOfVfs ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_NUM_OF_VFS_NOT_IN_VALID_RANGE , getNicNameReplacement ( ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.NUM_OF_VFS_REPLACEMENT , numOfVfs ) , java.lang.String.format ( org.ovirt.engine.core.bll.validator.VfsConfigValidator.MAX_NUM_OF_VFS_REPLACEMENT , oldVfsConfig.getMaxNumOfVfs ( ) ) ) . when ( ( ( numOfVfs > ( oldVfsConfig.getMaxNumOfVfs ( ) ) ) || ( numOfVfs < 0 ) ) ) ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.NGuid.NewGuid ( ) ; entity.setrun_on_vds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.NGuid.NewGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile ) ; return performCreate ( VdcActionType.AddVnicProfile , new org.ovirt.engine.core.common.action.AddVnicProfileParameters ( map ( vnicProfile ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.VnicProfile vnicProfile ) { validateParameters ( vnicProfile ) ; org.ovirt.engine.core.common.action.AddVnicProfileParameters addVnicProfileParameters = new org.ovirt.engine.core.common.action.AddVnicProfileParameters ( map ( vnicProfile ) , ( ! ( vnicProfile.isSetNetworkFilter ( ) ) ) ) ; return performCreate ( VdcActionType.AddVnicProfile , addVnicProfileParameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVnicProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
protected org.ovirt.engine.core.utils.lock.EngineLock acquireVolumeSnapshotLock ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( java.util.Collections.singletonMap ( id.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_LOCKED ) ) , null ) ; org.ovirt.engine.core.bll.gluster.GlusterVolumeSnapshotCommandBase.getLockManager ( ) . acquireLockWait ( lock ) ; return lock ; }

Target:
protected org.ovirt.engine.core.utils.lock.EngineLock acquireVolumeSnapshotLock ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( java.util.Collections.singletonMap ( id.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER_SNAPSHOT , EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_LOCKED ) ) , null ) ; lockManager.acquireLockWait ( lock ) ; return lock ; }
Source:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; }

Target:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }
Source:
public void dataCenterWithClusterSelectedItemChanged ( ) { super . dataCenterWithClusterSelectedItemChanged ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > ( ) ; queryTypeList.add ( VdcQueryType.GetVmTemplatesWithPermittedAction ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( org.ovirt.engine.ui.uicommonweb.models.vms.UserPortalNewVmModelBehavior.CREATE_VM ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase [ ] { getEntitiesWithPermittedActionParameters } ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , parametersList , this , getModel ( ) . getHash ( ) ) ; }

Target:
public void dataCenterWithClusterSelectedItemChanged ( ) { super . dataCenterWithClusterSelectedItemChanged ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > ( ) ; queryTypeList.add ( VdcQueryType.GetVmTemplatesWithPermittedAction ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( org.ovirt.engine.ui.uicommonweb.models.vms.UserPortalNewVmModelBehavior.CREATE_VM ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase [ ] { getEntitiesWithPermittedActionParameters } ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleQueries ( queryTypeList , parametersList , this , getModel ( ) . getHash ( ) ) ; }
Source:
public static boolean isLastSuperUserPermission ( org.ovirt.engine.core.compat.Guid roleId ) { boolean retValue = false ; if ( PredefinedRoles.SUPER_USER.getId ( ) . equals ( roleId ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDao ( ) . getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { retValue = true ; } } return retValue ; }

Target:
public boolean isLastSuperUserPermission ( org.ovirt.engine.core.compat.Guid roleId ) { boolean retValue = false ; if ( PredefinedRoles.SUPER_USER.getId ( ) . equals ( roleId ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permission > permissions = permissionDao.getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { retValue = true ; } } return retValue ; }
Source:
protected void postGetHost ( java.lang.String hostName ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( "[virt-viewer]" ) ; configBuilder.append ( "\ntype=vnc" ) . append ( "\nhost=" ) . append ( hostName ) . append ( "\nport=" ) . append ( getEntity ( ) . getDisplay ( ) . toString ( ) ) . append ( "\npassword=" ) . append ( otp64 ) . append ( "\ntitle=" ) . append ( getTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
private java.lang.String getPort ( ) { if ( ( ( getEntity ( ) ) == null ) && ( ( getEntity ( ) . getDisplay ( ) ) == null ) ) { return null ; } return getEntity ( ) . getDisplay ( ) . toString ( ) ; }
Source:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = GetCurrentActionTypeTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { return false ; } } } return true ; }

Target:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "Task ID: '{0}' is in state {1}. End action for command {2} will proceed when all the entity's tasks are completed." , task.getVdsmTaskId ( ) , task.getState ( ) , getCommandId ( ) ) ; return false ; } } } return true ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }

Target:
public static boolean IsVersionMatchStorageType ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.StorageType type ) { return ! ( ( ( type == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) && ( ( version.compareTo ( new org.ovirt.engine.core.compat.Version ( 2 , 2 ) ) ) <= 0 ) ) || ( ( type == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) && ( ( version.compareTo ( new org.ovirt.engine.core.compat.Version ( 3 , 0 ) ) ) <= 0 ) ) ) ; }
Source:
protected void addPermissionSubjectForCustomProperties ( java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList ) { org.ovirt.engine.core.common.businessentities.VmStatic vmFromParams = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) ; if ( ( vmFromParams != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmFromParams.getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } }

Target:
protected void addPermissionSubjectForCustomProperties ( java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList ) { org.ovirt.engine.core.common.businessentities.VmStatic vmFromParams = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) ; if ( ( vmFromParams != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vmFromParams.getCustomProperties ( ) ) ) ) ) { permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CHANGE_VM_CUSTOM_PROPERTIES ) ) ; } }
Source:
public void testCleanNotExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }
Source:
public static void EnableLoadBalancer ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.VdsLoadBalancer.instance , "PerformLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; }

Target:
public static void EnableLoadBalancer ( ) { org.ovirt.engine.core.bll.VdsLoadBalancer.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.VdsLoadBalancer.instance , "PerformLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.VdsLoadBalancer.log.info ( "Finished scheduling to enable vds load balancer" ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.BaseDisk generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.BaseDisk d = new org.ovirt.engine.core.common.businessentities.BaseDisk ( ) ; d.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; d.setDiskInterface ( DiskInterface.IDE ) ; d.setWipeAfterDelete ( true ) ; d.setPropagateErrors ( PropagateErrors.Off ) ; d.setDiskAlias ( "DiskName" ) ; d.setSgio ( ScsiGenericIO.FILTERED ) ; return d ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.BaseDisk generateNewEntity ( ) { org.ovirt.engine.core.common.businessentities.storage.BaseDisk d = new org.ovirt.engine.core.common.businessentities.storage.BaseDisk ( ) ; d.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; d.setDiskInterface ( DiskInterface.IDE ) ; d.setWipeAfterDelete ( true ) ; d.setPropagateErrors ( PropagateErrors.Off ) ; d.setDiskAlias ( "DiskName" ) ; d.setSgio ( ScsiGenericIO.FILTERED ) ; return d ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterIdAndServerId ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; params.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStopActionTypeAndClusterIdAndServerId ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; cmd.getParameters ( ) . setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.getParameters ( ) . setServerId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd.setClusterId ( cmd.getParameters ( ) . getClusterId ( ) ) ; cmd.setVdsId ( cmd.getParameters ( ) . getServerId ( ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getValidationMessages ( ) , org.hamcrest.Matchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; }

Target:
public void testLiveSnapshotWhenNoPluggedDiskSnapshot ( ) { org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . isLiveSnapshotApplicable ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; getPmSecondaryEncryptOptions ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmEncryptOptions ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeRemoveBricksStop ( java.lang.String volumeName , java.lang.String [ ] brickDirectories , int replicaCount ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeRemoveBrickStop ( volumeName , brickDirectories , replicaCount ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc glusterVolumeRemoveBricksStop ( java.lang.String volumeName , java.lang.String [ ] brickDirectories , int replicaCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeRemoveBrickStop ( volumeName , brickDirectories , replicaCount ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.notifier.filter.AuditLogEvent createDBDownEvent ( ) { final org.ovirt.engine.core.notifier.filter.AuditLogEvent dbDownEvent = new org.ovirt.engine.core.notifier.filter.AuditLogEvent ( ) ; dbDownEvent.setLogTime ( new java.util.Date ( ) ) ; dbDownEvent.setType ( AuditLogEventType.alertMessage ) ; dbDownEvent.setLogTypeName ( org.ovirt.engine.core.notifier.dao.EventsManager.DATABASE_UNREACHABLE ) ; dbDownEvent.setMessage ( "Failed to query for notifications. Database Connection refused." ) ; dbDownEvent.setSeverity ( AuditLogSeverity.ERROR ) ; return dbDownEvent ; }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLogEvent createDBDownEvent ( ) { final org.ovirt.engine.core.common.businessentities.AuditLogEvent dbDownEvent = new org.ovirt.engine.core.common.businessentities.AuditLogEvent ( ) ; dbDownEvent.setLogTime ( new java.util.Date ( ) ) ; dbDownEvent.setType ( AuditLogEventType.alertMessage ) ; dbDownEvent.setLogTypeName ( "DATABASE_UNREACHABLE" ) ; dbDownEvent.setMessage ( "Failed to query for notifications. Database Connection refused." ) ; dbDownEvent.setSeverity ( AuditLogSeverity.ERROR ) ; return dbDownEvent ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getParameters ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , getParameters ( ) . getStorageDomainId ( ) , ( ( double ) ( getDiskImage ( ) . getSizeInGigabytes ( ) ) ) ) ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getStorageDomainId ( ) , ( ( double ) ( getDiskImage ( ) . getSizeInGigabytes ( ) ) ) ) ) ; return list ; }
Source:
private org.ovirt.engine.core.bll.context.CommandContext getContext ( ) { if ( ( commandContext ) == null ) { commandContext = new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RestartVdsCommand.getExecutionContext ( ) , new org.ovirt.engine.core.utils.lock.EngineLock ( org.ovirt.engine.core.bll.RestartVdsCommand.getExclusiveLocks ( ) , null ) ) ; } return commandContext ; }

Target:
public org.ovirt.engine.core.bll.context.CommandContext getContext ( ) { if ( ( commandContext ) == null ) { commandContext = org.ovirt.engine.core.bll.RestartVdsCommand.dupContext ( ) . withExecutionContext ( org.ovirt.engine.core.bll.RestartVdsCommand.getExecutionContext ( ) ) . withLock ( new org.ovirt.engine.core.utils.lock.EngineLock ( org.ovirt.engine.core.bll.RestartVdsCommand.getExclusiveLocks ( ) , null ) ) ; } return commandContext ; }
Source:
public void testValidateAndSetStorageQuotaGlobalOverThreshold ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > parameters = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; parameters.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_GLOBAL_OVER_THRESHOLD , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 ) ) ; org.junit.Assert.assertTrue ( quotaManager.validateAndSetStorageQuota ( storage_pool , parameters , canDoActionMessages ) ) ; assertEmptyCanDoActionMessage ( ) ; assertAuditLogWritten ( ) ; }

Target:
private boolean consumeForVdsQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 , 1 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, vm.vm_name=%s, nic=%s, vmDevice=%s" , super . toString ( ) , ( ( getVm ( ) ) == null ? "" : getVm ( ) . getName ( ) ) , getNic ( ) , getVmDevice ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "vm.vm_name" , ( ( getVm ( ) ) == null ? "" : getVm ( ) . getName ( ) ) ) . append ( "nic" , getNic ( ) ) . append ( "vmDevice" , getVmDevice ( ) ) ; }
Source:
public boolean isNotValid ( ) { return ( ( ( ( major ) == ( - 1 ) ) && ( ( minor ) == ( - 1 ) ) ) && ( ( revision ) == ( - 1 ) ) ) && ( ( build ) == ( - 1 ) ) ; }

Target:
public boolean isNotValid ( ) { return ( ( ( ( major ) == ( org.ovirt.engine.core.compat.Version.VERSION_NOT_SET ) ) && ( ( minor ) == ( org.ovirt.engine.core.compat.Version.VERSION_NOT_SET ) ) ) && ( ( revision ) == ( org.ovirt.engine.core.compat.Version.VERSION_NOT_SET ) ) ) && ( ( build ) == ( org.ovirt.engine.core.compat.Version.VERSION_NOT_SET ) ) ; }
Source:
private boolean verifyImage ( org.ovirt.engine.core.compat.Guid transferingVdsId ) { org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( transferingVdsId , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getImage ( ) . getImageId ( ) ) ; try { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getBackend ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.VerifyUntrustedVolume , parameters ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Failed to verify transferred image: {}" , e ) ; return false ; } return true ; }

Target:
private boolean verifyImage ( org.ovirt.engine.core.compat.Guid transferingVdsId ) { org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( transferingVdsId , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getDiskImage ( ) . getImageId ( ) ) ; try { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getBackend ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.VerifyUntrustedVolume , parameters ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Failed to verify transferred image: {}" , e ) ; return false ; } return true ; }
Source:
public void unsubscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . name ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }

Target:
public void unsubscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . getAsString ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }
Source:
private static org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByIscsiBondId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResourceTest.ISCSI_BOND_ID } , getEntityList ( ) , failure ) ; } }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; _deploy.getParser ( ) . cliEnvironmentSet ( GlusterEnv.ENABLE , cluster.supportsGlusterService ( ) ) ; return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.ClusterDao.class ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; _deploy.getParser ( ) . cliEnvironmentSet ( GlusterEnv.ENABLE , cluster.supportsGlusterService ( ) ) ; return true ; }
Source:
static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.mMessages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
private static void checkSeverities ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warnFormat ( "AuditLogType: {0} not have severity. Assumed Normal" , value.toString ( ) ) ; } } } }
Source:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, targetVdsId = %s, action = %s, ip = %s, port = %s, type = %s, user = %s, " + "password = %s, options = '%s'" ) , super . toString ( ) , getTargetVdsID ( ) , getAction ( ) , getIp ( ) , getPort ( ) , getType ( ) , getUser ( ) , ( ( getPassword ( ) ) == null ? null : "******" ) , getOptions ( ) ) ; }

Target:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, targetVdsId = %s, action = %s, ip = %s, port = %s, type = %s, user = %s, " + "password = %s, options = '%s', policy = '%s'" ) , super . toString ( ) , getTargetVdsID ( ) , getAction ( ) , getIp ( ) , getPort ( ) , getType ( ) , getUser ( ) , ( ( getPassword ( ) ) == null ? null : "******" ) , getOptions ( ) , getFencingPolicy ( ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getLun ( ) . getVendorId ( ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return ( ( long ) ( disk.getLun ( ) . getDeviceSize ( ) ) ) ; }
Source:
public void testGetVmsCountByClusterId ( ) { org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.VDS_GROUP_RHEL6_NFS ) , FixturesTool.NUMBER_OF_VMS_IN_VDS_GROUP_RHEL6_NFS_CLUSTER ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.VDS_GROUP_RHEL6_ISCSI ) , FixturesTool.NUMBER_OF_VMS_IN_VDS_GROUP_RHEL6_ISCSI ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , 0 ) ; }

Target:
public void testGetVmsCountByClusterId ( ) { org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_NFS ) , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_NFS_CLUSTER ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( FixturesTool.CLUSTER_RHEL6_ISCSI ) , FixturesTool.NUMBER_OF_VMS_IN_CLUSTER_RHEL6_ISCSI ) ; org.junit.Assert.assertEquals ( "Incorrect number of VMs in cluster" , dao.getVmsCountByClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , 0 ) ; }
Source:
private void mockDAOs ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( cmd ) . getVmDAO ( ) ; org.mockito.Mockito.doReturn ( sdDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDAO ) . when ( cmd ) . getVmTemplateDAO ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; }

Target:
private void mockDAOs ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( cmd ) . getVmDAO ( ) ; org.mockito.Mockito.doReturn ( sdDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDAO ) . when ( cmd ) . getVmTemplateDAO ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( cmd ) . getVmDeviceDao ( ) ; }
Source:
public void setup ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator ( vmDao , network ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; org.mockito.Mockito.when ( dbFacade.getNetworkDao ( ) ) . thenReturn ( networkDao ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
public void setup ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator ( vmDao , network ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( validator ) . getDbFacade ( ) ; org.mockito.Mockito.when ( dbFacade.getNetworkDao ( ) ) . thenReturn ( networkDao ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( networks ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.VmPoolType vmPoolType , java.lang.String incoming ) { if ( vmPoolType == null ) { return null ; } switch ( vmPoolType ) { case Automatic : return VmPoolType.AUTOMATIC.value ( ) ; case Manual : return VmPoolType.MANUAL.value ( ) ; default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.VmPoolType vmPoolType , java.lang.String incoming ) { if ( vmPoolType == null ) { return null ; } switch ( vmPoolType ) { case AUTOMATIC : return VmPoolType.AUTOMATIC.value ( ) ; case MANUAL : return VmPoolType.MANUAL.value ( ) ; default : return null ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getParameters ( ) . getVmId ( ) ; status = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getBroker ( ) . migrateCancel ( vmId.toString ( ) ) ; proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . RemoveAsyncRunningVm ( vmId ) ; }
Source:
public void testUpdateIDEDiskAsReadOnlyNotSupported ( ) { org.ovirt.engine.core.common.businessentities.DiskImage updatedDisk = createDiskImage ( ) ; updatedDisk.setReadOnly ( true ) ; updatedDisk.setDiskInterface ( DiskInterface.IDE ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskFromDB = createDiskImage ( ) ; diskFromDB.setReadOnly ( false ) ; diskFromDB.setDiskInterface ( DiskInterface.IDE ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( diskFromDB ) ; initializeCommand ( new org.ovirt.engine.core.common.action.UpdateVmDiskParameters ( vmId , diskImageGuid , updatedDisk ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_IDE_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ; }

Target:
public void testFailInterfaceCanUpdateReadOnly ( ) { initializeCommand ( new org.ovirt.engine.core.common.action.UpdateVmDiskParameters ( vmId , diskImageGuid , createDiskImage ( ) ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . updateReadOnlyRequested ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR ) ) . when ( diskValidator ) . isReadOnlyPropertyCompatibleWithInterface ( ) ; org.junit.Assert.assertFalse ( command.validateCanUpdateReadOnly ( diskValidator ) ) ; }