auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; providersListModel.setSelectedItem ( providers.get ( 0 ) ) ; getIsDiscorveredHosts ( ) . setEntity ( null ) ; getIsDiscorveredHosts ( ) . setEntity ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; providersListModel.setSelectedItem ( providers.get ( 0 ) ) ; getIsDiscoveredHosts ( ) . setEntity ( null ) ; getIsDiscoveredHosts ( ) . setEntity ( true ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }
Source:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) ) ; }

Target:
public void testChangeDiskProfileForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertThat ( "Same source and dest disk profile id, cannot perform test" , imageStorageDomainMap.getDiskProfileId ( ) , org.hamcrest.CoreMatchers.not ( org.hamcrest.CoreMatchers.equalTo ( FixturesTool.DISK_PROFILE_2 ) ) ) ; dao.updateDiskProfileByImageGroupIdAndStorageDomainId ( FixturesTool.IMAGE_GROUP_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DISK_PROFILE_2 ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.junit.Assert.assertEquals ( "disk profile wasn't changed" , FixturesTool.DISK_PROFILE_2 , imageStorageDomainMap.getDiskProfileId ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditConsoleCommand ( ) ) ) { return consolePopupProvider.get ( ) ; } 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.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } else if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceToGuestWithNonRespAgentModel ) { return spiceToGuestWithNonRespAgentPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditConsoleCommand ( ) ) ) { return consolePopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) , getEffectiveCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getCurrentUser ( ) ) ) ; } return true ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
public static void getAttachedTagsToHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByVdsId , new org.ovirt.engine.core.common.queries.GetTagsByVdsIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) ( quota ) ) ) ; } else { return null ; } return quotaExceeded ? org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.resources.alertImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaCluster ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaCluster ) ( quota ) ) ) ; } else { return null ; } return quotaExceeded ? org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.resources.alertImage ( ) : null ; }
Source:
public static void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getClusterList ( 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 ) { 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.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void mockGetImageDomainsListVdsCommand ( ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( 1 ) ; guids.add ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( guids ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockGetImageDomainsListVdsCommand ( ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( 1 ) ; guids.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( guids ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( args.propertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( args.propertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( args.propertyName ) ) { updateViewHasSelectedTags ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "SearchString" . equals ( args.propertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( args.propertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( args.propertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( args.propertyName ) ) { updateViewHasSelectedTags ( ) ; } else if ( "SearchEnabled" . equals ( args.propertyName ) ) { updateViewSearchEnabled ( ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) ) ; } }
Source:
protected void endWithFailure ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { removeVmSnapshots ( getVm ( ) ) ; endActionOnAllImageGroups ( ) ; removeVmNetworkInterfaces ( ) ; getVmDynamicDAO ( ) . remove ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . remove ( getVmId ( ) ) ; getVmStaticDAO ( ) . remove ( getVmId ( ) ) ; setSucceeded ( true ) ; } else { setVm ( getParameters ( ) . getVm ( ) ) ; getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }

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:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Nic incoming , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , nic ) ; }

Target:
public org.ovirt.engine.api.model.Nics list ( ) { org.ovirt.engine.api.model.Nics nics = new org.ovirt.engine.api.model.Nics ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = getBackendCollection ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity : entities ) { org.ovirt.engine.api.model.Nic nic = populate ( map ( entity ) , entity ) ; nics.getNics ( ) . add ( addLinks ( nic ) ) ; } return nics ; }
Source:
public void canRemoveBrickEmptyList ( ) { org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > emptyList ( ) , getDistributedVolume ( volumeId1 , 1 ) , 3 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) == ( validationResult.getMessage ( ) ) ) ) ; }

Target:
public void canRemoveBrickEmptyList ( ) { org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > emptyList ( ) , getDistributedVolume ( volumeId1 , 1 ) , 3 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_BRICKS_REQUIRED ) == ( validationResult.getMessage ( ) ) ) ) ; }
Source:
public void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = fetchVnicProfileNetworkFilter ( vmNic ) ; if ( networkFilter != null ) { final java.lang.String networkFilterName = networkFilter.getName ( ) ; struct.put ( VdsProperties.NW_FILTER , networkFilterName ) ; } }

Target:
public void addNetworkFiltersToNic ( java.util.Map < java.lang.String , java.lang.Object > struct , org.ovirt.engine.core.common.businessentities.network.VmNic vmNic ) { final org.ovirt.engine.core.common.businessentities.network.NetworkFilter networkFilter = fetchVnicProfileNetworkFilter ( vmNic ) ; if ( networkFilter != null ) { final java.lang.String networkFilterName = networkFilter.getName ( ) ; struct.put ( VdsProperties.NW_FILTER , networkFilterName ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter > vmNicFilterParameters = vmNicFilterParameterDao.getAllForVmNic ( vmNic.getId ( ) ) ; struct.put ( VdsProperties.NETWORK_FILTER_PARAMETERS , mapVmNicFilterParameter ( vmNicFilterParameters ) ) ; } }
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 getConfiguredVmHostDevices ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VmHostDevice > > aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmHostDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
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.gluster.GlusterVolumeEntity > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( source ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < > ( ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return null ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getRevertVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) . getValue ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) , null ) ; }
Source:
protected void buildVmVirtioSerial ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSERIAL.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.CONTROLLER.getValue ( ) ) ; struct.put ( VdsProperties.Device , VdsProperties.VirtioSerial ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.addAddress ( vmDevice , struct ) ; addDevice ( struct , vmDevice , null ) ; } }

Target:
private java.lang.String deriveDisplayTypeLegacy ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.GRAPHICS ) ; if ( vmDevices.isEmpty ( ) ) { return null ; } else if ( ( vmDevices.size ( ) ) == 2 ) { return org.ovirt.engine.core.vdsbroker.vdsbroker.VdsProperties.QXL ; } org.ovirt.engine.core.common.businessentities.GraphicsType deviceType = org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( vmDevices.get ( 0 ) . getDevice ( ) ) ; return graphicsTypeToLegacyDisplayType ( deviceType ) ; }
Source:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionStatus ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.ArgumentMatchers.any ( java.util.List.class ) ) ; }
Source:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onAddition ( ) ; } org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }
Source:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( cinderDisk.getId ( ) , cinderDisk.getStorageIds ( ) . get ( 0 ) ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) ) ; return removeDiskParams ; }

Target:
private org.ovirt.engine.core.common.action.RemoveCinderDiskParameters buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveCinderDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveCinderDiskParameters ( cinderDisk.getId ( ) ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.RemoveAllVmCinderDisksCommand.getParameters ( ) ) ; return removeDiskParams ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { 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 > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonFound ( ) 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 } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void retryCall ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request , final org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = new org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking ( request , call , new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryContext ( policy ) , getTimeout ( this . policy.getRetryTimeOut ( ) , this . policy.getTimeUnit ( ) ) ) ; this . map.put ( request.getId ( ) , tracking ) ; this . queue.add ( request.getId ( ) ) ; }

Target:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests , objectMapper ) ) ; retryBatchCall ( requests , call ) ; return call ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotPlugNic ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugNic ( info.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 snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks , java.lang.String memory ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , disks , memory ) ; 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 static void GetRpmVersionViaPublic ( 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.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected void executeVmCommand ( ) { if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceIsPluggedProperty ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }

Target:
protected void executeVmCommand ( ) { clearAddressAlreadyInUse ( ) ; if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceIsPluggedProperty ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }
Source:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; }

Target:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( ( getParameters ( ) . getVm ( ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isBlank ( getParameters ( ) . getVm ( ) . getName ( ) ) ) ) ) { return java.util.Collections.singletonMap ( getParameters ( ) . getVm ( ) . getName ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_NAME , VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; } return null ; }

Target:
protected org.ovirt.engine.core.bll.validator.ImportValidator getImportValidator ( ) { if ( ( importValidator ) == null ) { importValidator = new org.ovirt.engine.core.bll.validator.ImportValidator ( getParameters ( ) ) ; } return importValidator ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.RUNNING , service.getStatus ( ) ) ; service.setStatus ( GlusterServiceStatus.STOPPED ) ; dao.update ( service ) ; service = dao.getByClusterIdAndServiceType ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDaoTest.CLUSTER_ID ) , ServiceType.GLUSTER ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( GlusterServiceStatus.STOPPED , service.getStatus ( ) ) ; }
Source:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

Target:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }
Source:
public void save ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = createVmGuestAgentInterface ( ) ; org.junit.Assert.assertFalse ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; dao.save ( guestAgentInterface ) ; org.junit.Assert.assertTrue ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; }

Target:
public void save ( ) { org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface guestAgentInterface = createVmGuestAgentInterface ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; dao.save ( guestAgentInterface ) ; org.junit.jupiter.api.Assertions.assertTrue ( dao.getAllForVm ( FixturesTool.VM_RHEL5_POOL_50 ) . contains ( guestAgentInterface ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
private void setUpGetEntityExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , new org.ovirt.engine.api.restapi.resource.VM ( ) ) ; }
Source:
protected void destroyVm ( ) { if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getMigratingToVds ( ) ) != null ) ) { runVdsCommand ( VDSCommandType.DestroyVm , buildDestroyVmVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getMigratingToVds ( ) ) ) ; } setActionReturnValue ( runVdsCommand ( VDSCommandType.DestroyVm , buildDestroyVmVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVdsId ( ) ) ) ) ; }

Target:
protected void destroyVm ( ) { boolean vmMigrating = ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getMigratingToVds ( ) ) != null ) ; setActionReturnValue ( ( vmMigrating ? destroyMigratingVm ( ) : destroyNonMigratingVm ( ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( glusterVolume.isOnline ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( glusterVolume.isOnline ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SHOULD_BE_STARTED ) ; } return true ; }
Source:
protected void initSelectedType ( ) { final org.ovirt.engine.core.common.businessentities.network.VmInterfaceType defaultNicType = getDeafultNicTypeByProfile ( ) ; getNicType ( ) . setItems ( supportedVnicTypes , defaultNicType ) ; }

Target:
protected void initSelectedType ( ) { final org.ovirt.engine.core.common.businessentities.network.VmInterfaceType defaultNicType = getDefaultNicTypeByProfile ( ) ; final java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > vnicTypes = ( ( supportedVnicTypes ) == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( ) : supportedVnicTypes ; if ( ( getNicType ( ) . getItems ( ) ) == null ) { getNicType ( ) . setItems ( vnicTypes , defaultNicType ) ; } else { getNicType ( ) . setSelectedItem ( defaultNicType ) ; } }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return runVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }