auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runInternalQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = queryReturnValue.getReturnValue ( ) ; } return result ; }
Source:
private java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , java.lang.String isoPrefix ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return windowsPath ; } java.lang.String fileName = new java.io.File ( windowsPath ) . getName ( ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }

Target:
private java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , java.lang.String isoPrefix ) { java.lang.String fileName = new java.io.File ( windowsPath ) . getName ( ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . getImageId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.disk.cinder.CloneSingleCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; }
Source:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; org.junit.Assert.assertEquals ( "hours1" , 10 , span.Hours ) ; org.junit.Assert.assertEquals ( "minutes1" , 10 , span.Minutes ) ; org.junit.Assert.assertEquals ( "seconds1" , 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( "days1" , 0 , span.Days ) ; org.junit.Assert.assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }

Target:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; org.junit.Assert.assertEquals ( 10 , span.Hours ) ; org.junit.Assert.assertEquals ( 10 , span.Minutes ) ; org.junit.Assert.assertEquals ( 10 , span.Seconds ) ; org.junit.Assert.assertEquals ( 0 , span.Days ) ; org.junit.Assert.assertEquals ( 0 , span.Milliseconds ) ; }
Source:
public static void updateSoundDevice ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean isSoundDeviceEnabled ) { boolean osChanged = ( oldVmBase.getOsId ( ) ) != ( newVmBase.getOsId ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateSoundDevice ( newVmBase.getId ( ) , newVmBase.getOsId ( ) , compatibilityVersion , isSoundDeviceEnabled , osChanged ) ; }

Target:
public void updateSoundDevice ( org.ovirt.engine.core.common.businessentities.VmBase oldVmBase , org.ovirt.engine.core.common.businessentities.VmBase newVmBase , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean isSoundDeviceEnabled ) { boolean osChanged = ( oldVmBase.getOsId ( ) ) != ( newVmBase.getOsId ( ) ) ; updateSoundDevice ( newVmBase.getId ( ) , newVmBase.getOsId ( ) , compatibilityVersion , isSoundDeviceEnabled , osChanged ) ; }
Source:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } break ; } } return bootOrder ; }

Target:
private static int setCDBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isCD ( device ) ) && ( device.getIsPlugged ( ) ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } return bootOrder ; }
Source:
public void validateFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateFailsWhenGlusterMultipleHostHasVolumesWithForce ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockHasMultipleClusters ( true ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 1 , 0 ) ; setUpGetBallooningExpectations ( 1 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void canDoActionFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( false ) ) . when ( vdsGroupDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( false ) ) . when ( vdsGroupDao ) . getFromCache ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }

Target:
public void canDoActionFailsWithClusterDoesNotSupportGluster ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( getVolume ( 2 , false ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( false ) ) . when ( vdsGroupDao ) . get ( org.mockito.Mockito.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList < java.lang.String > ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = getVmDeviceDAO ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
private static void initDisksUsage ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct vmStruct , org.ovirt.engine.core.common.businessentities.VmStatistics vm ) { java.lang.Object [ ] vmDisksUsage = ( ( java.lang.Object [ ] ) ( vmStruct.getItem ( VdsProperties.VM_DISKS_USAGE ) ) ) ; if ( vmDisksUsage != null ) { java.util.ArrayList < java.lang.Object > disksUsageList = new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( vmDisksUsage ) ) ; vm.setDisksUsage ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serializeUnformattedJson ( disksUsageList ) ) ; } }

Target:
private static void initDisksUsage ( java.util.Map < java.lang.String , java.lang.Object > vmStruct , org.ovirt.engine.core.common.businessentities.VmStatistics vm ) { java.lang.Object [ ] vmDisksUsage = ( ( java.lang.Object [ ] ) ( vmStruct.get ( VdsProperties.VM_DISKS_USAGE ) ) ) ; if ( vmDisksUsage != null ) { java.util.ArrayList < java.lang.Object > disksUsageList = new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( vmDisksUsage ) ) ; vm.setDisksUsage ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serializeUnformattedJson ( disksUsageList ) ) ; } }
Source:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getVnicProfileId ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }

Target:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.storage_pool storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; storagePool.setstatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) . getState ( ) , dataCenterStatus.value ( ) ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setstatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) . getState ( ) , dataCenterStatus.value ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.AUDIT_LOG_CANNOT_REMOVE_AUDIT_LOG_NOT_EXIST ) ; } if ( ( ! ( AuditLogSeverity.ALERT.equals ( event.getSeverity ( ) ) ) ) && ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.OVIRT.equalsIgnoreCase ( event.getOrigin ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.AuditLog event = org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getAuditLogDao ( ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; if ( event == null ) { return failCanDoAction ( VdcBllMessages.AUDIT_LOG_CANNOT_REMOVE_AUDIT_LOG_NOT_EXIST ) ; } return true ; }
Source:
private static java.util.Properties loadProperties ( java.io.File localeFile ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.io.Reader fr = null ; java.io.FileInputStream fis = null ; try { fis = new java.io.FileInputStream ( localeFile ) ; fr = new java.io.InputStreamReader ( fis , java.nio.charset.StandardCharsets.UTF_8 ) ; properties.load ( fr ) ; } finally { if ( fis != null ) { fis.close ( ) ; } if ( fr != null ) { fr.close ( ) ; } } return properties ; }

Target:
private static java.util.Properties loadProperties ( java.io.File localeFile ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.FileInputStream fis = new java.io.FileInputStream ( localeFile ) ) { properties.load ( fis ) ; } return properties ; }
Source:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForAdd ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 3 ) ) . removeGlusterServerHook ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADDED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getExternalHostName ( ) ) ) ) { hostName_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getProviders ( ) ) ) ) { providers_SelectedItemChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { providers_SelectedItemChanged ( ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; validateEnums ( org.ovirt.engine.core.common.businessentities.Cluster.class , cluster ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( VdcActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { validateParameters ( cluster , getMandatoryParameters ( ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenter ( cluster ) ; return performCreate ( VdcActionType.AddCluster , createAddCommandParams ( cluster , dataCenter ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network result = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.Network result = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
private void retrieveDefaultSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmDefaultPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; updateSpmPriorityValues ( ) ; updateSpmPriority ( ) ; } } ) ) ; }

Target:
private void retrieveDefaultSpmPriority ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spmDefaultPriorityValue = ( ( java.lang.Integer ) ( returnValue ) ) ; updateSpmPriorityValues ( ) ; updateSpmPriority ( ) ; } } ) ) ; }
Source:
private static void logMessage ( org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String logMessage ) { switch ( severity ) { case NORMAL : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( logMessage ) ; break ; case ERROR : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( logMessage ) ; break ; case ALERT : case WARNING : default : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( logMessage ) ; break ; } }

Target:
private void logMessage ( org.ovirt.engine.core.common.AuditLogSeverity severity , java.lang.String logMessage ) { switch ( severity ) { case NORMAL : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.info ( logMessage ) ; break ; case ERROR : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( logMessage ) ; break ; case ALERT : case WARNING : default : org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.warn ( logMessage ) ; break ; } }
Source:
public void addReason ( org.ovirt.engine.core.compat.Guid id , java.lang.String hostName , org.ovirt.engine.core.common.errors.VdcBllMessages filterType , java.lang.String filterName ) { filteredOutReasons.put ( id , new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.errors.VdcBllMessages , java.lang.String > ( filterType , filterName ) ) ; hostNames.put ( id , hostName ) ; }

Target:
public void addReason ( org.ovirt.engine.core.compat.Guid id , java.lang.String hostName , org.ovirt.engine.core.common.errors.VdcBllMessages filterType , java.lang.String filterName ) { filteredOutReasons.put ( id , new org.ovirt.engine.core.common.utils.Pair ( filterType , filterName ) ) ; hostNames.put ( id , hostName ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( validate ( createStorageDomainValidator ( ) . isInProcess ( ) ) ) ) { return false ; } if ( ! ( validate ( createStoragePoolValidator ( ) . isAnyDomainInProcess ( ) ) ) ) { return false ; } return initializeVds ( ) ; }

Target:
protected boolean validate ( ) { if ( ! ( validate ( createStorageDomainValidator ( ) . isInProcess ( ) ) ) ) { return false ; } if ( ! ( validate ( createStoragePoolValidator ( ) . isAnyDomainInProcess ( ) ) ) ) { return false ; } return initializeVds ( ) ; }
Source:
public void testGetSysprepFileName ( ) throws java.lang.Exception { org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getSysprepFileName ( 1 , null ) . equals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.SYSPREP_INF ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getSysprepFileName ( 11 , null ) . equals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.UNATTEND_XML ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getSysprepFileName ( 20 , null ) . equals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.UNATTEND_XML ) ) ; }

Target:
public void testGetSysprepFileName ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.SYSPREP_INF , OsRepositoryImpl.INSTANCE.getSysprepFileName ( 1 , null ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.UNATTEND_XML , OsRepositoryImpl.INSTANCE.getSysprepFileName ( 11 , null ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.OsRepositoryImplTest.UNATTEND_XML , OsRepositoryImpl.INSTANCE.getSysprepFileName ( 20 , null ) ) ; }
Source:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }

Target:
public void testListLimitResultsBadFormat ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectationsWithMax ( true ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllTags , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.setUpTags ( ) , null ) ; collection.setUriInfo ( uriInfo ) ; getCollection ( ) ; fail ( "Expected WebFaultException" ) ; }
Source:
public void testGetNetworkDevices ( ) throws java.lang.Exception { java.util.ArrayList < java.lang.String > networkDevices = OsRepositoryImpl.INSTANCE.getNetworkDevices ( 777 , null ) ; org.junit.Assert.assertTrue ( ( ( networkDevices.size ( ) ) == 2 ) ) ; for ( java.lang.String device : org.ovirt.engine.core.utils.OsRepositoryImplTest.NETWORK_DEVICES.split ( "," ) ) { org.junit.Assert.assertTrue ( networkDevices.contains ( device ) ) ; } }

Target:
public void testGetNetworkDevices ( ) throws java.lang.Exception { java.util.List < java.lang.String > networkDevices = OsRepositoryImpl.INSTANCE.getNetworkDevices ( 777 , null ) ; org.junit.Assert.assertTrue ( ( ( networkDevices.size ( ) ) == 2 ) ) ; for ( java.lang.String device : org.ovirt.engine.core.utils.OsRepositoryImplTest.NETWORK_DEVICES.split ( "," ) ) { org.junit.Assert.assertTrue ( networkDevices.contains ( device ) ) ; } }
Source:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ( message.length ( ) ) > 0 ) ) { table.setVisible ( false ) ; } messageLabel.setText ( message ) ; }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ( message.length ( ) ) > 0 ) ) { table.setVisible ( false ) ; messageLabel.setText ( message ) ; } }
Source:
public static boolean CanRemoveVmPool ( org.ovirt.engine.core.compat.NGuid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }

Target:
public static boolean CanRemoveVmPool ( org.ovirt.engine.core.compat.Guid vmPoolId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmPoolsMapByVmPoolId ( vmPoolId ) . size ( ) ) != 0 ) { returnValue = false ; reasons.add ( VdcBllMessages.VM_POOL_CANNOT_REMOVE_VM_POOL_WITH_VMS.toString ( ) ) ; } return returnValue ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setDiskAlias ( rs.getString ( "disk_alias" ) ) ; disk.setSize ( rs.getLong ( "size" ) ) ; disk.setId ( getGuid ( rs , "disk_id" ) ) ; return disk ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskAlias ( rs.getString ( "disk_alias" ) ) ; disk.setSize ( rs.getLong ( "size" ) ) ; disk.setId ( getGuid ( rs , "disk_id" ) ) ; return disk ; }
Source:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.view.popup.VmPopupResources.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.view.popup.VmPopupResources.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getFetchSshFingerprint ( ) . setEntity ( result ) ; getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . successLoadingFingerprint ( ) ) ; } else { getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getFetchSshFingerprint ( ) . setEntity ( fingerprint ) ; getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . successLoadingFingerprint ( ) ) ; } else { getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; } }
Source:
private void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ; org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setVmPayload ( payload ) ; break ; } } }

Target:
protected void loadPayload ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getVmId ( ) , VmDeviceGeneralType.DISK ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice disk : disks ) { if ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( disk.getSpecParams ( ) ) ) { org.ovirt.engine.core.bll.RunVmOnceCommand.getVm ( ) . setVmPayload ( new org.ovirt.engine.core.common.businessentities.VmPayload ( disk ) ) ; break ; } } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > filteredHosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( isHostAvailable ( host ) ) { filteredHosts.add ( host ) ; } } diskModel.getHost ( ) . setItems ( filteredHosts ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel ) ( target ) ) ; java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > filteredHosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( isHostAvailable ( host ) ) { filteredHosts.add ( host ) ; } } diskModel.getHost ( ) . setItems ( filteredHosts ) ; }
Source:
private boolean isValidOtp ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.Long otp ) { if ( ( otp.longValue ( ) ) == ( vds.getOtpValidity ( ) ) ) { java.lang.Integer otpExpiration = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.OtpExpirationInSeconds ) ; org.ovirt.engine.core.compat.DateTime otpValidity = new org.ovirt.engine.core.compat.DateTime ( otp ) ; otpValidity.AddSeconds ( otpExpiration ) ; if ( otpValidity.before ( org.ovirt.engine.core.compat.DateTime.getUtcNow ( ) ) ) { return true ; } } return false ; }

Target:
private boolean isValidOtp ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.Long otp ) { if ( ( otp != null ) && ( ( otp.longValue ( ) ) == ( vds.getOtpValidity ( ) ) ) ) { java.lang.Integer otpExpiration = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.OtpExpirationInSeconds ) ; org.ovirt.engine.core.compat.DateTime otpValidity = new org.ovirt.engine.core.compat.DateTime ( otp ) ; otpValidity.AddSeconds ( otpExpiration ) ; if ( otpValidity.before ( org.ovirt.engine.core.compat.DateTime.getUtcNow ( ) ) ) { return true ; } } return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString , org.ovirt.engine.core.common.AuditLogSeverity severity ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , severity , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , severity , resolvedMessage ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , resolvedMessage ) ; } }
Source:
private void changePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( ( ( java.lang.String ) ( getUserName ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getNewPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getDomain ( ) . getSelectedItem ( ) ) ) ) ) ; }

Target:
private void changePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( getUserName ( ) . getEntity ( ) , getPassword ( ) . getEntity ( ) , getNewPassword ( ) . getEntity ( ) , getDomain ( ) . getSelectedItem ( ) ) ) ; }
Source:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "templates" , "vms" , "files" , "images" } ; }

Target:
public static synchronized java.lang.String [ ] getLinksToExclude ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isIsoDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "disks" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isExportDomain ( storageDomain ) ? new java.lang.String [ ] { "files" , "storageconnections" , "images" } : org.ovirt.engine.api.restapi.resource.BackendStorageDomainResource.isImageDomain ( storageDomain ) ? new java.lang.String [ ] { "templates" , "vms" , "files" , "disks" , "storageconnections" } : new java.lang.String [ ] { "files" , "images" } ; }
Source:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; parameters.setStoragePoolId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . initializeVds ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void addISCSINonEmptyIqn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "10.35.16.25" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; parameters.setStorageServerConnection ( newISCSIConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isConnWithSameDetailsExists ( newISCSIConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void vdsNameVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setVdsName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }

Target:
public void vdsNameVds ( ) { b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setVdsName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; if ( ( dataCenters != null ) && ( ! ( dataCenters.isEmpty ( ) ) ) ) { getDataCenter ( ) . setSelectedItem ( dataCenters.get ( 0 ) ) ; } else { org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; getDataCenter ( ) . setSelectedItem ( noneStoragePool ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters ) { if ( ( dataCenters != null ) && ( ! ( dataCenters.isEmpty ( ) ) ) ) { getDataCenter ( ) . setSelectedItem ( dataCenters.get ( 0 ) ) ; } else { org.ovirt.engine.core.common.businessentities.StoragePool noneStoragePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; noneStoragePool.setId ( Guid.Empty ) ; noneStoragePool.setName ( "(none)" ) ; getDataCenter ( ) . setSelectedItem ( noneStoragePool ) ; } }
Source:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }

Target:
public void testVmNotDuringInitialization ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , true , null ) ; }
Source:
private void addVmDeviceType ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmDeviceType [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_1 ) ) { version.setVmDeviceTypes ( new org.ovirt.engine.api.model.VmDeviceTypes ( ) ) ; for ( org.ovirt.engine.api.model.VmDeviceType type : values ) { version.getVmDeviceTypes ( ) . getVmDeviceTypes ( ) . add ( type.value ( ) ) ; } } }

Target:
private void addVmDeviceType ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.VmDeviceType [ ] values ) { version.setVmDeviceTypes ( new org.ovirt.engine.api.model.VmDeviceTypes ( ) ) ; for ( org.ovirt.engine.api.model.VmDeviceType type : values ) { version.getVmDeviceTypes ( ) . getVmDeviceTypes ( ) . add ( type.value ( ) ) ; } }
Source:
protected void setAllowChangeHostPlacementPropertiesWhenNotInMaintenance ( ) { org.ovirt.engine.ui.uicompat.UIConstants constants = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) ; getDataCenter ( ) . setChangeProhibitionReason ( constants.dcCanOnlyBeChangedWhenHostInMaintMode ( ) ) ; getDataCenter ( ) . setIsChangeable ( false ) ; getCluster ( ) . setChangeProhibitionReason ( constants.clusterCanOnlyBeChangedWhenHostInMaintMode ( ) ) ; getCluster ( ) . setIsChangeable ( false ) ; }

Target:
protected void setAllowChangeHostPlacementPropertiesWhenNotInMaintenance ( ) { org.ovirt.engine.ui.uicompat.UIConstants constants = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) ; getDataCenter ( ) . setIsChangeable ( false ) ; getDataCenter ( ) . setChangeProhibitionReason ( constants.dcCanOnlyBeChangedWhenHostInMaintMode ( ) ) ; getCluster ( ) . setIsChangeable ( false ) ; getCluster ( ) . setChangeProhibitionReason ( constants.clusterCanOnlyBeChangedWhenHostInMaintMode ( ) ) ; }
Source:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getstorage_name ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.String localStorages = "" ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getSelectedItems ( ) ) ) { if ( ( a.getstorage_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages += ( a.getstorage_name ( ) ) + ", " ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }