auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupVdsNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > expectedVdsNetworkInterface = java.util.Collections.singletonList ( vdsNetworkInterface ) ; org.ovirt.engine.core.dao.network.InterfaceDao vdsNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.InterfaceDao.class ) ; org.mockito.Mockito.when ( vdsNetworkInterfaceDaoMock.getVdsInterfacesByNetworkId ( networkId ) ) . thenReturn ( expectedVdsNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getInterfaceDao ( ) ) . thenReturn ( vdsNetworkInterfaceDaoMock ) ; }

Target:
private void setupNetworkDao ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getNetworkDao ( ) ) . thenReturn ( networkDaoMocked ) ; org.mockito.Mockito.when ( networkDaoMocked.get ( networkId ) ) . thenReturn ( networkMocked ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; updatePriority ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; param.setApplyChangesLater ( applyCpuChangesLater ) ; setRngDeviceToParams ( model , param ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
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 ( args.propertyName.equals ( importModel.ON_DISK_LOAD ) ) { table.asEditor ( ) . edit ( table.asEditor ( ) . flush ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( importModel.getMessage ( ) ) ; } }

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 ( args.propertyName.equals ( ImportVmFromExternalProviderModel.ON_DISK_LOAD ) ) { table.asEditor ( ) . edit ( table.asEditor ( ) . flush ( ) ) ; } else if ( args.propertyName.equals ( "Message" ) ) { message.setText ( importModel.getMessage ( ) ) ; } }
Source:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { baseDiskDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( diskImageDynamicDao.get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { diskImageDynamicDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }

Target:
protected void endWithFailure ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) ) != null ) { removeImage ( ) ; baseDiskDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ; if ( ( diskImageDynamicDao.get ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ) != null ) { diskImageDynamicDao.remove ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ) ; } } super . endWithFailure ( ) ; }
Source:
public static synchronized java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > nics = ( ( java.util.ArrayList < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( ) ; for ( java.lang.String nic : nics ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( nic ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( ( ( int ) ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { boolean filteringLUNsEnabled = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . isFilteringLUNsEnabled ( ) ; org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.includePartitioned , java.lang.Boolean.toString ( filteringLUNsEnabled ) ) ; int storageType = ( ( int ) ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) ) ) ; _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.getBroker ( ) . getDeviceList ( storageType , options ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLUNList ( _result.lunList ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; while ( org.ovirt.engine.ui.common.utils.ElementUtils.detectOverflowUsingScrollWidth ( getElement ( ) ) ) { titleLabel.getElement ( ) . getStyle ( ) . setWidth ( ( ( titleLabel.getElement ( ) . getClientWidth ( ) ) - 1 ) , Unit.PX ) ; } }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; while ( org.ovirt.engine.ui.common.utils.ElementUtils.detectHorizontalOverflow ( getElement ( ) ) ) { titleLabel.getElement ( ) . getStyle ( ) . setWidth ( ( ( titleLabel.getElement ( ) . getClientWidth ( ) ) - 1 ) , Unit.PX ) ; } }
Source:
public void canDoActionSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; param.setVolumeId ( startedVolumeId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param ) ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void validateSucceeds ( ) { org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters param = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( ) ; param.setForce ( false ) ; param.setGeoRepSessionId ( geoRepSessionId ) ; param.setVolumeId ( startedVolumeId ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.PauseGlusterVolumeGeoRepSessionCommand ( param ) ) ; org.mockito.Mockito.doReturn ( getGeoRepSession ( geoRepSessionId , GeoRepSessionStatus.ACTIVE , startedVolumeId ) ) . when ( geoRepDao ) . getById ( geoRepSessionId ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void maintenance ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > pb = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { pb.add ( new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( a.getId ( ) , getEntity ( ) . getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.DeactivateStorageDomain , pb ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { confirmationModel.stopProgress ( ) ; setWindow ( null ) ; }
Source:
public void engineIsRunningNotification ( ) { try { heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDwhHistoryTimekeepingDao ( ) . save ( heartBeatVar ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: " , ex ) ; } }

Target:
public void engineIsRunningNotification ( ) { try { heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDwhHistoryTimekeepingDao ( ) . save ( heartBeatVar ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "Exception" , ex ) ; } }
Source:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { processUnremovedDisks ( true ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
private void processUnremovedDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.List < java.lang.String > disksLeftInVm = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { disksLeftInVm.add ( diskImage.getDiskAlias ( ) ) ; } addCustomValue ( "DisksNames" , org.apache.commons.lang.StringUtils.join ( disksLeftInVm , "," ) ) ; }
Source:
private java.lang.String _getIpTables ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( _vds.getvds_group_id ( ) ) ; java.lang.String ipTablesConfig = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfig ) ; java.lang.String serviceIPTablesConfig = "" ; if ( vdsGroup.supportsVirtService ( ) ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForVirt ) ; } if ( vdsGroup.supportsGlusterService ( ) ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForGluster ) ; } ipTablesConfig = ipTablesConfig.replace ( org.ovirt.engine.core.bll.VdsDeploy.IPTABLES_CUSTOM_RULES_PLACE_HOLDER , serviceIPTablesConfig ) ; return ipTablesConfig ; }

Target:
private java.lang.String _getIpTables ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( _vds.getVdsGroupId ( ) ) ; java.lang.String ipTablesConfig = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfig ) ; java.lang.String serviceIPTablesConfig = "" ; if ( vdsGroup.supportsVirtService ( ) ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForVirt ) ; } if ( vdsGroup.supportsGlusterService ( ) ) { serviceIPTablesConfig += org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.IPTablesConfigForGluster ) ; } ipTablesConfig = ipTablesConfig.replace ( org.ovirt.engine.core.bll.VdsDeploy.IPTABLES_CUSTOM_RULES_PLACE_HOLDER , serviceIPTablesConfig ) ; return ipTablesConfig ; }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network_cluster networkCluster = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; networkCluster.setis_display ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.classextension.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network_cluster networkCluster = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; networkCluster.setis_display ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; publicKeyEditor.setTitle ( constants.publicKeyUsage ( ) ) ; }
Source:
public void validateSpaceAndThreshold ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.Matchers.anyList ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.Matchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public void testGetLocaleFromStringStringWithDefault ( ) { org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be en-US" , java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" , true ) ) ; org.junit.Assert.assertEquals ( "The locale should be jp" , java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" , true ) ) ; }

Target:
public void testGetLocaleFromStringStringWithDefault ( ) { org.junit.jupiter.api.Assertions.assertEquals ( java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null , true ) , "The locale should be en-US" ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" , true ) , "The locale should be en-US" ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.Locale.US , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" , true ) , "The locale should be en-US" ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" , true ) , "The locale should be jp" ) ; }
Source:
public void setUp ( ) { org.ovirt.engine.core.bll.VmHandler.Init ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( ) ; params.setCommandType ( VdcActionType.UpdateVm ) ; params.setVmStaticData ( vmStatic ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.UpdateVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( vm ) . when ( command ) . getVm ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { return group ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = networkDao.getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }
Source:
public void setEntity ( java.lang.Boolean value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! value ) { revertChanges ( ) ; } setBootProtocolsAvailable ( value ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangeable ( value ) ; } }

Target:
public void setEntity ( java.lang.Boolean value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! value ) { revertChanges ( ) ; } setBootProtocolsAvailable ( value ) ; getQosOverridden ( ) . setIsChangeable ( value ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangeable ( value ) ; } }
Source:
public java.lang.String GetTagNamesAndChildrenNamesByRegExp ( java.lang.String tagNameRegExp ) { tagNameRegExp = java.lang.String.format ( "^%1$s$" , tagNameRegExp ) ; tagNameRegExp = tagNameRegExp.replace ( "*" , ".*" ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; org.ovirt.engine.core.bll.TagsDirector.RecursiveGetTagsAndChildrenByRegExp ( tagNameRegExp , sb , GetRootTag ( ) , org.ovirt.engine.core.bll.TagsDirector.TagReturnValueIndicator.NAME ) ; return sb.toString ( ) ; }

Target:
public java.lang.String GetTagNamesAndChildrenNamesByRegExp ( java.lang.String tagNameRegExp ) { tagNameRegExp = java.lang.String.format ( "^%1$s$" , tagNameRegExp ) ; tagNameRegExp = tagNameRegExp.replace ( "*" , ".*" ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; org.ovirt.engine.core.bll.TagsDirector.RecursiveGetTagsAndChildrenByRegExp ( tagNameRegExp , sb , getRootTag ( ) , org.ovirt.engine.core.bll.TagsDirector.TagReturnValueIndicator.NAME ) ; return sb.toString ( ) ; }
Source:
public void testCleanNotExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testRemoveWithoutParam ( ) { container.SetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; container.removeSession ( ) ; org.junit.Assert.assertEquals ( "Get should return the value since the session was not removed" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; container.removeSession ( ) ; org.junit.Assert.assertNull ( "Get should return the value since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , false ) ) ; }
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.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public static java.lang.String getBondMode ( java.lang.String bondOptions ) { if ( bondOptions == null ) { return org.ovirt.engine.core.common.businessentities.network.BondMode.BOND0.getValue ( ) ; } int modeStartIndex = bondOptions.indexOf ( org.ovirt.engine.core.common.businessentities.network.BondMode.MODE ) ; int bondModeIndex = modeStartIndex + ( org.ovirt.engine.core.common.businessentities.network.BondMode.MODE.length ( ) ) ; if ( ( modeStartIndex >= 0 ) && ( ( bondOptions.length ( ) ) > ( bondModeIndex + 1 ) ) ) { return bondOptions.substring ( bondModeIndex , ( bondModeIndex + 1 ) ) ; } return org.ovirt.engine.core.common.businessentities.network.BondMode.BOND0.getValue ( ) ; }

Target:
static org.ovirt.engine.core.common.businessentities.network.BondMode getBondMode ( java.lang.String bondOptions ) { if ( bondOptions == null ) { return null ; } java.lang.String bondModeValue = org.ovirt.engine.core.common.businessentities.network.BondMode.findMode ( bondOptions ) ; if ( bondModeValue == null ) { return null ; } for ( org.ovirt.engine.core.common.businessentities.network.BondMode bondMode : org.ovirt.engine.core.common.businessentities.network.BondMode.values ( ) ) { if ( bondMode.getValue ( ) . equals ( bondModeValue ) ) { return bondMode ; } } return null ; }
Source:
public static < E extends java.lang.Enum > E shuffle ( java.lang.Class < E > enumType ) { E [ ] values = enumType.getEnumConstants ( ) ; return values [ org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( values.length ) ] ; }

Target:
public static < E extends java.lang.Enum < E > > E shuffle ( java.lang.Class < E > enumType , E ... excludeValues ) { final java.util.Set < E > valuesSet = org.ovirt.engine.api.restapi.types.MappingTestHelper.complementOf ( enumType , excludeValues ) ; final E [ ] values = valuesSet.toArray ( ( ( E [ ] ) ( java.lang.reflect.Array.newInstance ( enumType , valuesSet.size ( ) ) ) ) ) ; return values [ org.ovirt.engine.api.restapi.types.MappingTestHelper.rand ( values.length ) ] ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void getGlusterVolumeProfilingStatistics ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , boolean nfs ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters ( clusterId , volumeId , nfs ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeProfileInfo , parameters , aQuery ) ; }
Source:
public void isVirtioScsiEnabledForVm ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getHostDevicesByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.HostDeviceView > > aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExtendedHostDevicesByHostId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
private void prepareCommand ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.connection.RemoveStorageServerConnectionCommand ( parameters , null ) ) ; org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.mockito.Mockito.doReturn ( storageServerConnectionDao ) . when ( command ) . getStorageServerConnectionDao ( ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( lunDao ) . when ( command ) . getLunDao ( ) ; org.mockito.Mockito.doReturn ( storageServerConnectionDao ) . when ( command ) . getStorageServerConnectionDao ( ) ; }
Source:
public static void GetPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters ( poolId ) , aQuery ) ; }

Target:
public static void GetVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToVMValid ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vm ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
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.VmTemplate > ( ) ; } return source ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; if ( ( quotaList != null ) && ( ! ( quotaList.isEmpty ( ) ) ) ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > comparator = ( ( topId ) == null ) ? org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.NAME : org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.withTopId ( topId , QuotaComparator.NAME ) ; java.util.Collections.sort ( quotaList , comparator ) ; } return quotaList ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; return findStorageDomainForMemory ( domainsInPool , disksList ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainForMemory = findStorageDomainForMemory ( domainsInPool , disksList ) ; if ( storageDomainForMemory != null ) { updateDisksStorage ( storageDomainForMemory , disksList ) ; } return storageDomainForMemory ; }
Source:
protected void setUpCreationExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > taskClass , java.lang.String [ ] taskNames , java.lang.Object [ ] taskValues , boolean canDo , boolean success , java.lang.Object taskReturn , org.ovirt.engine.core.common.queries.VdcQueryType query , java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryClass , java.lang.String [ ] queryNames , java.lang.Object [ ] queryValues , java.lang.Object queryReturn ) { setUpCreationExpectations ( task , taskClass , taskNames , taskValues , canDo , success , taskReturn , null , null , query , queryClass , queryNames , queryValues , queryReturn ) ; }

Target:
protected void setUpCreationExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > taskClass , java.lang.String [ ] taskNames , java.lang.Object [ ] taskValues , boolean valid , boolean success , java.lang.Object taskReturn , org.ovirt.engine.core.common.queries.VdcQueryType query , java.lang.Class < ? extends org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryClass , java.lang.String [ ] queryNames , java.lang.Object [ ] queryValues , java.lang.Object queryReturn ) { setUpCreationExpectations ( task , taskClass , taskNames , taskValues , valid , success , taskReturn , null , null , query , queryClass , queryNames , queryValues , queryReturn ) ; }
Source:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private void setGraphicsDevicesToParams ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel model , org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters params ) { if ( ( ( model.getDisplayType ( ) . getSelectedItem ( ) ) == null ) || ( ( model.getGraphicsType ( ) . getSelectedItem ( ) ) == null ) ) { return ; } for ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType : model.getGraphicsType ( ) . getSelectedItem ( ) . getBackingGraphicsType ( ) ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice d = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( graphicsType.getCorrespondingDeviceType ( ) ) ; params.getGraphicsDevices ( ) . add ( d ) ; } }

Target:
private void setGraphicsDevicesToParams ( org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel model , org.ovirt.engine.core.common.action.AddVmPoolWithVmsParameters params ) { if ( ( ( model.getDisplayType ( ) . getSelectedItem ( ) ) == null ) || ( ( model.getGraphicsType ( ) . getSelectedItem ( ) ) == null ) ) { return ; } for ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType : model.getGraphicsType ( ) . getSelectedItem ( ) . getBackingGraphicsType ( ) ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice d = new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( graphicsType.getCorrespondingDeviceType ( ) ) ; params.addGraphicsDevice ( d ) ; } }
Source:
protected void setActionMessageParameters ( ) { addCanDoActionMessage ( VdcBllMessages.VAR__ACTION__MIGRATE ) ; addCanDoActionMessage ( VdcBllMessages.VAR__TYPE__VM ) ; }

Target:
protected void getDowntime ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.migrateDowntime ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = runVdsCommand ( VDSCommandType.MigrateStatus , new org.ovirt.engine.core.common.vdscommands.MigrateStatusVDSCommandParameters ( getDestinationVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) ) ) ; if ( retVal != null ) { actualDowntime = ( ( java.lang.Integer ) ( retVal.getReturnValue ( ) ) ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { migrationErrorCode = e.getErrorCode ( ) ; } } }
Source:
private void setUpGetEntityExpectations ( int times , boolean found ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAffinityGroupResourceTest.AFFINITY_GROUP_ID } , ( found ? getEntity ( 0 ) : null ) ) ; } }

Target:
private void setUpGetEntityExpectations ( int times , boolean found ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAffinityGroupResourceTest.AFFINITY_GROUP_ID } , ( found ? getEntity ( 0 ) : null ) ) ; } }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.DiskProfile model = createIncompleteDiskProfile ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "DiskProfile" , "validateParameters" , getIncompleteFields ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.DiskProfile model = createIncompleteDiskProfile ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "DiskProfile" , "validateParameters" , getIncompleteFields ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllForStoragePool ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetVdsGroupsByStoragePoolId" , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getAllForStoragePool ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetClustersByStoragePoolId" , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance , parameterSource ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public void updateModel ( java.lang.String format , int actualSize , int virtualSize , java.lang.String qcowCompat , boolean backingFile ) { setFormat ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.valueOf ( format ) ) ; setActualSize ( actualSize ) ; setVirtualSize ( virtualSize ) ; setQcowCompat ( org.ovirt.engine.ui.uicommonweb.models.storage.ImageInfoModel.QemuCompat.forValue ( qcowCompat ) ) ; setBackingFile ( backingFile ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }

Target:
public void updateModel ( java.lang.String format , int actualSize , int virtualSize , java.lang.String qcowCompat , boolean backingFile , boolean fileLoaded ) { setFormat ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.valueOf ( format ) ) ; setActualSize ( actualSize ) ; setVirtualSize ( virtualSize ) ; setQcowCompat ( org.ovirt.engine.ui.uicommonweb.models.storage.ImageInfoModel.QemuCompat.forValue ( qcowCompat ) ) ; setBackingFile ( backingFile ) ; setFileLoaded ( fileLoaded ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }
Source:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void clusterWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }