auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; log.info ( "Updating size of image to {}" , diskImage , sizeInBytes ) ; org.ovirt.engine.core.bll.MergeExtendCommand.getDbFacade ( ) . getImageDao ( ) . updateImageSize ( diskImage , sizeInBytes ) ; }

Target:
private void updateSizeInDb ( ) { org.ovirt.engine.core.compat.Guid diskImage = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getBaseImage ( ) . getImageId ( ) ; long sizeInBytes = org.ovirt.engine.core.bll.MergeExtendCommand.getParameters ( ) . getTopImage ( ) . getSize ( ) ; log.info ( "Updating size of image to {}" , diskImage , sizeInBytes ) ; imageDao.updateImageSize ( diskImage , sizeInBytes ) ; }
Source:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getThreadsPerCpu ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getValidationMessages ( ) ) ; }
Source:
protected void volumeType_SelectedItemChanged ( ) { if ( ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) || ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.VolumeType volumeType = getVolumeType ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = getStorageDomain ( ) . getSelectedItem ( ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }

Target:
protected void volumeType_SelectedItemChanged ( ) { if ( ( ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) || ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) ) || ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ) { return ; } org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType = getVolumeType ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageType = getStorageDomain ( ) . getSelectedItem ( ) . getStorageType ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }
Source:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MalformedIdException exception ) { org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Malformed id detected while processing \"{}\" request for path \"{}\"" , request.getMethod ( ) , uriInfo.getPath ( ) ) ; org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Exception" , exception ) ; return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( exception.getCause ( ) . getMessage ( ) ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MalformedIdException exception ) { org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Malformed id detected while processing \"{}\" request for path \"{}\"" , request.getMethod ( ) , uriInfo.getPath ( ) ) ; org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Exception" , exception ) ; final org.ovirt.engine.api.model.Fault fault = new org.ovirt.engine.api.model.Fault ( ) ; fault.setReason ( "Operation failed" ) ; fault.setDetail ( exception.getCause ( ) . getMessage ( ) ) ; return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( fault ) . build ( ) ; }
Source:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setvmt_guid ( VmTemplateHandler.BlankVmTemplateId ) ; vm.setvmt_name ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; UpdateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getstorage_pool_id ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }

Target:
private void endCopyCollapseOperations ( org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setvmt_guid ( VmTemplateHandler.BlankVmTemplateId ) ; vm.setvmt_name ( null ) ; org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . getId ( vm.getId ( ) , SnapshotType.ACTIVE ) ) ; vm.setSnapshots ( java.util.Arrays.asList ( activeSnapshot ) ) ; updateCopyVmInSpm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getstorage_pool_id ( ) , vm , org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getStorageDomainId ( ) ) ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public boolean getHostnameEnabled ( ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( getHostname ( ) . getEntity ( ) ) ) ) ) ; }

Target:
public boolean getHostnameEnabled ( ) { if ( isWindowsOS ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( getWindowsHostname ( ) . getEntity ( ) ) ) ) ) ; } else { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( getHostname ( ) . getEntity ( ) ) ) ) ) ; } }
Source:
protected boolean connectStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { try { return org.ovirt.engine.core.bll.storage.connection.StorageHelperDirector.getInstance ( ) . getItem ( storageDomain.getStorageType ( ) ) . connectStorageToDomainByVdsId ( storageDomain , getVdsId ( ) ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Exception while connecting a storage domain" , e ) ; return false ; } }

Target:
protected boolean connectStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { try { return storageHelperDirector.getItem ( storageDomain.getStorageType ( ) ) . connectStorageToDomainByVdsId ( storageDomain , getVdsId ( ) ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Exception while connecting a storage domain" , e ) ; return false ; } }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } if ( OsRepositoryImpl.INSTANCE.isTimezoneValueInteger ( vm.getStaticData ( ) . getOsId ( ) , null ) ) { timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; } else { timeZone = vm.getTimeZone ( ) ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.osRepository.isTimezoneValueInteger ( vm.getStaticData ( ) . getOsId ( ) , null ) ) { timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; } else { timeZone = vm.getTimeZone ( ) ; } return timeZone ; }
Source:
public org.ovirt.engine.sdk.entities.Host createHost ( java.lang.String name , java.lang.Long memory ) { org.ovirt.engine.sdk.entities.Host host = new org.ovirt.engine.sdk.entities.Host ( ) ; host.setName ( name ) ; host.setId ( name ) ; host.setMemory ( memory ) ; host.setCluster ( cluster ) ; host.setCpu ( new org.ovirt.engine.sdk.entities.CPU ( ) ) ; host.getCpu ( ) . setArchitecture ( "Westmere" ) ; bestSolution.getHosts ( ) . add ( host ) ; return host ; }

Target:
public org.ovirt.engine.sdk.entities.Host createHost ( java.lang.String name , java.lang.Long memory ) { org.ovirt.engine.sdk.entities.Host host = new org.ovirt.engine.sdk.entities.Host ( ) ; host.setName ( name ) ; host.setId ( name ) ; host.setMemory ( memory ) ; host.setCluster ( cluster ) ; host.setCpu ( new org.ovirt.engine.sdk.entities.CPU ( ) ) ; host.getCpu ( ) . setArchitecture ( "Westmere" ) ; host.getCpu ( ) . setTopology ( new org.ovirt.engine.sdk.entities.CpuTopology ( ) ) ; bestSolution.getHosts ( ) . add ( host ) ; return host ; }
Source:
private void assertReturnedRange ( java.util.List < org.ovirt.engine.core.bll.network.macpoolmanager.Range > ranges , org.ovirt.engine.core.bll.network.macpoolmanager.MacsStorage macsStorage , java.util.List < java.lang.Integer > expectedRangeIndices ) { for ( int expectedRangeIndex : expectedRangeIndices ) { org.ovirt.engine.core.bll.network.macpoolmanager.Range actualRange = macsStorage.getRangeWithAvailableMac ( ) ; org.ovirt.engine.core.bll.network.macpoolmanager.Range expectedRange = ranges.get ( expectedRangeIndex ) ; org.junit.Assert.assertThat ( actualRange , new org.hamcrest.core.IsSame ( expectedRange ) ) ; } }

Target:
private void assertReturnedRange ( java.util.List < org.ovirt.engine.core.bll.network.macpool.Range > ranges , org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage , java.util.List < java.lang.Integer > expectedRangeIndices ) { for ( int expectedRangeIndex : expectedRangeIndices ) { org.ovirt.engine.core.bll.network.macpool.Range actualRange = macsStorage.getRangeWithAvailableMac ( ) ; org.ovirt.engine.core.bll.network.macpool.Range expectedRange = ranges.get ( expectedRangeIndex ) ; org.junit.Assert.assertThat ( actualRange , new org.hamcrest.core.IsSame ( expectedRange ) ) ; } }
Source:
public void qosValuesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertNetworkModified ( helper , network ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVdsGroup ( ) ; if ( ( ! ( cluster.supportsGlusterService ( ) ) ) || ( ! ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.glusterBrickProvisioning ( cluster.getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER ) ; } org.ovirt.engine.core.bll.VdsValidator validator = new org.ovirt.engine.core.bll.VdsValidator ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVds ( ) ) ; return validate ( validator.isUp ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVdsGroup ( ) ; if ( ( ! ( cluster.supportsGlusterService ( ) ) ) || ( ! ( getGlusterUtil ( ) . isGlusterBrickProvisioningSupported ( cluster.getcompatibility_version ( ) , org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVdsGroup ( ) . getId ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER ) ; } org.ovirt.engine.core.bll.VdsValidator validator = new org.ovirt.engine.core.bll.VdsValidator ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVds ( ) ) ; return validate ( validator.isUp ( ) ) ; }
Source:
public void testUpdateGlusterServerHookStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookExisting = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.ENABLED , serverhookExisting.getStatus ( ) ) ; dao.updateGlusterServerHookStatus ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , GlusterHookStatus.DISABLED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookUpdated = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertNotNull ( serverhookUpdated ) ; org.junit.Assert.assertEquals ( GlusterHookStatus.DISABLED , serverhookUpdated.getStatus ( ) ) ; }

Target:
public void testUpdateGlusterServerHookStatus ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookExisting = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterHookStatus.ENABLED , serverhookExisting.getStatus ( ) ) ; dao.updateGlusterServerHookStatus ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 , GlusterHookStatus.DISABLED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverhookUpdated = dao.getGlusterServerHook ( FixturesTool.HOOK_ID , FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( serverhookUpdated ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterHookStatus.DISABLED , serverhookUpdated.getStatus ( ) ) ; }
Source:
public static void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
protected < T > T performAction ( org.ovirt.engine.core.common.action.VdcActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , java.lang.Class < T > resultType ) { try { return resultType.cast ( doAction ( task , params ) . getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return handleError ( resultType , e , false ) ; } }

Target:
protected < T > T performAction ( org.ovirt.engine.core.common.action.ActionType task , org.ovirt.engine.core.common.action.VdcActionParametersBase params , java.lang.Class < T > resultType ) { try { return resultType.cast ( doAction ( task , params ) . getActionReturnValue ( ) ) ; } catch ( java.lang.Exception e ) { return handleError ( resultType , e , false ) ; } }
Source:
public static void getClusterGlusterServices ( 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 ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
protected void selectDataCenterWithCluster ( org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster selectedDataCenterWithCluster = ( selectedCluster == null ) ? org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) : org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ; getDataCenterWithClustersList ( ) . setItems ( dataCentersWithClusters , selectedDataCenterWithCluster ) ; }

Target:
protected void selectDataCenterWithCluster ( org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster selectedDataCenterWithCluster = ( selectedCluster == null ) ? org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCentersWithClusters ) : org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ; getDataCenterWithClustersList ( ) . setItems ( dataCentersWithClusters , selectedDataCenterWithCluster ) ; }
Source:
public void bridgePropertiesNonVm ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; network.setVmNetwork ( false ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void bridgePropertiesNonVm ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; network.setVmNetwork ( false ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; customProperties.add ( iface , createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void testCannotDisableVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; command.getParameters ( ) . setVirtioScsiEnabled ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; disk.setPlugged ( true ) ; mockDiskDaoGetAllForVm ( java.util.Collections.singletonList ( disk ) , true ) ; mockVmValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.CANNOT_DISABLE_VIRTIO_SCSI_PLUGGED_DISKS ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void testClear ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ClearExternalJob , org.ovirt.engine.core.common.action.VdcActionParametersBase.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.clear ( action ) ) ; }

Target:
public void testClear ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.ClearExternalJob , org.ovirt.engine.core.common.action.VdcActionParametersBase.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.clear ( action ) ) ; }
Source:
public void testUpdateBrickNetworkId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertNull ( existingBrick.getNetworkId ( ) ) ; dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( FixturesTool.NETWORK_ENGINE , existingBrick.getNetworkId ( ) ) ; }

Target:
public void testUpdateBrickNetworkId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertNull ( existingBrick.getNetworkId ( ) ) ; dao.updateBrickNetworkId ( FixturesTool.GLUSTER_BRICK_UUID1 , FixturesTool.NETWORK_ENGINE ) ; existingBrick = dao.getById ( FixturesTool.GLUSTER_BRICK_UUID1 ) ; org.junit.Assert.assertNotNull ( existingBrick ) ; org.junit.Assert.assertEquals ( FixturesTool.NETWORK_ENGINE , existingBrick.getNetworkId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = dao.getAllByClusterAndNetworkId ( FixturesTool.GLUSTER_CLUSTER_ID , FixturesTool.NETWORK_ENGINE ) ; org.junit.Assert.assertNotNull ( bricks ) ; }
Source:
private void assertDiscardValue ( boolean discardAfterDelete , java.lang.Boolean supportsDiscard , boolean expectedFixedDiscardParameter , boolean diskAttachedToAtLeastOneVmWithEnableDiscard ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setDiscardAfterDelete ( discardAfterDelete ) ; storageDomain.setSupportsDiscard ( supportsDiscard ) ; org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandlerTest.ParametersWithPostDeleteAction params = new org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandlerTest.ParametersWithPostDeleteAction ( false , storageDomain.getDiscardAfterDelete ( ) ) ; org.mockito.Mockito.doReturn ( diskAttachedToAtLeastOneVmWithEnableDiscard ) . when ( postDeleteActionHandler ) . diskVmElementWithPassDiscardExists ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( expectedFixedDiscardParameter , postDeleteActionHandler.fixDiscardField ( params , storageDomain ) . isDiscard ( ) ) ; }

Target:
private void assertDiscardValue ( boolean discardAfterDelete , java.lang.Boolean supportsDiscard , boolean expectedFixedDiscardParameter , boolean diskAttachedToAtLeastOneVmWithEnableDiscard ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setDiscardAfterDelete ( discardAfterDelete ) ; storageDomain.setSupportsDiscard ( supportsDiscard ) ; org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandlerTest.ParametersWithPostDeleteAction params = new org.ovirt.engine.core.bll.storage.domain.PostDeleteActionHandlerTest.ParametersWithPostDeleteAction ( false , storageDomain.getDiscardAfterDelete ( ) ) ; org.mockito.Mockito.doReturn ( diskAttachedToAtLeastOneVmWithEnableDiscard ) . when ( postDeleteActionHandler ) . diskVmElementWithPassDiscardExists ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedFixedDiscardParameter , postDeleteActionHandler.fixDiscardField ( params , storageDomain ) . isDiscard ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wipeVolume ( java.lang.String sdUUID , java.lang.String imgUUID , java.lang.String volUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.wipeVolume" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgUUID ) . withParameter ( "volumeID" , volUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn wipeVolume ( java.lang.String sdUUID , java.lang.String imgUUID , java.lang.String volUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.wipeVolume" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "imageID" , imgUUID ) . withParameter ( "volumeID" , volUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public static void GetMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Integer ) ( source ) ) . intValue ( ) : 262144 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetRpmVersionViaPublic ( 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.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile object ) { java.lang.String name = constants.unlimitedQos ( ) ; if ( ( object.getQosId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.qos.CpuQos cpuQos = getModel ( ) . getQos ( object.getQosId ( ) ) ; if ( cpuQos != null ) { name = cpuQos.getName ( ) ; } } return name ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.profiles.CpuProfile object ) { java.lang.String name = org.ovirt.engine.ui.webadmin.section.main.view.tab.cluster.CpuProfilesListModelTable.constants.unlimitedQos ( ) ; if ( ( object.getQosId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.qos.CpuQos cpuQos = getModel ( ) . getQos ( object.getQosId ( ) ) ; if ( cpuQos != null ) { name = cpuQos.getName ( ) ; } } return name ; }
Source:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldDetectSufficientMemory ( ) { vm.setNumaTuneMode ( NumaTuneMode.STRICT ) ; vmNumaNodes.get ( 0 ) . setMemTotal ( 1000 ) ; vdsNumaNodes.get ( 0 ) . setMemTotal ( 2000 ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
public void qosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertQosOverridden ( helper , iface ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( nic ) ; return nic ; }
Source:
protected void executeQueryCommand ( ) { boolean filterInternalDomain = false ; if ( ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) instanceof org.ovirt.engine.core.common.queries.GetDomainListParameters ) { filterInternalDomain = ( ( org.ovirt.engine.core.common.queries.GetDomainListParameters ) ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) ) . getFilterInternalDomain ( ) ; } java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( filterInternalDomain ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }

Target:
protected void executeQueryCommand ( ) { boolean filterInternalDomain = false ; if ( ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) instanceof org.ovirt.engine.core.common.queries.GetDomainListParameters ) { filterInternalDomain = ( ( org.ovirt.engine.core.common.queries.GetDomainListParameters ) ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) ) ) . getFilterInternalDomain ( ) ; } java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( filterInternalDomain ) ; java.util.Collections.sort ( domains ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }
Source:
private java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > getAdditionalClusterFeaturesAdded ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > featuresSupported = new java.util.HashSet ( org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getAddtionalFeaturesSupported ( ) ) ; featuresSupported.removeAll ( getClusterFeatureDao ( ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getVdsGroup ( ) . getId ( ) ) ) ; return featuresSupported ; }

Target:
private java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > getAdditionalClusterFeaturesAdded ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > featuresSupported = new java.util.HashSet ( org.ovirt.engine.core.bll.UpdateClusterCommand.getCluster ( ) . getAddtionalFeaturesSupported ( ) ) ; featuresSupported.removeAll ( getClusterFeatureDao ( ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.bll.UpdateClusterCommand.getCluster ( ) . getId ( ) ) ) ; return featuresSupported ; }
Source:
private void doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( boolean displayNetwork , org.ovirt.engine.core.common.businessentities.network.Network network , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setIpConfiguration ( null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( displayNetwork , matcher , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extendImageTransferSession ( java.lang.String ticketId , long expiration ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extendImageTransferSession ( ticketId , expiration ) ; 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.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.prepareImage ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConsoleDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; } } ) ) ; }

Target:
protected void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConsoleDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < java.lang.String > consoleDevices = returnValue.getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; } } ) ) ; }