auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }

Target:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.anyMapOf ( org.ovirt.engine.core.compat.Guid.class , org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; }
Source:
public void Cluster_SelectedItemChanged ( ) { UpdateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; UpdateMinAllocatedMemory ( ) ; UpdateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }

Target:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } }
Source:
public void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( vmId ) == null ? 0 : vmId.hashCode ( ) ) ; result = ( prime * result ) + ( ( jobType ) == null ? 0 : jobType.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , vmId , jobType ) ; }
Source:
protected org.ovirt.engine.api.model.VM addInlineDetails ( java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details , org.ovirt.engine.api.model.VM vm ) { if ( details.contains ( Detail.DISKS ) ) { addInlineDisks ( vm ) ; } if ( details.contains ( Detail.NICS ) ) { addInlineNics ( vm ) ; } if ( details.contains ( Detail.TAGS ) ) { addInlineTags ( vm ) ; } return vm ; }

Target:
protected org.ovirt.engine.api.model.VM addInlineDetails ( java.util.Set < java.lang.String > details , org.ovirt.engine.api.model.VM vm ) { if ( details.contains ( "disks" ) ) { addInlineDisks ( vm ) ; } if ( details.contains ( "nics" ) ) { addInlineNics ( vm ) ; } if ( details.contains ( "tags" ) ) { addInlineTags ( vm ) ; } return vm ; }
Source:
private void testResolveHostNetworkAddress ( java.util.function.Function < org.ovirt.engine.core.bll.network.NetworkConfigurator , java.lang.String > function , java.lang.String networkName ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , managementNetworkUtil ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; nic.setNetworkName ( networkName ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.getInterfaces ( ) . add ( nic ) ; org.junit.Assert.assertThat ( function.apply ( new org.ovirt.engine.core.bll.network.NetworkConfigurator ( vds , null ) ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void getIpv6AddressOfNetworkReturnsNullWhenThereIsNoNetworkOfGivenName ( ) { nic.setIpv6Address ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.IPV6_ADDRESS ) ; org.junit.Assert.assertThat ( underTest.getIpv6AddressOfNetwork ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME2 ) , org.hamcrest.Matchers.nullValue ( ) ) ; }
Source:
public void nameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }

Target:
public void nameLengthIsTooLong ( ) { mockConfigRule.mockConfigValue ( ConfigValues.MaxVdsNameLength , org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = getBackendCollection ( VdcQueryType.GetNetworksByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) ) ; org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertTrue ( model.isSparse ( ) ) ; org.junit.Assert.assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
private boolean executeDeactivateCommnad ( boolean passContext ) { final org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; params.setSkipChecks ( true ) ; params.setSkipLock ( true ) ; org.ovirt.engine.core.bll.context.CommandContext context = ( passContext ) ? org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.cloneContext ( ) : null ; return org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getBackend ( ) . runInternalAction ( VdcActionType.DeactivateStorageDomain , params , context ) . getSucceeded ( ) ; }

Target:
private boolean executeDeactivateCommnad ( boolean passContext ) { final org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; params.setSkipChecks ( true ) ; params.setSkipLock ( true ) ; params.setShouldBeLogged ( true ) ; org.ovirt.engine.core.bll.context.CommandContext context = ( passContext ) ? org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.cloneContext ( ) : null ; return org.ovirt.engine.core.bll.storage.DeactivateStorageDomainWithOvfUpdateCommand.getBackend ( ) . runInternalAction ( VdcActionType.DeactivateStorageDomain , params , context ) . getSucceeded ( ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired , isDefaultRoute ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired , isDefaultRoute ) ) ; } }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } else { return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.AddDiskCommand.getActionState ( ) ) { case EXECUTE : if ( isDiskStorageTypeRequiresExecuteState ( ) ) { return getExecuteAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } else { return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; } case END_SUCCESS : return getEndSuccessAuditLogTypeValue ( org.ovirt.engine.core.bll.AddDiskCommand.getSucceeded ( ) ) ; default : return org.ovirt.engine.core.common.AuditLogType.USER_ADD_DISK_FINISHED_FAILURE ; } }
Source:
protected void authenticate ( org.ovirt.engine.core.uutils.ssh.SSHClient client , java.lang.String userId , java.lang.String password ) throws javax.naming.AuthenticationException { client.setUser ( userId ) ; client.setPassword ( password ) ; try { client.authenticate ( ) ; } catch ( javax.naming.AuthenticationException e ) { throw e ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Exception during authentication!" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
protected void authenticate ( org.ovirt.engine.core.uutils.ssh.SSHClient client , java.lang.String userId , java.lang.String password ) throws javax.naming.AuthenticationException { client.setUser ( userId ) ; client.setPassword ( password ) ; try { client.authenticate ( ) ; } catch ( javax.naming.AuthenticationException e ) { throw e ; } catch ( java.lang.Exception e ) { log.error ( "Exception during authentication: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; throw new java.lang.RuntimeException ( e ) ; } }
Source:
public static java.lang.String getTrustStorePassword ( ) { return org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKITrustStorePassword ( ) ; }

Target:
public static void setTrustStore ( java.security.KeyStore keystore ) { try ( java.io.OutputStream out = new java.io.FileOutputStream ( org.ovirt.engine.core.bll.provider.ExternalTrustStoreInitializer.getTrustStorePath ( ) ) ) { java.lang.String password = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getPKITrustStorePassword ( ) ; keystore.store ( out , password.toCharArray ( ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > getQuotaVdsGroupByVdsGroupGuid ( org.ovirt.engine.core.compat.Guid vdsGroupId , org.ovirt.engine.core.compat.Guid quotaId , boolean allowEmpty ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createQuotaIdParameterMapper ( quotaId ) . addValue ( "vds_group_id" , vdsGroupId ) . addValue ( "allow_empty" , allowEmpty ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = getCallsHandler ( ) . executeReadList ( "GetQuotaVdsGroupByVdsGroupGuid" , getVdsGroupQuotaResultSet ( ) , parameterSource ) ; return quotaVdsGroupList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > getQuotaClusterByClusterGuid ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid quotaId , boolean allowEmpty ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createQuotaIdParameterMapper ( quotaId ) . addValue ( "cluster_id" , clusterId ) . addValue ( "allow_empty" , allowEmpty ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = getCallsHandler ( ) . executeReadList ( "GetQuotaClusterByClusterGuid" , getClusterQuotaResultSet ( ) , parameterSource ) ; return quotaClusterList ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangeable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangeable ( true ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( this . getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ; status = org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getIrsProxy ( ) . destroyStoragePool ( org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , vds.getVdsSpmId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.irsbroker.DestroyStoragePoolVDSCommand.RemoveIrsProxy ( ) ; }
Source:
protected void failedToRunVm ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }

Target:
protected void runningFailed ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmPoolOnStopVm ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getProvider ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST ) ; } org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = getProviderProxy ( ) ; if ( providerProxy == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NOT_SUPPORTED , java.lang.String.format ( "$providerType %1$s" , getProvider ( ) . getType ( ) ) ) ; } org.ovirt.engine.core.bll.provider.ProviderValidator validator = getProviderProxy ( ) . getProviderValidator ( ) ; return ( validate ( validator.nameAvailable ( ) ) ) && ( validate ( validator.validateAddProvider ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ( getProvider ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_DOESNT_EXIST ) ; } org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = getProviderProxy ( ) ; if ( providerProxy == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NOT_SUPPORTED , java.lang.String.format ( "$providerType %1$s" , getProvider ( ) . getType ( ) ) ) ; } org.ovirt.engine.core.bll.provider.ProviderValidator validator = getProviderProxy ( ) . getProviderValidator ( ) ; return ( validate ( validator.nameAvailable ( ) ) ) && ( validate ( validator.validateAddProvider ( ) ) ) ; }
Source:
public void refresh ( ) { refresh ( getSessionInfo ( org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getHttpSessionId ( ) ) ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
public void testReapingOnGetWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; assertExpected ( 3 ) ; assertSizes ( 1 , 1 ) ; assertNull ( map.get ( "three" ) ) ; }

Target:
public void testReapingOnGetWithGC ( ) throws java.lang.Exception { setUpGCExpectations ( 5 ) ; populate ( 1 , 2 , 3 ) ; map.reapable ( "one" ) ; map.reapable ( "three" ) ; assertSizes ( 1 , 2 ) ; assertExpected ( 3 ) ; assertSizes ( 1 , 1 ) ; org.junit.Assert.assertNull ( map.get ( "three" ) ) ; }
Source:
public static boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain , org.ovirt.engine.core.common.businessentities.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.VolumeFormat volumeFormat ) { return ! ( ( ( ( ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ) ) && ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ) ) ) || ( ( ( storageDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) && ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ) ) ) ) || ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.Unassigned ) ) ) || ( volumeType == ( org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned ) ) ) ; }

Target:
public static boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain , org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat volumeFormat ) { return ! ( ( ( ( ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Preallocated ) ) && ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.COW ) ) ) || ( ( ( storageDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Sparse ) ) ) && ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.RAW ) ) ) ) || ( volumeFormat == ( org.ovirt.engine.core.common.businessentities.storage.VolumeFormat.Unassigned ) ) ) || ( volumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.Unassigned ) ) ) ; }
Source:
public static boolean IsDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isData = ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.IsActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }

Target:
public static boolean isDataActiveStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isData = ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ; boolean isActive = org.ovirt.engine.ui.uicommonweb.Linq.isActiveStorageDomain ( storageDomain ) ; return isData && isActive ; }
Source:
public int getHostAvailableMemoryLimit ( org.ovirt.engine.core.common.businessentities.VDS curVds ) { if ( ( ( ( curVds.getMemCommited ( ) ) != null ) && ( ( curVds.getPhysicalMemMb ( ) ) != null ) ) && ( ( curVds.getReservedMem ( ) ) != null ) ) { double vdsCurrentMem = getVdsCurrentMemoryInUse ( curVds ) ; double vdsMemLimit = getVdsMemLimit ( curVds ) ; return ( ( int ) ( vdsMemLimit - vdsCurrentMem ) ) ; } return 0 ; }

Target:
public boolean hasOvercommitMemoryToRunVM ( org.ovirt.engine.core.common.businessentities.VDS curVds , org.ovirt.engine.core.common.businessentities.VM vm ) { double vmMemRequired = ( vm.getMemSizeMb ( ) ) + ( curVds.getGuestOverhead ( ) ) ; double vdsMemLimit = curVds.getMaxSchedulingMemory ( ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "hasOvercommitMemoryToRunVM: host '{}'; max scheduling memory : MB; required memory is MB; Guest overhead MB" , curVds.getName ( ) , vdsMemLimit , vmMemRequired , curVds.getGuestOverhead ( ) ) ; org.ovirt.engine.core.bll.scheduling.SlaValidator.log.debug ( "{} <= ??? {}" , vmMemRequired , vdsMemLimit ) ; return vmMemRequired <= vdsMemLimit ; }
Source:
protected void setUpGetEntityExpectations ( boolean filter ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" , "Filtered" } , new java.lang.Object [ ] { GUIDS [ 0 ] , filter } , getEntity ( 0 ) ) ; }

Target:
protected void setUpGetEntityExpectations ( boolean filter , boolean getCertInfo ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" , "Filtered" } , new java.lang.Object [ ] { GUIDS [ 0 ] , filter } , getEntity ( 0 ) ) ; if ( getCertInfo ) { setUpGetCertificateInfo ( ) ; } }
Source:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmOnDown ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
protected void runningFailed ( ) { try { decreasePendingVm ( ) ; org.ovirt.engine.core.bll.RunVmCommandBase.getVdsBroker ( ) . RemoveAsyncRunningCommand ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommandBase.setCommandShouldBeLogged ( false ) ; _isRerun = false ; org.ovirt.engine.core.bll.RunVmCommandBase.setSucceeded ( false ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log ( ) ; processVmOnDown ( ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) , false ) ; } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServer mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( ) ; glusterServer.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "server_id" ) ) ) ; glusterServer.setGlusterServerUuid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "gluster_server_uuid" ) ) ) ; return glusterServer ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServer mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ( ) ; glusterServer.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "server_id" ) ) ) ; glusterServer.setGlusterServerUuid ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "gluster_server_uuid" ) ) ) ; return glusterServer ; }
Source:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { 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 : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void copyDiskDevicesFromTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vmDisksSource.getId ( ) , VmDeviceGeneralType.DISK ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDisksSource.getId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getStaticData ( ) , true , disks , getSrcDeviceIdToTargetDeviceIdMapping ( ) , false , false , false , false , false ) ; }

Target:
private void copyDiskDevicesFromTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmDisksSource.getId ( ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK.getName ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyDiskDevices ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , disks , getSrcDeviceIdToTargetDeviceIdMapping ( ) ) ; }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private void clearLabelsFromRemovedBonds ( java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsToConfigureByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingBondToRemove : getRemovedBonds ( ) ) { nicsToConfigureByName.get ( existingBondToRemove.getName ( ) ) . setLabels ( null ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; setItems ( vms ) ; }

Target:
protected void syncSearch ( ) { syncSearch ( VdcQueryType.GetUnregisteredVms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; }
Source:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , iface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , matcher ) ; }

Target:
public void testInterfaceIsBondWhenInterfaceIsNotBonded ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createVdsNetworkInterfaceWithName ( ) ; iface.setBonded ( false ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , iface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( iface ) . interfaceIsBondOrNull ( ) , matcher ) ; }
Source:
private void setUpEntityQueryExpectations ( int cnt ) throws java.lang.Exception { for ( int i = 0 ; i < cnt ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetWatchdog , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.TEMPLATE_ID } , getEntity ( ) ) ; } }

Target:
private void setUpEntityQueryExpectations ( int cnt ) throws java.lang.Exception { for ( int i = 0 ; i < cnt ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetWatchdog , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateWatchdogResourceTest.TEMPLATE_ID } , getEntity ( ) ) ; } }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testCommandNonVmNetwork ( ) { setUpPhysicalNetwork ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.HAS_SHORT_NAME , ( ! ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.IS_VM_NETWORK ) ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK.name ( ) ) ) ; }

Target:
public void testCommandNonVmNetwork ( ) { setUpPhysicalNetwork ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.HAS_SHORT_NAME , ( ! ( org.ovirt.engine.core.bll.network.dc.AutodefineExternalNetworkCommandTest.IS_VM_NETWORK ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_A_VM_NETWORK ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.job.Job > getJobsByOffsetAndPageSize ( int offset , int pageSize ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "position" , offset ) . addValue ( "page_size" , pageSize ) ; return getCallsHandler ( ) . executeReadList ( "GetJobsByOffsetAndPageSize" , createEntityRowMapper ( ) , parameterSource ) ; }

Target:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { updateQuery ( entityManager.createNamedQuery ( "Job.deleteJobOlderThanDateWithStatus" ) . setParameter ( "sinceDate" , sinceDate ) . setParameter ( "statuses" , statusesList ) ) ; }
Source:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetworkAndUpdateHostSetupNetworksParameters ( dataFromHostSetupNetworksModel , networkToDetach ) ; }

Target:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModelParametersHelper ( networkToDetach ) . updateParametersToDetach ( ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setReturnValue ( ( ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.getInstance ( ) . getPassword ( org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getParameters ( ) . getSessionId ( ) ) ) != null ) ) ; org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setReturnValue ( ( ( sessionDataContainer.getPassword ( org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getParameters ( ) . getSessionId ( ) ) ) != null ) ) ; org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; }
Source:
private void setupVdsNetworkInterfaceDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > expectedVdsNetworkInterface = java.util.Collections.singletonList ( vdsNetworkInterface ) ; org.ovirt.engine.core.dao.network.InterfaceDao vdsNetworkInterfaceDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.InterfaceDao.class ) ; org.mockito.Mockito.when ( vdsNetworkInterfaceDaoMock.getVdsInterfacesByNetworkId ( networkId ) ) . thenReturn ( expectedVdsNetworkInterface ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getInterfaceDao ( ) ) . thenReturn ( vdsNetworkInterfaceDaoMock ) ; }

Target:
private void setupHostNetworkQosDao ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getHostNetworkQosDao ( ) ) . thenReturn ( hostNetworkQosDaoMocked ) ; org.mockito.Mockito.when ( networkMocked.getQosId ( ) ) . thenReturn ( qosId ) ; org.mockito.Mockito.when ( hostNetworkQosDaoMocked.get ( networkMocked.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; }
Source:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
public void performAction ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isOutgoingHeartbeat ( ) ) ) && ( this . isOutgoingHeartbeatExeeded ( ) ) ) { this . sendHeartbeat ( ) ; this . processOutgoing ( ) ; } }

Target:
public void performAction ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isOutgoingHeartbeat ( ) ) ) && ( this . isOutgoingHeartbeatExceeded ( ) ) ) { this . sendHeartbeat ( ) ; this . processOutgoing ( ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc glusterVolumeTaskStatus ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeTaskStatus ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeRebalanceStop ( java.lang.String volumeName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeRebalanceStop ( volumeName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }