auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertEquals ( "Should be no changes" , 0 , changes.size ( ) ) ; }

Target:
public void testNoChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , changes.size ( ) , "Should be no changes" ) ; }
Source:
protected void init ( ) { initGeneralForm ( ) ; initDisksTable ( ) ; initNicsTable ( ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( generalView.asWidget ( ) ) , constants.generalLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( disksTable ) , constants.disksLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( nicsTable ) , constants.nicsLabel ( ) ) ; }

Target:
protected void init ( ) { initGeneralForm ( ) ; initDisksTable ( ) ; initNicsTable ( ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( generalView.asWidget ( ) ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterTemplateInfoPanel.constants.generalLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( disksTable ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterTemplateInfoPanel.constants.disksLabel ( ) ) ; add ( new com.google.gwt.user.client.ui.ScrollPanel ( nicsTable ) , org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterTemplateInfoPanel.constants.nicsLabel ( ) ) ; }
Source:
public void getCinderVolumeTypesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_SAVE ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_SAVE ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_TEST ) ) { onTest ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }
Source:
protected org.ovirt.engine.api.model.Vm deprecatedPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; parent.addInlineDetails ( details , model ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } parent.setPayload ( model ) ; parent.setCertificateInfo ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; return model ; }

Target:
public org.ovirt.engine.api.resource.AssignedAffinityLabelsResource getAffinityLabelsResource ( ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendAssignedAffinityLabelsResource ( id , VM :: new ) ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private void testAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertTrue ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult.isValid ( ) ) ; } else { org.junit.Assert.assertFalse ( ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type allowed succeeded, version: " + version ) , attachDomainResult.isValid ( ) ) ; assertFailingMessage ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type failed with the wrong message" , attachDomainResult , VdcBllMessages.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } }

Target:
private void testAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertTrue ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult.isValid ( ) ) ; } else { org.junit.Assert.assertFalse ( ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type allowed succeeded, version: " + version ) , attachDomainResult.isValid ( ) ) ; assertFailingMessage ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type failed with the wrong message" , attachDomainResult , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMClearTask , new org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; if ( ( returnValue != null ) && ( ! ( returnValue.getSucceeded ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setVdsError ( returnValue.getVdsError ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMClearTask , new org.ovirt.engine.core.common.vdscommands.HSMTaskGuidBaseVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; if ( ( returnValue != null ) && ( ! ( returnValue.getSucceeded ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setVdsError ( returnValue.getVdsError ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.SPMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
private boolean interfaceWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { return ! ( iface.equals ( getExistingIfaces ( ) . get ( iface.getName ( ) ) ) ) ; }

Target:
private boolean networkWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getNetworkName ( ) , existingIface.getNetworkName ( ) ) ) ) || ( ( iface.getBootProtocol ( ) ) != ( existingIface.getBootProtocol ( ) ) ) ) || ( staticBootProtoPropertiesChanged ( iface , existingIface ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; iface.setQos ( ifaceQos ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; iface.setQos ( ifaceQos ) ; iface.setReportedSwitchType ( SwitchType.LEGACY ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; testedNetworkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; testedNetworkAttachment.setIpConfiguration ( new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setRequiredSwitchTypeForCluster ( SwitchType.LEGACY ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.balloonSupportMap = ( ( java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( containerID , disk ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.ExportVmCommand.getExecutionContext ( ) ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "Failed during ExportVmCommand" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( containerID , disk ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "Failed during ExportVmCommand" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( getGuidDefaultEmpty ( rs , "storage_id" ) ) ; entity.setstorage_pool_id ( getGuid ( rs , "storage_pool_id" ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setStorageId ( getGuidDefaultEmpty ( rs , "storage_id" ) ) ; entity.setStoragePoolId ( getGuid ( rs , "storage_pool_id" ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updateDiskVmElementFromDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement ) { if ( disk.isSetInterface ( ) ) { diskVmElement.setDiskInterface ( org.ovirt.engine.api.restapi.types.DiskMapper.mapInterface ( disk.getInterface ( ) ) ) ; } if ( disk.isSetBootable ( ) ) { diskVmElement.setBoot ( disk.isBootable ( ) ) ; } return diskVmElement ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updateDiskVmElementFromDisk ( org.ovirt.engine.api.model.Disk disk , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement diskVmElement ) { if ( disk.isSetInterface ( ) ) { diskVmElement.setDiskInterface ( org.ovirt.engine.api.restapi.types.DiskMapper.mapInterface ( disk.getInterface ( ) ) ) ; } if ( disk.isSetBootable ( ) ) { diskVmElement.setBoot ( disk.isBootable ( ) ) ; } if ( disk.isSetReadOnly ( ) ) { diskVmElement.setReadOnly ( disk.isReadOnly ( ) ) ; } return diskVmElement ; }
Source:
private void runSetup ( java.lang.String testCidr , boolean isValidFormat , boolean isCidrNetworkAddressValid , java.lang.String errorMessage ) { org.mockito.Mockito.when ( mockCidrValidator.isCidrFormatValid ( testCidr ) ) . thenReturn ( isValidFormat ) ; org.mockito.Mockito.when ( mockCidrValidator.isCidrNetworkAddressValid ( testCidr ) ) . thenReturn ( isCidrNetworkAddressValid ) ; org.mockito.Mockito.when ( contextMock.buildConstraintViolationWithTemplate ( errorMessage ) ) . thenReturn ( mockConstraintViolationBuilder ) ; org.mockito.Mockito.when ( mockConstraintViolationBuilder.addNode ( org.mockito.Mockito.anyString ( ) ) ) . thenReturn ( mockNodeBuilderDefinedContext ) ; }

Target:
private void runSetup ( java.lang.String testCidr , boolean isValidFormat , boolean isCidrNetworkAddressValid , java.lang.String errorMessage ) { org.mockito.Mockito.when ( mockCidrValidator.isCidrFormatValid ( testCidr ) ) . thenReturn ( isValidFormat ) ; org.mockito.Mockito.when ( mockCidrValidator.isCidrNetworkAddressValid ( testCidr ) ) . thenReturn ( isCidrNetworkAddressValid ) ; org.mockito.Mockito.when ( contextMock.buildConstraintViolationWithTemplate ( errorMessage ) ) . thenReturn ( mockConstraintViolationBuilder ) ; org.mockito.Mockito.when ( mockConstraintViolationBuilder.addNode ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( mockNodeBuilderDefinedContext ) ; }
Source:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/LockManager" ) ) ; addBeanJNDIName ( BeanType.EVENTQUEUE_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/EventQueue" ) ) ; addBeanJNDIName ( BeanType.CACHE_CONTAINER , "java:jboss/infinispan/ovirt-engine" ) ; }

Target:
protected void addJNDIBeans ( ) { addBeanJNDIName ( BeanType.BACKEND , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/Backend" ) ) ; addBeanJNDIName ( BeanType.SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "scheduler/Scheduler" ) ) ; addBeanJNDIName ( BeanType.PERSISTENT_SCHEDULER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "scheduler/PersistentScheduler" ) ) ; addBeanJNDIName ( BeanType.VDS_EVENT_LISTENER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/VdsEventListener" ) ) ; addBeanJNDIName ( BeanType.LOCK_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/LockManager" ) ) ; addBeanJNDIName ( BeanType.EVENTQUEUE_MANAGER , org.ovirt.engine.core.utils.ejb.EngineEJBUtilsStrategy.ENGINE_CONTEXT_PREFIX.concat ( "bll/EventQueue" ) ) ; addBeanJNDIName ( BeanType.CACHE_CONTAINER , "java:jboss/infinispan/ovirt-engine" ) ; }
Source:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , java.lang.String protocol , java.lang.String requestQueue , java.lang.String responseQueue ) { org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy ( connectionTimeout , connectionRetry , heartbeat , java.io.IOException.class , requestQueue , responseQueue ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( clientTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionPolicy , clientPolicy , isSecure , ReactorType.STOMP , protocol ) ; }

Target:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , java.lang.String protocol , int parallelism , java.lang.String requestQueue , java.lang.String responseQueue ) { org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy = new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompClientPolicy ( connectionTimeout , connectionRetry , heartbeat , java.io.IOException.class , requestQueue , responseQueue ) ; org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy = new org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy ( clientTimeout , connectionRetry , heartbeat , java.io.IOException.class ) ; return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionPolicy , clientPolicy , isSecure , ReactorType.STOMP , protocol , parallelism ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.compat.Version > getVersions ( ) { org.ovirt.engine.core.compat.Version version = control.createMock ( org.ovirt.engine.core.compat.Version.class ) ; org.easymock.EasyMock.expect ( version.getMajor ( ) ) . andReturn ( 2 ) ; org.easymock.EasyMock.expect ( version.getMinor ( ) ) . andReturn ( 3 ) ; java.util.List < org.ovirt.engine.core.compat.Version > versions = new java.util.ArrayList < > ( ) ; versions.add ( version ) ; return versions ; }

Target:
protected java.util.List < org.ovirt.engine.core.compat.Version > getVersions ( ) { org.ovirt.engine.core.compat.Version version = org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ; org.mockito.Mockito.when ( version.getMajor ( ) ) . thenReturn ( 2 ) ; org.mockito.Mockito.when ( version.getMinor ( ) ) . thenReturn ( 3 ) ; java.util.List < org.ovirt.engine.core.compat.Version > versions = new java.util.ArrayList < > ( ) ; versions.add ( version ) ; return versions ; }
Source:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public static void RunMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state ) ; }

Target:
public void runMultipleActions ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks ) { runMultipleActions ( actionType , parameters , callbacks , null ) ; }
Source:
private void onSaveHosts ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( getWindow ( ) ) ) ; if ( hostsModel == null ) { return ; } if ( ! ( hostsModel.validate ( ) ) ) { return ; } if ( ( hostsModel.getClusterModel ( ) . getClusterId ( ) ) != null ) { addHosts ( hostsModel ) ; } else { OnSaveInternalWithModel ( hostsModel.getClusterModel ( ) ) ; } }

Target:
private void onSaveHosts ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( getWindow ( ) ) ) ; if ( hostsModel == null ) { return ; } if ( ! ( hostsModel.validate ( ) ) ) { return ; } if ( ( hostsModel.getClusterModel ( ) . getClusterId ( ) ) != null ) { addHosts ( hostsModel ) ; } else { onSaveInternalWithModel ( hostsModel.getClusterModel ( ) ) ; } }
Source:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }

Target:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = org.ovirt.engine.api.restapi.types.NetworkMapper.map ( network , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getNetworkIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }

Target:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; org.ovirt.engine.api.model.Vm vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }
Source:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testCheckVmOnlyOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 0 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetNotExistingEntityExpectations ( ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetNotExistingEntityExpectations ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testCheckGlusterQuorumWithoutRequiredVolumeOptions ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > glusterVolumes = getGlusterVolumes ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID , GlusterStatus.UP ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : glusterVolumes ) { volume.setOptions ( "" ) ; } org.mockito.Mockito.doReturn ( glusterVolumes ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
public void testCheckGlusterQuorumWithoutRequiredVolumeOptions ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > glusterVolumes = getGlusterVolumes ( GlusterStatus.UP ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : glusterVolumes ) { volume.setOptions ( "" ) ; } org.mockito.Mockito.doReturn ( glusterVolumes ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMapId ( "1IET_00180001" , existingConnection.getid ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.FREE_LUN_ID , existingConnection.getid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionLunMapDao ( ) ; storageServerConnectionDao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = storageServerConnectionDao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.EXISTING_DOMAIN_STORAGE_NAME ) ; existingLUNStorageMap = dao.get ( new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMapId ( "1IET_00180001" , existingConnection.getId ( ) ) ) ; newLUNStorageMap = new org.ovirt.engine.core.common.businessentities.storage.LUNStorageServerConnectionMap ( org.ovirt.engine.core.dao.StorageServerConnectionLunMapDaoTest.FREE_LUN_ID , existingConnection.getId ( ) ) ; }
Source:
public void autoSelectImageType ( final java.lang.String pathname ) { if ( pathname != null ) { if ( pathname.toLowerCase ( ) . endsWith ( ".qcow2" ) ) { getVolumeFormat ( ) . setSelectedItem ( VolumeFormat.RAW ) ; } else { getVolumeFormat ( ) . setSelectedItem ( VolumeFormat.RAW ) ; } } }

Target:
public void autoSelectImageType ( final java.lang.String pathname ) { if ( pathname != null ) { getVolumeFormat ( ) . setSelectedItem ( VolumeFormat.RAW ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ReturnValue ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; defaultQos = org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ; getNetworkQoS ( ) . setSelectedItem ( defaultQos ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes ) { getNetworkQoS ( ) . setItems ( networkQoSes ) ; defaultQos = org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ; getNetworkQoS ( ) . setSelectedItem ( defaultQos ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus applicableStatus ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS , java.lang.String.format ( "$status %s" , diskImage.getImageStatus ( ) . name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult disksInStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus applicableStatus ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { if ( ( diskImage.getImageStatus ( ) ) != applicableStatus ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_IN_APPLICABLE_STATUS , java.lang.String.format ( "$status %s" , applicableStatus.name ( ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepDataWhenNoSessions ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 0 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.ArgumentMatchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.ArgumentMatchers.any ( ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 0 ) ) . save ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected final org.ovirt.engine.core.common.businessentities.network.NetworkAttachment setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getNetworkId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; setUpEntityExpectations ( entity ) ; return entity ; }

Target:
protected final org.ovirt.engine.core.common.businessentities.network.NetworkAttachment setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity , int index ) { org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getNetworkId ( ) ) . thenReturn ( GUIDS [ index ] ) ; setUpEntityExpectations ( entity ) ; return entity ; }
Source:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }
Source:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( getQos ( ) . getItems ( ) ) ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }

Target:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( getQos ( ) . getItems ( ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMap other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMap ) ( obj ) ) ; return java.util.Objects.equals ( id , other.id ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.RoleGroupMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.RoleGroupMap other = ( ( org.ovirt.engine.core.common.businessentities.RoleGroupMap ) ( obj ) ) ; return java.util.Objects.equals ( id , other.id ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }