auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public boolean performNextOperation ( int completedChildCount ) { if ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getNextPhase ( ) ) == ( ImportRepoImageParameters.Phase.DOWNLOAD ) ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setNextPhase ( ImportRepoImageParameters.Phase.END ) ; persistCommand ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.DownloadImage , createDownloadImageParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getContext ( ) ) ) ; return true ; } return false ; }

Target:
public boolean performNextOperation ( int completedChildCount ) { if ( ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getNextPhase ( ) ) == ( ImportRepoImageParameters.Phase.DOWNLOAD ) ) { org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . setNextPhase ( ImportRepoImageParameters.Phase.END ) ; persistCommand ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getParentCommand ( ) , true ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.DownloadImage , createDownloadImageParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getContext ( ) ) ) ; return true ; } return false ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.ProcessOvfUpdateForStorageDomainCommandParameters createProcessOvfUpdateForDomainParams ( ) { org.ovirt.engine.core.common.action.ProcessOvfUpdateForStorageDomainCommandParameters params = new org.ovirt.engine.core.common.action.ProcessOvfUpdateForStorageDomainCommandParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getStorageDomainId ( ) ) ; params.setSkipDomainChecks ( true ) ; if ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.isExecutedAsChildCommand ( ) ) { params.setParentCommand ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentCommand ( ) ) ; params.setEntityInfo ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentParameters ( ) . getEntityInfo ( ) ) ; params.setParentParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentParameters ( ) ) ; } return params ; }

Target:
private org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters createProcessOvfUpdateForDomainParams ( ) { org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters params = new org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getStorageDomainId ( ) ) ; params.setSkipDomainChecks ( true ) ; if ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.isExecutedAsChildCommand ( ) ) { params.setParentCommand ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentCommand ( ) ) ; params.setEntityInfo ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentParameters ( ) . getEntityInfo ( ) ) ; params.setParentParameters ( org.ovirt.engine.core.bll.storage.domain.UpdateOvfStoreForStorageDomainCommand.getParameters ( ) . getParentParameters ( ) ) ; } return params ; }
Source:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.Assert.assertEquals ( 2 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.Assert.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.Assert.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }

Target:
public void getPermissionCheckSubjectsTest ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = addClusterCommand.getPermissionCheckSubjects ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , permissions.size ( ) ) ; org.ovirt.engine.core.bll.utils.PermissionSubject permissionSubject = permissions.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( cluster.getStoragePoolId ( ) , permissionSubject.getObjectId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( VdcObjectType.StoragePool , permissionSubject.getObjectType ( ) ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private void AddVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setstatus ( VMStatus.ImageLocked ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setapp_list ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getapp_list ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setstatus ( VMStatus.ImageLocked ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setapp_list ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getapp_list ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc diskReplicateFinish ( java.lang.String vmUUID , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct srcDisk , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct dstDisk ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskReplicateFinish ( vmUUID , srcDisk.getInnerMap ( ) , dstDisk.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , java.util.Map device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel ( this , org.ovirt.engine.core.compat.Version.v3_3 , profile ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( getSelectedItem ( ) ) ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.EditVnicProfileModel ( this , profile.getCompatibilityVersion ( ) , profile ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }
Source:
public static org.ovirt.engine.core.bll.context.CommandContext createDefaultContexForTasks ( org.ovirt.engine.core.bll.job.ExecutionContext parentContext , org.ovirt.engine.core.utils.lock.EngineLock lock ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; if ( parentContext != null ) { if ( ( parentContext.getJob ( ) ) != null ) { org.ovirt.engine.core.common.job.Step parentStep = parentContext.getParentTasksStep ( ) ; if ( parentStep != null ) { executionContext.setParentTasksStep ( parentStep ) ; } } else { executionContext.setParentTasksStep ( parentContext.getParentTasksStep ( ) ) ; } } return new org.ovirt.engine.core.bll.context.CommandContext ( executionContext , lock ) ; }

Target:
private static org.ovirt.engine.core.bll.job.ExecutionContext createDefaultContextForTasksImpl ( org.ovirt.engine.core.bll.job.ExecutionContext parentExecutionContext ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; if ( parentExecutionContext != null ) { if ( ( parentExecutionContext.getJob ( ) ) != null ) { org.ovirt.engine.core.common.job.Step parentStep = parentExecutionContext.getParentTasksStep ( ) ; if ( parentStep != null ) { executionContext.setParentTasksStep ( parentStep ) ; } } else { executionContext.setParentTasksStep ( parentExecutionContext.getParentTasksStep ( ) ) ; } } return executionContext ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterStorageQosListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand.equals ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditCommand ( ) ) ) ) { return storageQosPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterHostNetworkQosListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( ( lastExecutedCommand.equals ( getModel ( ) . getNewCommand ( ) ) ) || ( lastExecutedCommand.equals ( getModel ( ) . getEditCommand ( ) ) ) ) { return hostNetworkQosPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.MacPool model = org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void testDeleteUnregisteredEntity ( ) { org.ovirt.engine.core.common.businessentities.OvfEntityData ovfEntityData = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertNotNull ( ovfEntityData ) ; dao.removeEntity ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; ovfEntityData = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertNull ( ovfEntityData ) ; }

Target:
public void testDeleteUnregisteredEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ( ( ovfEntityDataList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertFalse ( ovfEntityDataList.isEmpty ( ) ) ; dao.removeEntity ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.OvfEntityData > ovfEntityDataList2 = dao.getByEntityIdAndStorageDomain ( FixturesTool.UNREGISTERED_VM , FixturesTool.STORAGE_DOAMIN_NFS2_1 ) ; org.junit.Assert.assertTrue ( ovfEntityDataList2.isEmpty ( ) ) ; }
Source:
public void testGetTagVdsMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVdsMap > result = dao.getTagVdsMapByTagName ( existingTag.gettag_name ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVdsMap mapping : result ) { assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }

Target:
public void testGetTagVdsMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVdsMap > result = dao.getTagVdsMapByTagName ( existingTag.gettag_name ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVdsMap mapping : result ) { org.junit.Assert.assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.info ( "-- executeIrsBrokerCommand: Attempting on storage pool '{}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.info ( "-- executeIrsBrokerCommand: Attempting on storage pool '{}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( resourceManager.runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }
Source:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( "reset" ) ; model.setModel ( "i6300esb" ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( entity.getAction ( ) , VmWatchdogAction.RESET ) ; org.junit.Assert.assertEquals ( entity.getModel ( ) , VmWatchdogType.i6300esb ) ; }

Target:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( WatchdogAction.RESET ) ; model.setModel ( WatchdogModel.I6300ESB ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( entity.getAction ( ) , VmWatchdogAction.RESET ) ; org.junit.Assert.assertEquals ( entity.getModel ( ) , VmWatchdogType.i6300esb ) ; }
Source:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getStorageName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getStorageName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }
Source:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( getVds ( ) . getDynamicData ( ) ) ; }

Target:
protected void persistCollectedData ( ) { super . persistCollectedData ( ) ; org.ovirt.engine.core.dao.VdsDynamicDAO vdsDynamicDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic hostFromDb = vdsDynamicDao.get ( getVds ( ) . getId ( ) ) ; hostFromDb.setsupported_cluster_levels ( getVds ( ) . getDynamicData ( ) . getsupported_cluster_levels ( ) ) ; vdsDynamicDao.update ( hostFromDb ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; cmd.poolPerDc = macPoolPerDc ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; cmd.poolPerDc = macPoolPerDc ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; initializeVmStaticDaoMock ( vm ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkResourceTest.NETWORK_ID } , java.util.Collections.emptyList ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void validateCantLiveMigrateToBackupDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( srcStorageId ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }

Target:
public void validateCantLiveMigrateToBackupDomain ( ) { initStorageDomain ( srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setBackup ( true ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc reconcileVolumeChain ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String leafVolUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.reconcileVolumeChain" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "leafVolID" , leafVolUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "volumes" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturn reconcileVolumeChain ( java.lang.String spUUID , java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String leafVolUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.reconcileVolumeChain" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgGUID ) . withParameter ( "leafVolID" , leafVolUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "volumes" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.VolumeListReturn ( response ) ; }
Source:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; }

Target:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getid ( ) ) != null ) && ( ! ( connection.getid ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }
Source:
public void storagePoolStatusChange ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.errors.VdcBllErrors error , org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption ) { org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters tempVar = new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( storagePoolId , status , auditLogType ) ; tempVar.setError ( error ) ; if ( transactionScopeOption != null ) { tempVar.setTransactionScopeOption ( transactionScopeOption ) ; } backend.runInternalAction ( VdcActionType.SetStoragePoolStatus , tempVar ) ; }

Target:
public void storagePoolStatusChange ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.errors.EngineError error , org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption ) { org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters tempVar = new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( storagePoolId , status , auditLogType ) ; tempVar.setError ( error ) ; if ( transactionScopeOption != null ) { tempVar.setTransactionScopeOption ( transactionScopeOption ) ; } backend.runInternalAction ( VdcActionType.SetStoragePoolStatus , tempVar ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS param ) { return org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) ; }

Target:
public void setup ( ) { initVds ( ) ; initConditions ( ) ; updater = new org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo ( null , vds , org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) ) { @ java.lang.Override public org.ovirt.engine.core.dal.dbbroker.DbFacade getDbFacade ( ) { return dbFacade ; } @ java.lang.Override protected void auditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { org.ovirt.engine.core.common.businessentities.AuditLog al = new org.ovirt.engine.core.common.businessentities.AuditLog ( ) ; al.setlog_type ( logType ) ; mockAuditLogDao.save ( al ) ; } @ java.lang.Override protected org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct [ ] getVmInfo ( java.util.List < java.lang.String > vmsToUpdate ) { return vmInfo ; } } ; }
Source:
public static void GetDocumentationBaseURL ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute Logoff: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Login." ) ; org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) && ( result.getSucceeded ( ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLoginSuccess ( userName , password , domain ) ; } }
Source:
java.util.Map getNumaNodeDistanceMap ( ) { java.util.Map numaNodeDistanceMap = map ( ) ; java.util.List nodeZeroDistList = lst ( ) ; nodeZeroDistList.add ( "10" ) ; nodeZeroDistList.add ( "20" ) ; numaNodeDistanceMap.put ( "0" , nodeZeroDistList ) ; java.util.List nodeOneDistList = lst ( ) ; nodeOneDistList.add ( "20" ) ; nodeOneDistList.add ( "10" ) ; numaNodeDistanceMap.put ( "1" , nodeOneDistList ) ; return numaNodeDistanceMap ; }

Target:
java.util.Map getNumaNodeDistanceMap ( ) { java.util.Map numaNodeDistanceMap = map ( ) ; java.util.List nodeZeroDistList = lst ( ) ; nodeZeroDistList.add ( java.lang.Integer.valueOf ( 10 ) ) ; nodeZeroDistList.add ( java.lang.Integer.valueOf ( 20 ) ) ; numaNodeDistanceMap.put ( "0" , nodeZeroDistList ) ; java.util.List nodeOneDistList = lst ( ) ; nodeOneDistList.add ( java.lang.Integer.valueOf ( 20 ) ) ; nodeOneDistList.add ( java.lang.Integer.valueOf ( 10 ) ) ; numaNodeDistanceMap.put ( "1" , nodeOneDistList ) ; return numaNodeDistanceMap ; }
Source:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterSnapshotConfig ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotConfig , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) , aQuery ) ; }
Source:
public void testWith0ScoreHostAndSomeHaveEnoughMemoryForTwo ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableScore ( 0 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 6000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 4 , result.size ( ) ) ; }

Target:
public void testWith0ScoreHostAndSomeHaveEnoughMemoryForTwo ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "3" ) ; hostedEngine.setVmMemSizeMb ( 5000 ) ; hosts.get ( 2 ) . setHighlyAvailableScore ( 0 ) ; hosts.get ( 3 ) . setPhysicalMemMb ( 6000 ) ; hosts.get ( 4 ) . setPhysicalMemMb ( 2048 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 4 , result.size ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; actionGroup = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getActionGroup ( ) ) . thenReturn ( actionGroup ) ; sessionID = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( sessionID ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( sessionID , org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getUser ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; actionGroup = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . pickRandom ( org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getActionGroup ( ) ) . thenReturn ( actionGroup ) ; sessionID = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getQueryParameters ( ) . getSessionId ( ) ) . thenReturn ( sessionID ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . setUser ( sessionID , org.ovirt.engine.core.bll.AbstractGetEntitiesWithPermittedActionParametersQueryTest.getUser ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getAllInterfacesByLabelForCluster ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String label ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > labelledNics = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : getAllInterfacesByClusterId ( clusterId ) ) { if ( ( ( nic.getLabels ( ) ) != null ) && ( nic.getLabels ( ) . contains ( label ) ) ) { labelledNics.add ( nic ) ; } } return labelledNics ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsContainingLabel ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , java.lang.String label ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : interfaces ) { if ( ( ( vdsNetworkInterface.getLabels ( ) ) != null ) && ( vdsNetworkInterface.getLabels ( ) . contains ( label ) ) ) { result.add ( vdsNetworkInterface ) ; } } return result ; }
Source:
public void testUpdate ( ) { existing_bookmark.setbookmark_name ( existing_bookmark.getbookmark_name ( ) . toUpperCase ( ) ) ; dao.update ( existing_bookmark ) ; org.ovirt.engine.core.common.businessentities.Bookmark result = dao.get ( existing_bookmark.getbookmark_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existing_bookmark.getbookmark_name ( ) , result.getbookmark_name ( ) ) ; }

Target:
public void testUpdate ( ) { existing_bookmark.setName ( existing_bookmark.getName ( ) . toUpperCase ( ) ) ; dao.update ( existing_bookmark ) ; org.ovirt.engine.core.common.businessentities.Bookmark result = dao.get ( existing_bookmark.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existing_bookmark.getName ( ) , result.getName ( ) ) ; }
Source:
private void vnicProfileNotUsedByVmsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.mockito.Mockito.when ( vmDao.getAllForVnicProfile ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; org.junit.Assert.assertThat ( validator.vnicProfileNotUsedByVms ( ) , matcher ) ; }

Target:
private void mockVmsUsingVnicProfile ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { org.mockito.Mockito.when ( vmDao.getAllForVnicProfile ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vms ) ; }
Source:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = new org.ovirt.engine.core.bll.VmManagementCommandBase ( org.ovirt.engine.core.compat.Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }

Target:
public void isCpuPinningValidWithoutPinnedHost ( ) { org.ovirt.engine.core.bll.VmManagementCommandBase < org.ovirt.engine.core.common.action.VmManagementParametersBase > test = new org.ovirt.engine.core.bll.VmManagementCommandBase ( org.ovirt.engine.core.compat.Guid.Empty ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setNumOfSockets ( 6 ) ; vmStatic.setCpuPerSocket ( 2 ) ; vmStatic.setDedicatedVmForVdsList ( new java.util.LinkedList < > ( ) ) ; org.junit.Assert.assertFalse ( test.isCpuPinningValid ( "0#0" , vmStatic ) ) ; org.junit.Assert.assertFalse ( test.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_CANNOT_BE_PINNED_TO_CPU_WITH_UNDEFINED_HOST ) ) ; }
Source:
private void translateErrors ( final java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > errors ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal : errors ) { retVal.setCanDoActionMessages ( ( ( java.util.ArrayList < java.lang.String > ) ( translateError ( retVal ) ) ) ) ; } }

Target:
private void translateErrors ( final java.util.Collection < org.ovirt.engine.core.common.action.VdcReturnValueBase > errors ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase retVal : errors ) { if ( ! ( retVal.getCanDoAction ( ) ) ) { retVal.setCanDoActionMessages ( ( ( java.util.ArrayList < java.lang.String > ) ( translateError ( retVal ) ) ) ) ; } else if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.common.errors.EngineFault fault = retVal.getFault ( ) ; fault.setMessage ( translateEngineFault ( fault ) ) ; } } }