auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( java.lang.Boolean.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.VDSGroup > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsGroupDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.any ( java.lang.Boolean.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Cluster > emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void setSelectedValue ( K value ) { com.google.gwt.user.client.ui.RadioButton button = buttons.get ( value ) ; if ( button != null ) { button.setValue ( true ) ; } }

Target:
public void setSelectedValue ( K value ) { com.google.gwt.user.client.ui.RadioButton button = buttons.get ( value ) ; if ( button != null ) { if ( ( buttons.get ( getSelectedValue ( ) ) ) != null ) { buttons.get ( getSelectedValue ( ) ) . setValue ( false ) ; } button.setValue ( true ) ; } }
Source:
private org.ovirt.engine.core.common.action.SetupNetworksParameters createParametersForBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > bondedIfaces ) { org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; parameters.getInterfaces ( ) . add ( bond ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : bondedIfaces ) { parameters.getInterfaces ( ) . add ( createVdsInterface ( iface.getName ( ) , false , bond.getName ( ) , null , null ) ) ; } return parameters ; }

Target:
private org.ovirt.engine.core.common.action.SetupNetworksParameters createParametersForBond ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > bondedIfaces ) { org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; parameters.getInterfaces ( ) . add ( bond ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : bondedIfaces ) { parameters.getInterfaces ( ) . add ( enslaveOrReleaseNIC ( iface , bond.getName ( ) ) ) ; } return parameters ; }
Source:
public void testNeedToProcessHardwareCapsFalse ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; org.junit.Assert.assertFalse ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }

Target:
public void testNeedToProcessHardwareCapsFalse ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; org.junit.Assert.assertFalse ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getStatus ( ) ) . append ( ", display=" ) . append ( isDisplay ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getStatus ( ) ) . append ( ", display=" ) . append ( isDisplay ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( ", migration=" ) . append ( isMigration ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }
Source:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void commandSucceeds ( ) { java.util.List < java.lang.String > pubKeys = new java.util.ArrayList < > ( ) ; pubKeys.add ( "" ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHostPubKeyToSlaveInternalCommand ( new org.ovirt.engine.core.common.action.gluster.UpdateGlusterHostPubKeyToSlaveParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , pubKeys ) , null ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validate ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( ( org.ovirt.engine.core.bll.GetTimeZonesQuery.getParameters ( ) . isWindowsOS ( ) ? org.ovirt.engine.core.bll.GetTimeZonesQuery.windowsTimezones : org.ovirt.engine.core.bll.GetTimeZonesQuery.javaTimezones ) ) ; }

Target:
protected void executeQueryCommand ( ) { switch ( org.ovirt.engine.core.bll.GetTimeZonesQuery.getParameters ( ) . getTimeZoneType ( ) ) { case GENERAL_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.javaTimezones ) ; break ; case WINDOWS_TIMEZONE : org.ovirt.engine.core.bll.GetTimeZonesQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetTimeZonesQuery.windowsTimezones ) ; break ; } }
Source:
public void testQueryWithoutHostId ( ) { getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValue ( getQuery ( ) ) ; }

Target:
public void testQueryWithNonExistingHostId ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVdsId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.GetoVirtISOsTest.checkReturnValueEmpty ( getQuery ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; initSpmPriorities1 ( ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE : ( getDestinationVds ( ) ) == null ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VM map ( org.ovirt.engine.api.model.CdRom model , org.ovirt.engine.core.common.businessentities.VM template ) { org.ovirt.engine.core.common.businessentities.VM entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.VM ( ) ; if ( ( model.isSetFile ( ) ) && ( model.getFile ( ) . isSetId ( ) ) ) { entity.getStaticData ( ) . setIsoPath ( model.getFile ( ) . getId ( ) ) ; } return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VM map ( org.ovirt.engine.api.model.Cdrom model , org.ovirt.engine.core.common.businessentities.VM template ) { org.ovirt.engine.core.common.businessentities.VM entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.VM ( ) ; if ( ( model.isSetFile ( ) ) && ( model.getFile ( ) . isSetId ( ) ) ) { entity.getStaticData ( ) . setIsoPath ( model.getFile ( ) . getId ( ) ) ; } return entity ; }
Source:
public void loadAttachableDisks ( int os , org.ovirt.engine.core.compat.Version compatibilityVersion , final org.ovirt.engine.core.common.businessentities.storage.Disk prevSelectedDisk ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.IMAGE , prevSelectedDisk ) ) , getVm ( ) . getStoragePoolId ( ) , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( Disk.DiskStorageType.LUN , prevSelectedDisk ) ) , null , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; }

Target:
public void loadAttachableDisks ( int os , org.ovirt.engine.core.compat.Version compatibilityVersion , final org.ovirt.engine.core.common.businessentities.storage.Disk prevSelectedDisk ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE , prevSelectedDisk ) ) , getVm ( ) . getStoragePoolId ( ) , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFilteredAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel.InstanceImageGetDisksCallback ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN , prevSelectedDisk ) ) , null , getVm ( ) . getId ( ) , os , compatibilityVersion ) ; }
Source:
public static void getStorageDomainListByTemplate ( 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setactual_size ( image.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; return diskDynamic ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic updateDiskImageDynamicIntoDB ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image ) { org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic diskDynamic = new org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic ( ) ; diskDynamic.setId ( image.getImageId ( ) ) ; diskDynamic.setActualSize ( image.getActualSizeInBytes ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDynamicDao ( ) . save ( diskDynamic ) ; return diskDynamic ; }
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = multipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.List < org.ovirt.engine.core.common.action.ActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = multipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( ChangeCDModel.ExecutedEventDefinition ) ) { changeCD ( sender , args ) ; } else if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) ) { SpiceConsoleModel_Error ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }

Target:
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 ( ChangeCDModel.ExecutedEventDefinition ) ) { changeCD ( sender , args ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateNetwork , org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
private boolean noChangesDetected ( ) { return ( ( ( getNetworks ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBonds ( ) . isEmpty ( ) ) ; }

Target:
private boolean noChangesDetected ( ) { return ( ( ( ( getNetworksToConfigure ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBondNames ( ) . isEmpty ( ) ) ) && ( getRemovedUnmanagedNetworks ( ) . isEmpty ( ) ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.ad_groups setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.ad_groups entity , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.LdapGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.LdapGroup entity , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
public static void getTemplateById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void updateWanColorDepthOptions ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getWANColorDepth ( 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 ) { spice.getOptions ( ) . setWanColorDepth ( ( ( org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateWanColorDepthOptions ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getWANColorDepth ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth returnValue ) { spice.getOptions ( ) . setWanColorDepth ( returnValue ) ; } } ) ) ; }
Source:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoryStates.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . remove ( memoryStates ) ; } }

Target:
private void removeVmSnapshots ( ) { org.ovirt.engine.core.compat.Guid vmId = getVmId ( ) ; java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vmId ) ; for ( java.lang.String memoryState : memoryStates ) { removeMemoryVolumes ( memoryState , vmId ) ; } }
Source:
protected void addDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshots ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData ( ) ; data.setCollapseSnapshot ( collapseSnapshots ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; diskImportDataMap.put ( diskId , data ) ; }

Target:
protected void addDiskImportData ( org.ovirt.engine.core.compat.Guid diskId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshots ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData data = new org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData ( ) ; data.setCollapseSnapshot ( collapseSnapshots ) ; data.setAllStorageDomains ( filteredStorageDomains ) ; data.setStorageDomains ( storageDomains ) ; data.setVolumeType ( volumeType ) ; data.setStorageQuotaList ( storageQuotaMap ) ; diskImportDataMap.put ( diskId , data ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getParameters ( ) . getClusterId ( ) ; java.lang.String volumeName = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getParameters ( ) . getVolumeName ( ) ; infoReturn = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getBroker ( ) . glusterVolumeSnapshotConfigGet ( clusterId , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( infoReturn.getGlusterSnapshotConfigInfo ( ) ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getParameters ( ) . getClusterId ( ) ; infoReturn = org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getBroker ( ) . glusterSnapshotConfigList ( clusterId ) ; org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.proceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GetGlusterVolumeSnapshotConfigInfoVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( infoReturn.getGlusterSnapshotConfigInfo ( ) ) ; } }
Source:
protected void removeVmNetworkInterfaces ( ) { new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) . setMacPool ( org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) ) . removeAll ( getVmId ( ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
public void setup ( ) { qos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; oldQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; allQos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( qos ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( validator ) . getOldQos ( ) ; org.mockito.Mockito.doReturn ( allQos ) . when ( validator ) . getAllQosInDc ( ) ; nullValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( null ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( nullValidator ) . getOldQos ( ) ; }

Target:
public void setup ( ) { qos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; oldQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; allQos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( qos ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( validator ) . getOldQos ( ) ; org.mockito.Mockito.doReturn ( allQos ) . when ( validator ) . getAllQosInDcByType ( ) ; nullValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( null ) ) ; org.mockito.Mockito.doReturn ( oldQos ) . when ( nullValidator ) . getOldQos ( ) ; }
Source:
public void testUpdateUploadIcon ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { "VmLargeIcon" } , new java.lang.Object [ ] { org.ovirt.engine.core.common.businessentities.VmIcon.typeAndDataToDataUrl ( IconTestHelpler.MEDIA_TYPE , IconTestHelpler.DATA_URL ) } , true , true ) ) ; final org.ovirt.engine.api.model.Template model = getRestModel ( 0 ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; verifyModel ( resource.update ( model ) , 0 ) ; }

Target:
public void testUpdateFailed ( ) throws java.lang.Exception { doTestBadUpdate ( true , false , org.ovirt.engine.api.restapi.resource.FAILURE ) ; }
Source:
public void lunsMismatchListSize ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsFromVgInfo = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.LUNs ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsFromDb = java.util.Collections.emptyList ( ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertTrue ( isMismatch ) ; }

Target:
public void lunsMismatchListSize ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromVgInfo = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = java.util.Collections.emptyList ( ) ; boolean isMismatch = command.isLunsInfoMismatch ( lunsFromVgInfo , lunsFromDb ) ; org.junit.Assert.assertTrue ( isMismatch ) ; }
Source:
public static boolean CanUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { java.lang.Class < ? > type = org.ovirt.engine.core.utils.ObjectIdentityChecker.aliases.get ( objectType ) ; if ( type != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( "status type [null] not exist" ) ; } }

Target:
public static boolean canUpdateField ( java.lang.String objectType , java.lang.String fieldName , java.lang.Enum < ? > status , java.lang.Object fieldContainer ) { java.lang.Class < ? > type = org.ovirt.engine.core.utils.ObjectIdentityChecker.aliases.get ( objectType ) ; if ( type != null ) { return org.ovirt.engine.core.utils.ObjectIdentityChecker.canUpdateField ( type , fieldName , status , fieldContainer ) ; } else { throw new java.lang.RuntimeException ( "status type [null] not exist" ) ; } }
Source:
protected void UpdateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ) ; } }

Target:
protected void updateIsDiskHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = vm.getVdsGroupCompatibilityVersion ( ) ; if ( clusterCompatibilityVersion == null ) { setIsDiskHotPlugSupported ( false ) ; } else { setIsDiskHotPlugSupported ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ) ; } }
Source:
protected boolean validateSpaceRequirements ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( diskImages ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( diskImages ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( diskImages ) ) ; }

Target:
protected boolean validateSpaceRequirements ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( diskImages ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( diskImages ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( diskImages ) ) ; }
Source:
private void setUpGetEntityExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( GUIDS [ 0 ] ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , vds ) ; }

Target:
private void setUpGetEntityExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( GUIDS [ 0 ] ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , vds ) ; }
Source:
public void getVdsNullVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setrun_on_vds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }

Target:
public void getVdsNullVdsId ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID3 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertNull ( v ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesFromSnapshot = org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imagesFromSnapshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.compat.Guid findImageForSameDrive ( org.ovirt.engine.core.compat.Guid snapshotId ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesFromSnapshot = diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : imagesFromSnapshot ) { if ( getDiskImage ( ) . getId ( ) . equals ( diskImage.getId ( ) ) ) { return diskImage.getImageId ( ) ; } } return null ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendMacPoolResourceTest.MAC_POOL_ID } , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getGuestLastLoginTime ( ) ) != null ) && ( ( ( getGuestLastLogoutTime ( ) ) == null ) || ( ( getGuestLastLoginTime ( ) . compareTo ( getGuestLastLogoutTime ( ) ) ) > 0 ) ) ) { setGuestLastLogoutTime ( new java.util.Date ( ) ) ; } }

Target:
public void setGuestOsType ( org.ovirt.engine.core.common.businessentities.OsType guestOsType ) { vmDynamic.setGuestOsType ( guestOsType ) ; }
Source:
protected java.util.Set < org.ovirt.engine.core.common.utils.MockConfigRule.MockConfigDescriptor < java.util.Map > > getExtraConfigDescriptors ( ) { java.util.Map < java.lang.String , java.lang.String > value = java.util.Collections.singletonMap ( ArchitectureType.x86_64.toString ( ) , java.lang.Boolean.FALSE.toString ( ) ) ; return java.util.Collections.singleton ( org.ovirt.engine.core.common.utils.MockConfigRule.mockConfig ( ConfigValues.HotUnplugMemorySupported , org.ovirt.engine.core.compat.Version.getLast ( ) , value ) ) ; }

Target:
protected java.util.Set < org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < java.util.Map > > getExtraConfigDescriptors ( ) { java.util.Map < java.lang.String , java.lang.String > value = java.util.Collections.singletonMap ( ArchitectureType.x86_64.toString ( ) , java.lang.Boolean.FALSE.toString ( ) ) ; return java.util.Collections.singleton ( org.ovirt.engine.core.utils.MockConfigRule.mockConfig ( ConfigValues.HotUnplugMemorySupported , org.ovirt.engine.core.compat.Version.getLast ( ) , value ) ) ; }
Source:
public void testValidateNetworkExclusiveOnNicsAllAttachmentsMustHaveNicNameSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( vlanNetwork , vmNetwork1 , nonVmNetwork1 ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkId ( vmNetwork1.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure = java.util.Arrays.asList ( networkAttachment ) ; expectedException.expect ( java.lang.IllegalArgumentException.class ) ; new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachmentsToConfigure , networkMap ) . validateNetworkExclusiveOnNics ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment result = createNetworkAttachment ( network ) ; result.setNicName ( nicName ) ; return result ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getStatusColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.ImageStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.ImageStatus getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getImageStatus ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getStatusColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.storage.Disk , org.ovirt.engine.core.common.businessentities.storage.ImageStatus > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.storage.ImageStatus getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getImageStatus ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }
Source:
private static int setNetworkBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } } return bootOrder ; }

Target:
public static boolean isBridge ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) ; }