auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.OneVmReturnForXmlRpc getExternalVmFromOva ( java.lang.String ovaPath ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVmFromOva ( ovaPath ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 1 ) ; setUpUpdateExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getRestModel ( 0 ) ) , 0 ) ; }
Source:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , ActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }

Target:
public org.ovirt.engine.api.model.Template update ( org.ovirt.engine.api.model.Template incoming ) { validateIconParams ( incoming ) ; org.ovirt.engine.api.model.Template result = performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.QueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class ) , ActionType.UpdateVmTemplate , new org.ovirt.engine.api.restapi.resource.BackendTemplateResource.UpdateParametersProvider ( ) ) ; if ( result != null ) { org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , result ) ; } return result ; }
Source:
protected java.lang.String composeRegex ( ) { return ( ( start ( ) ) + ( acceptEmptyInput ? hostnameOrIpOrEmpty ( ) : hostnameOrIp ( ) ) ) + ( end ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( "" ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( value ) ; }
Source:
public void init ( final javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { this . config = config ; this . enabled = ( ( java.lang.Boolean ) ( getBackendParameter ( ConfigurationValues.CORSSupport ) ) ) ; this . enabledDefaultOrigins = ( ( java.lang.Boolean ) ( getBackendParameter ( ConfigurationValues.CORSAllowDefaultOrigins ) ) ) ; java.lang.String sufficesFromConf = org.apache.commons.lang.StringUtils.defaultString ( ( ( java.lang.String ) ( getBackendParameter ( ConfigurationValues.CORSDefaultOriginSuffixes ) ) ) , "" ) ; this . defaultOriginsSuffixes = new java.util.HashSet < > ( java.util.Arrays.asList ( sufficesFromConf.split ( "," ) ) ) ; }

Target:
public void init ( final javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { this . config = config ; this . enabled = ( ( java.lang.Boolean ) ( getBackendParameter ( ConfigValues.CORSSupport ) ) ) ; this . enabledDefaultOrigins = ( ( java.lang.Boolean ) ( getBackendParameter ( ConfigValues.CORSAllowDefaultOrigins ) ) ) ; java.lang.String sufficesFromConf = org.apache.commons.lang.StringUtils.defaultString ( ( ( java.lang.String ) ( getBackendParameter ( ConfigValues.CORSDefaultOriginSuffixes ) ) ) , "" ) ; this . defaultOriginsSuffixes = new java.util.HashSet < > ( java.util.Arrays.asList ( sufficesFromConf.split ( "," ) ) ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Vm > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.Vm vm : collection ) { assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Vm > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.Vm vm : collection ) { org.junit.Assert.assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network_cluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network_cluster entity = new org.ovirt.engine.core.common.businessentities.network_cluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.NetworkCluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.NetworkCluster entity = new org.ovirt.engine.core.common.businessentities.NetworkCluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }
Source:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map , final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; }

Target:
protected void changeStorageDomainStatusInTransaction ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMap ( domain ) ; org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getstatus ( ) ) ; updateStatus ( map , status ) ; getCompensationContext ( ) . stateChanged ( ) ; } return null ; } } ) ; }
Source:
private void validateAndAssertQosOverridden ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; assertInterfaceModified ( helper , iface ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( java.lang.String name , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , name , true , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( bond ) ; return bond ; }
Source:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel getModel ( ) { return getVmGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmGeneralSubTabView ( modelProvider , constants ) ; }

Target:
public void onSubTabDeselected ( ) { }
Source:
public org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String message ) { return new org.ovirt.engine.core.common.businessentities.AuditLog ( logType , logType.getSeverity ( ) , message , getUserId ( ) , getUserName ( ) , getVmIdRef ( ) , getVmName ( ) , getVdsIdRef ( ) , getVdsName ( ) , getVmTemplateIdRef ( ) , getVmTemplateName ( ) , getOrigin ( ) , getCustomEventId ( ) , getEventFloodInSec ( ) , getCustomData ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.AuditLog createAuditLog ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String message ) { return new org.ovirt.engine.core.common.businessentities.AuditLog ( logType , logType.getSeverity ( ) , message , getUserId ( ) , getUserName ( ) , getVmIdRef ( ) , getVmName ( ) , getVdsIdRef ( ) , getVdsName ( ) , getVmTemplateIdRef ( ) , getVmTemplateName ( ) , getOrigin ( ) , getCustomId ( ) , getCustomEventId ( ) , getEventFloodInSec ( ) , getCustomData ( ) ) ; }
Source:
private void wipeAfterDelete_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { if ( ( ! ( getIsWipeAfterDelete ( ) . getIsChangable ( ) ) ) && ( getIsWipeAfterDelete ( ) . getEntity ( ) ) ) { getIsWipeAfterDelete ( ) . setEntity ( false ) ; } }

Target:
private void isBootable_EntityChanged ( ) { boolean isBootable = getIsBootable ( ) . getEntity ( ) ; if ( ( getIsShareable ( ) . getIsChangable ( ) ) || ( ! isBootable ) ) { getIsShareable ( ) . setIsChangable ( ( ! isBootable ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.cannotEnableShareableForBootableDisk ( ) ) ; } }
Source:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "" , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }

Target:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }
Source:
private void addVmRngDevice ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getRngDevice ( ) ; if ( rngDev != null ) { rngDev.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.common.action.RngDeviceParameters params = new org.ovirt.engine.core.common.action.RngDeviceParameters ( rngDev , true ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddRngDevice , params ) ; if ( ! ( result.getSucceeded ( ) ) ) { log.error ( "Couldn't add RNG device for new VM." ) ; throw new java.lang.IllegalArgumentException ( "Couldn't add RNG device for new VM." ) ; } } }

Target:
private void addVmRngDevice ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getRngDevice ( ) ; if ( rngDev != null ) { rngDev.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.common.action.RngDeviceParameters params = new org.ovirt.engine.core.common.action.RngDeviceParameters ( rngDev , true ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.AddRngDevice , params , org.ovirt.engine.core.bll.AddVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { log.error ( "Couldn't add RNG device for new VM." ) ; throw new java.lang.IllegalArgumentException ( "Couldn't add RNG device for new VM." ) ; } } }
Source:
public java.lang.String answer ( ) { return ( ( org.easymock.classextension.EasyMock.getCurrentArguments ( ) ) != null ) && ( ( org.easymock.classextension.EasyMock.getCurrentArguments ( ) . length ) > 0 ) ? mockl10n ( ( ( java.lang.String ) ( org.easymock.classextension.EasyMock.getCurrentArguments ( ) [ 0 ] ) ) ) : null ; }

Target:
public java.lang.String answer ( ) { return ( ( org.easymock.EasyMock.getCurrentArguments ( ) ) != null ) && ( ( org.easymock.EasyMock.getCurrentArguments ( ) . length ) > 0 ) ? mockl10n ( ( ( java.lang.String ) ( org.easymock.EasyMock.getCurrentArguments ( ) [ 0 ] ) ) ) : null ; }
Source:
public static void GetClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void GetPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters ( poolId ) , aQuery ) ; }
Source:
public void testValidateNetworkExclusiveOnNicsVmAndNonVmAttachedToInterface ( ) throws java.lang.Exception { checkVmNetworkIsSoleAssignedInterface ( failsWithNetworkInterfacesNotExclusivelyUsedByNetwork ( ) , vmNetwork1 , nonVmNetwork1 ) ; }

Target:
public void testDetermineNetworkType ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator validator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( null , null , networkExclusivenessValidator ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vlanNetwork ) , org.hamcrest.CoreMatchers.is ( NetworkType.VLAN ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( vmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkType.VM ) ) ; org.junit.Assert.assertThat ( validator.determineNetworkType ( nonVmNetwork1 ) , org.hamcrest.CoreMatchers.is ( NetworkType.NON_VM ) ) ; }
Source:
protected boolean disconnectStorage ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }

Target:
protected boolean disconnectStorage ( ) { return runVdsCommand ( VDSCommandType.DisconnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections [ ] { org.ovirt.engine.core.bll.storage.DisconnectStorageServerConnectionCommand.getConnection ( ) } ) ) ) ) . getSucceeded ( ) ; }
Source:
private void networkNotUsedByHostsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDAO hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByHosts ( ) , matcher ) ; }

Target:
private void networkNotUsedByHostsTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.dao.VdsDao hostDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( hostDao.getAllForNetwork ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; org.junit.Assert.assertThat ( validator.networkNotUsedByHosts ( ) , matcher ) ; }
Source:
private void VdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void VdsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
public void insufficientDiskSpaceWithSnapshots ( ) { setupDiskSpaceTest ( ) ; 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 ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void insufficientDiskSpaceWithSnapshots ( ) { setupDiskSpaceTest ( ) ; 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 ) ) ; org.mockito.Mockito.when ( cmd.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.ArgumentMatchers.anyCollectionOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private void saveLocalStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.Create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveLocal" } ) ) ) . Run ( ) ; }

Target:
private void saveLocalStorage ( ) { if ( ( getWindow ( ) . getProgress ( ) ) != null ) { return ; } getWindow ( ) . startProgress ( null ) ; org.ovirt.engine.ui.uicompat.Task.create ( this , new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( new java.lang.Object [ ] { "SaveLocal" } ) ) ) . run ( ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ times ] } , getEntityList ( ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ times ] } , getEntityList ( ) ) ; } }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }
Source:
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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.resource.VmNicResource getNicResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendVmNicResource ( parentId , id , this , updateType , getUpdateParametersProvider ( ) , getRequiredUpdateFields ( ) , subCollections ) ) ; }

Target:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; org.ovirt.engine.api.restapi.resource.BackendNicHelper.addReportedDevices ( this , model , entity ) ; if ( details.contains ( "statistics" ) ) { org.ovirt.engine.api.restapi.resource.BackendNicHelper.addStatistics ( this , model , entity ) ; } return model ; }
Source:
protected boolean isDiskExist ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( disk ) ; if ( ! ( validate ( diskValidator.isDiskExists ( ) ) ) ) { return false ; } if ( ! ( isDiskExistInVm ( disk ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean isDiskExist ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( disk ) ; return ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToVm ( org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmId ( ) ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsForDomain ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.utils.linq.LinqUtils.first ( org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getAllRunningVdssInPool ( ) ) ; if ( vds == null ) { return null ; } return runVdsCommand ( VDSCommandType.GetStorageDomainStats , new org.ovirt.engine.core.common.vdscommands.GetStorageDomainStatsVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStatsForDomain ( ) { java.util.Optional < org.ovirt.engine.core.common.businessentities.VDS > vds = org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getAllRunningVdssInPool ( ) . stream ( ) . findFirst ( ) ; if ( ! ( vds.isPresent ( ) ) ) { return null ; } return runVdsCommand ( VDSCommandType.GetStorageDomainStats , new org.ovirt.engine.core.common.vdscommands.GetStorageDomainStatsVDSCommandParameters ( vds.get ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }
Source:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "vdsBroker({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getKey ( ) , returnValue.getValue ( ) ) ; }

Target:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "vdsBroker({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.utils.Pair < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getFirst ( ) , returnValue.getSecond ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.Storage map ( org.ovirt.engine.core.common.businessentities.LUNs entity , org.ovirt.engine.api.model.Storage template ) { org.ovirt.engine.api.model.Storage model = ( template != null ) ? template : new org.ovirt.engine.api.model.Storage ( ) ; model.setId ( entity.getLUN_id ( ) ) ; model.setType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( entity.getLunType ( ) , null ) ) ; model.getLogicalUnits ( ) . add ( org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( entity , ( ( org.ovirt.engine.api.model.LogicalUnit ) ( null ) ) ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Storage map ( org.ovirt.engine.core.common.businessentities.storage.LUNs entity , org.ovirt.engine.api.model.Storage template ) { org.ovirt.engine.api.model.Storage model = ( template != null ) ? template : new org.ovirt.engine.api.model.Storage ( ) ; model.setId ( entity.getLUN_id ( ) ) ; model.setType ( org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( entity.getLunType ( ) , null ) ) ; model.getLogicalUnits ( ) . add ( org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( entity , ( ( org.ovirt.engine.api.model.LogicalUnit ) ( null ) ) ) ) ; return model ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.DataCenter > list ( java.lang.String query ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) ; if ( query != null ) { urlBuilder.add ( "search" , query , UrlParameterType.QUERY ) ; } java.lang.String url = urlBuilder.build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.DataCenters.class , org.ovirt.engine.sdk.decorators.DataCenter.class , headers ) ; }

Target:
public java.util.List < org.ovirt.engine.sdk.decorators.DataCenter > list ( java.lang.Boolean caseSensitive ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) ; if ( caseSensitive != null ) { urlBuilder.add ( "case_sensitive" , caseSensitive , UrlParameterType.MATRIX ) ; } java.lang.String url = urlBuilder.build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.DataCenters.class , org.ovirt.engine.sdk.decorators.DataCenter.class , headers ) ; }
Source:
public void validateFailsWithForceNotSupported ( ) { org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters parameters = new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( getVolume ( 2 , true ) , true ) ; org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand command = new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand ( parameters ) ; cmd = org.mockito.Mockito.spy ( command ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }

Target:
public void validateFailsWithClusterDoesNotSupportGluster ( ) { org.mockito.Mockito.doReturn ( getCluster ( false , Version.v4_1 ) ) . when ( clusterDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER ) ; }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public static void getAllDataCenterStorageConnections ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectableStorageServerConnectionsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ) ; for ( org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { org.ovirt.engine.core.utils.MockConfigRule.mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }

Target:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ) ; for ( org.ovirt.engine.core.common.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { org.ovirt.engine.core.common.utils.MockConfigRule.mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
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 ) { externalHostGroups_SelectedItemChanged ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.VDS > hostNameListModel = getExternalHostName ( ) ; hostNameListModel.setItems ( hosts ) ; hostNameListModel.setIsChangable ( true ) ; setEnableSearchHost ( true ) ; getProviders ( ) . setIsChangable ( true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hotplugDisk ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugDisk ( info.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( 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.ImageSizeReturnForXmlRpc diskSizeExtend ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > diskParams , java.lang.String newSize ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskSizeExtend ( vmId , diskParams , newSize ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "format" , "interface" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "validateDiskForCreation" , "format" , "interface" ) ; } }