auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; int refreshRate = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; refreshIteration = ( numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "onTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , refreshRate , refreshRate , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void schedulJobs ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil sched = org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) ; int refreshRate = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; refreshIteration = ( numberRefreshesBeforeSave ) - 1 ; onTimerJobId = sched.scheduleAFixedDelayJob ( this , "onTimer" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , refreshRate , refreshRate , java.util.concurrent.TimeUnit.MILLISECONDS ) ; vmsMonitoringJobId = sched.scheduleAFixedDelayJob ( this , "vmsMonitoring" , new java.lang.Class [ 0 ] , new java.lang.Object [ 0 ] , refreshRate , refreshRate , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
private void initTimeZones ( ) { java.util.Set < java.lang.String > timeZoneTypes = TimeZoneType.GENERAL_TIMEZONE.getTimeZoneList ( ) . keySet ( ) ; getTimeZones ( ) . setItems ( timeZoneTypes ) ; }

Target:
private void initValueChangeListeners ( ) { org.ovirt.engine.ui.uicompat.IEventListener onPropertyChangeValidate = 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 ) { validate ( true ) ; } } ; getSnapshotName ( ) . getEntityChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getDaysOfTheWeek ( ) . getSelectedItemChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getDaysOfMonth ( ) . getSelectedItemChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; getEndDate ( ) . getEntityChangedEvent ( ) . addListener ( onPropertyChangeValidate ) ; }
Source:
private org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommand createTestCommand ( org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks , int replicaCount , int stripeCount , boolean force ) { return new org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeBricksActionParameters ( volumeId , bricks , replicaCount , stripeCount , force ) , null ) ; }

Target:
private void initTestCommand ( org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks , int replicaCount , int stripeCount , boolean force ) { cmd.setGlusterVolumeId ( volumeId ) ; cmd.getParameters ( ) . setBricks ( bricks ) ; cmd.getParameters ( ) . setReplicaCount ( replicaCount ) ; cmd.getParameters ( ) . setStripeCount ( stripeCount ) ; cmd.getParameters ( ) . setForce ( force ) ; }
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.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
protected java.util.List < java.lang.Class < ? > > getValidationGroups ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return org.ovirt.engine.core.bll.ImportVmCommand.addValidationGroup ( org.ovirt.engine.core.common.validation.group.ImportClonedEntity.class ) ; } return org.ovirt.engine.core.bll.ImportVmCommand.addValidationGroup ( org.ovirt.engine.core.common.validation.group.ImportEntity.class ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.Guid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( canAttachPrestartedVmToUser ( map.getVmId ( ) , org.ovirt.engine.core.bll.AttachUserToVmFromPoolAndRunCommand.getReturnValue ( ) . getValidationMessages ( ) ) ) { return map.getVmId ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storageListModel , storages ) ; } else { storageListModel.saveNewGlusterStorage ( ) ; } }

Target:
private org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel getPosixModelByStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { switch ( storage.getStorageType ( ) ) { case GLUSTERFS : return new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; default : return new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; } }
Source:
public void liveMigrateDiskBasedOnTemplate ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImageBasedOnTemplate ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertFalse ( command.getLiveMigrateDisksParametersList ( ) . isEmpty ( ) ) ; }

Target:
public void moveUnpluggedDiskVmUp ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( command.getMoveDiskParametersList ( ) . size ( ) , 1 ) ; }
Source:
public org.ovirt.engine.sdk.decorators.DataCenterCluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.DataCenterCluster.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.DataCenterCluster add ( org.ovirt.engine.sdk.decorators.Cluster cluster ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , cluster , org.ovirt.engine.sdk.entities.Cluster.class , org.ovirt.engine.sdk.decorators.DataCenterCluster.class , headers ) ; }
Source:
private void fetchImageTemplates ( ) { if ( ( imageTemplates ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; imageTemplates = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( allImages , false , false , true ) ; imageTemplates.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( allImages , true ) ) ; } }

Target:
private void fetchImageTemplates ( ) { if ( ( imageTemplates ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; imageTemplates = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( allImages , false , false , true ) ; imageTemplates.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( allImages , true ) ) ; } }
Source:
private void removeVmStatelessImages ( ) { if ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDAO ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }

Target:
private void removeVmStatelessImages ( ) { if ( ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getSnapshotDao ( ) . exists ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) , SnapshotType.STATELESS ) ) && ( ( getVmPoolType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ) ) { org.ovirt.engine.core.bll.ProcessDownVmCommand.log.info ( "Deleting snapshot for stateless vm '{}'" , org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , new org.ovirt.engine.core.common.action.VmOperationParameterBase ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getContext ( ) , org.ovirt.engine.core.bll.ProcessDownVmCommand.getLock ( ) ) ) ; } }
Source:
protected boolean isStorageDomainCompatibleWithDC ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.storage.StoragePoolValidator spv = new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isGlusterSupportedInDC ( ) ; return validate ( result ) ; } if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isPosixSupportedInDC ( ) ; return validate ( result ) ; } return true ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult isStorageDomainCompatibleWithDC ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domainStatic ) { org.ovirt.engine.core.bll.storage.StoragePoolValidator spv = new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; if ( ( domainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { return spv.isGlusterSupportedInDC ( ) ; } if ( ( domainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { return spv.isPosixSupportedInDC ( ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testGetHostDevicesByHostIdAndIommuGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > hostDevices = dao.getHostDevicesByHostIdAndIommuGroup ( FixturesTool.VDS_RHEL6_NFS_SPM , org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.TOTAL_DEVICES_IN_GROUP , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : hostDevices ) { org.junit.Assert.assertEquals ( FixturesTool.VDS_RHEL6_NFS_SPM , hostDevice.getHostId ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) , hostDevice.getIommuGroup ( ) ) ; } }

Target:
public void testGetHostDevicesByHostIdAndIommuGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > hostDevices = dao.getHostDevicesByHostIdAndIommuGroup ( FixturesTool.VDS_RHEL6_NFS_SPM , org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.HostDeviceDaoTest.TOTAL_DEVICES_IN_GROUP , hostDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.HostDevice hostDevice : hostDevices ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VDS_RHEL6_NFS_SPM , hostDevice.getHostId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Integer.valueOf ( org.ovirt.engine.core.dao.HostDeviceDaoTest.EXISTING_IOMMU_GROUP ) , hostDevice.getIommuGroup ( ) ) ; } }
Source:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false ) ; return org.ovirt.engine.core.bll.ImagesHandler.checkImagesLocked ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , disksToCheck ) ; }

Target:
protected boolean checkImagesStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksToCheck = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getVmId ( ) ) , true , false ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( disksToCheck ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ; }
Source:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.StorageResource subresource = collection.getStorageSubResource ( "foo" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; try { subresource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.resource.StorageResource subresource = collection.getStorageResource ( "foo" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpQueryExpectations ( "" ) ; try { subresource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public java.lang.String getSnapshotName ( ) { if ( ( super . getSnapshotName ( ) ) == null ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDstSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } return super . getSnapshotName ( ) ; }

Target:
public java.lang.String getSnapshotName ( ) { if ( ( super . getSnapshotName ( ) ) == null ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getDstSnapshot ( ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } return super . getSnapshotName ( ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }
Source:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.VM vm ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , SearchType.Cluster , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.VM vm ) { return isFiltered ( ) ? lookupClusterByName ( vm.getCluster ( ) . getName ( ) ) . getId ( ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , SearchType.Cluster , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }
Source:
public void testPersistentAuthWithSeveralHeaders ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth" , "x" , "y" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "x" , "persistent-auth" , "y" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "x" , "y" , "persistent-auth" ) ) ; }

Target:
public void testPersistentAuthWithSeveralHeaders ( ) { org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth" , "x" , "y" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "x" , "persistent-auth" , "y" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "x" , "y" , "persistent-auth" ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { setEnumTitle ( snapshot.getStatus ( ) ) ; switch ( snapshot.getStatus ( ) ) { case OK : return getCommonResources ( ) . snapshotImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case IN_PREVIEW : return getCommonResources ( ) . snapshotImage ( ) ; default : return getCommonResources ( ) . snapshotImage ( ) ; } }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { java.lang.String status = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( snapshot.getStatus ( ) ) ; return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( status ) ; }
Source:
private void checkIncompatibleIpAddressDetailsBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( ipv4BootProtocol , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_INCOMPATIBLE_BOOT_PROTOCOL_AND_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_BOOT_PROTOCOL , ipv4BootProtocol.getDisplayName ( ) ) ) ) ; }

Target:
public void checkMissingIpv4AddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv4ConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }
Source:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUp ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ; } }

Target:
protected void Perform ( ) { if ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . isRunning ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ; } }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
public void setUp ( ) { sourceMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; targetMacPoolId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; macsToMigrate = new java.util.ArrayList < > ( java.util.Arrays.asList ( "mac1" , "mac2" , "mac3" ) ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( sourceMacPoolId , commandContext ) ) . thenReturn ( sourceMacPool ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( targetMacPoolId , commandContext ) ) . thenReturn ( targetMacPool ) ; org.mockito.Mockito.when ( macPoolPerCluster.getMacPoolById ( targetMacPoolId ) ) . thenReturn ( targetMacPool ) ; cluster = createCluster ( sourceMacPoolId ) ; }
Source:
public static void isMTUOverrideSupported ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { try { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.parse ( message ) ) ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ignored ) { } } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }

Target:
private void updateOps ( byte [ ] message ) { if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { try { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.parse ( message ) ) ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ignored ) { } } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }
Source:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter ( ) ; assertTrue ( "1" , comp.validateFieldValue ( "LOAD" , "1" ) ) ; assertTrue ( "123" , comp.validateFieldValue ( "LOAD" , "123" ) ) ; assertTrue ( "123.456" , comp.validateFieldValue ( "LOAD" , "123.456" ) ) ; assertFalse ( "JarJar" , comp.validateFieldValue ( "LOAD" , "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "1" , comp.validateFieldValue ( "LOAD" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , comp.validateFieldValue ( "LOAD" , "123" ) ) ; org.junit.Assert.assertTrue ( "123.456" , comp.validateFieldValue ( "LOAD" , "123.456" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateFieldValue ( "LOAD" , "JarJar" ) ) ; }
Source:
private void persistEngineSession ( java.lang.String sessionId ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo != null ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID , engineSessionDao.save ( new org.ovirt.engine.core.common.businessentities.EngineSession ( getUser ( sessionId , false ) , sessionId , getSourceIp ( sessionId ) ) ) ) ; } }

Target:
private void persistEngineSession ( java.lang.String sessionId ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo != null ) { sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID , engineSessionDao.save ( new org.ovirt.engine.core.common.businessentities.EngineSession ( getUser ( sessionId , false ) , sessionId , getSourceIp ( sessionId ) ) ) ) ; setSessionStartTime ( sessionId ) ; } }
Source:
public void testCheckForIndex_Exists2 ( ) throws java.io.IOException , java.net.URISyntaxException { java.io.File file = new java.io.File ( this . getClass ( ) . getResource ( "filetest" ) . toURI ( ) ) ; org.mockito.Mockito.when ( mockRequest.getServletPath ( ) ) . thenReturn ( "/test/path" ) ; java.io.File indexFile = testServlet.checkForIndex ( mockRequest , mockResponse , file , "/path2" ) ; org.junit.Assert.assertNotNull ( "indexFile should not be null" , indexFile ) ; org.junit.Assert.assertTrue ( "indexFile should exist" , indexFile.exists ( ) ) ; org.mockito.Mockito.verify ( mockResponse ) . sendRedirect ( "/test/path/path2/index.html" ) ; }

Target:
public void testCheckForIndex_Exists2 ( ) throws java.io.IOException , java.net.URISyntaxException { java.io.File file = new java.io.File ( this . getClass ( ) . getResource ( "filetest" ) . toURI ( ) ) ; org.mockito.Mockito.when ( mockRequest.getServletPath ( ) ) . thenReturn ( "/test/path" ) ; java.io.File indexFile = testServlet.checkForIndex ( mockRequest , mockResponse , file , "/path2" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( indexFile , "indexFile should not be null" ) ; org.junit.jupiter.api.Assertions.assertTrue ( indexFile.exists ( ) , "indexFile should exist" ) ; org.mockito.Mockito.verify ( mockResponse ) . sendRedirect ( "/test/path/path2/index.html" ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getEnableKsm ( ) . getEntity ( ) ) == null ) { return ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == true ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( true ) ; } if ( ( getEnableKsm ( ) . getEntity ( ) ) == false ) { getKsmPolicyForNumaSelection ( ) . setIsChangeable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangeable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangeable ( true ) ; } }
Source:
public void getVmGuestAgentInterfacesByVmId ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Network.class , network ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getActionParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; validateEnums ( org.ovirt.engine.api.model.Network.class , network ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
private org.ovirt.engine.ui.frontend.AsyncQuery createProviderReadOnlyCallback ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setCommandExecutionAllowedForProvider ( ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; } } ; return asyncQuery ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.networks.AsyncQuery createProviderReadOnlyCallback ( ) { org.ovirt.engine.ui.uicommonweb.models.networks.AsyncQuery asyncQuery = new org.ovirt.engine.ui.uicommonweb.models.networks.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { setCommandExecutionAllowedForProvider ( ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; } } ; return asyncQuery ; }
Source:
public void canDoAction ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUNId ( "1" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUNId ( "2" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; }

Target:
public void validate ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUNId ( "1" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUNId ( "2" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > > aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.LdapGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.LdapGroup entity = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; entity.setid ( GUIDS [ index ] ) ; entity.setname ( NAMES [ index ] ) ; entity.setdomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( GUIDS [ index ] . toByteArray ( ) ) ) ; return entity ; }