auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.api.model.Vms list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( QueryType.GetAllVms , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , SearchType.VM ) , true ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VM ) , false ) ; } }

Target:
public org.ovirt.engine.api.model.Vms list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( QueryType.GetAllVms , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) , SearchType.VM ) , true ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VM ) , false ) ; } }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , null , false , false ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }
Source:
protected void executeCommand ( ) { getClusterPolicy ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . addClusterPolicy ( getClusterPolicy ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { getClusterPolicy ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . addClusterPolicy ( getClusterPolicy ( ) ) ; getReturnValue ( ) . setActionReturnValue ( getClusterPolicy ( ) . getId ( ) ) ; setSucceeded ( true ) ; }
Source:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; }

Target:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( "vms/" + ( GUIDS [ 0 ] ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.ActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( "vms/" + ( GUIDS [ 0 ] ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
public static void getClusterServerMemoryOverCommit ( 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 ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getExternalHostName ( ) ) ) ) { hostName_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getProviders ( ) ) ) ) { providers_SelectedItemChanged ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }
Source:
public void vdsGroupWithNoServiceEnabled ( ) { createCommandWithNoService ( ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.cpuExists ( ) ; allQueriesEmpty ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_AT_LEAST_ONE_SERVICE_MUST_BE_ENABLED ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
protected void executeQueryCommand ( ) { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAll ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.ProviderType providerType = org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getParameters ( ) . getProviderType ( ) ; if ( providerType == null ) { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAll ( ) ) ; } else { setReturnValue ( org.ovirt.engine.core.bll.provider.GetAllProvidersQuery.getDbFacade ( ) . getProviderDao ( ) . getAllByType ( providerType ) ) ; } }
Source:
public static void getHostPublicKey ( 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.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VdsNetworkInterface lookupInterface ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getCollection ( ) ) { if ( iface.getId ( ) . toString ( ) . equals ( id ) ) { return iface ; } } return entityNotFound ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface lookupInterfaceById ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : getCollection ( ) ) { if ( iface.getId ( ) . toString ( ) . equals ( id ) ) { return iface ; } } return null ; }
Source:
public void testAdd ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }

Target:
public void testAdd ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpVolumeCreationExpectations ( false ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; javax.ws.rs.core.Response response = collection.add ( createModel ( ) ) ; org.junit.Assert.assertEquals ( 201 , response.getStatus ( ) ) ; org.junit.Assert.assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.GlusterVolume ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.GlusterVolume ) ( response.getEntity ( ) ) ) , 1 ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePool ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeReadList ( "GetVdsByStoragePoolId" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > getAllForStoragePool ( org.ovirt.engine.core.compat.Guid storagePool , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = getCallsHandler ( ) . executeReadList ( "GetVdsByStoragePoolId" , org.ovirt.engine.core.dao.VdsDAODbFacadeImpl.VdsRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePool ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; return uniteAgents ( vdsList ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.gluster.CreateBrickModel object ) { deviceTable.asEditor ( ) . edit ( object.getStorageDevices ( ) ) ; driver.edit ( object ) ; deviceSelectionInfo.setText ( null ) ; setDeviceInfoVisibility ( false ) ; }

Target:
private void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { lvNameEditor.setLabel ( constants.logicalVolume ( ) ) ; mountPointEditor.setLabel ( constants.mountPoint ( ) ) ; sizeEditor.setLabel ( constants.lvSize ( ) ) ; raidParamsLabel.setText ( constants.raidParameters ( ) ) ; raidTypeEditor.setLabel ( constants.raidType ( ) ) ; noOfPhysicalDisksEditor.setLabel ( constants.noOfPhysicalDisksInRaidVolume ( ) ) ; stripeSizeLabel.setText ( constants.stripeSize ( ) ) ; deviceHeader.setText ( constants.storageDevices ( ) ) ; }
Source:
public void testAddIncompleteParameters2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setTemplate ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "template.id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm model = new org.ovirt.engine.api.model.Vm ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "cluster.id|name" ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cdrom cdrom ) { validateParameters ( cdrom , "file.id" ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; vm = map ( cdrom , vm ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase parameters = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; return performCreate ( VdcActionType.UpdateVm , parameters , new org.ovirt.engine.api.restapi.resource.BackendVmCdromsResource.VmResolver ( ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Cdrom cdrom ) { validateParameters ( cdrom , "file.id" ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; vm = map ( cdrom , vm ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase parameters = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; return performCreate ( ActionType.UpdateVm , parameters , new org.ovirt.engine.api.restapi.resource.BackendVmCdromsResource.VmResolver ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ; 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.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean runAndPausedSucceeded = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , runAndPausedSucceeded ) ; }

Target:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean runAndPausedSucceeded = ( java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; executionHandler.endJob ( executionContext , runAndPausedSucceeded ) ; }
Source:
private void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; java.lang.Integer backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( this , "backupCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }

Target:
private void initialize ( ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; java.lang.Integer backupCheckPeriodInHours = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.BackupCheckPeriodInHours ) ; if ( backupCheckPeriodInHours > 0 ) { schedulerUtil.scheduleAFixedDelayJob ( this , "backupCheck" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , backupCheckPeriodInHours , backupCheckPeriodInHours , java.util.concurrent.TimeUnit.HOURS ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; } }
Source:
public void canDoActionFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsForDeviceAlreadyInUse ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = getStorageDevice ( "sda" , null ) ; storageDevice.setCanCreateBrick ( false ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.QuotaClusterLimit incoming ) { org.ovirt.engine.core.common.businessentities.Quota entity = getQuota ( ) ; org.ovirt.engine.core.common.action.QuotaCRUDParameters parameters = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( map ( incoming , entity ) ) ; performAction ( VdcActionType.UpdateQuota , parameters ) ; entity = getQuota ( ) ; updateIncomingId ( incoming , entity ) ; org.ovirt.engine.api.model.QuotaClusterLimit model = map ( entity , incoming ) ; model = addLinks ( doPopulate ( model , entity ) ) ; return javax.ws.rs.core.Response.ok ( model ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.QuotaClusterLimit incoming ) { org.ovirt.engine.core.common.businessentities.Quota entity = getQuota ( ) ; org.ovirt.engine.core.common.action.QuotaCRUDParameters parameters = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( map ( incoming , entity ) ) ; performAction ( ActionType.UpdateQuota , parameters ) ; entity = getQuota ( ) ; updateIncomingId ( incoming , entity ) ; org.ovirt.engine.api.model.QuotaClusterLimit model = map ( entity , incoming ) ; model = addLinks ( doPopulate ( model , entity ) ) ; return javax.ws.rs.core.Response.ok ( model ) . build ( ) ; }
Source:
public static void getStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void VdsNameVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setVdsName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }

Target:
public void vdsNameVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVdsName ( null ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setVdsName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVds ( v ) ; final java.lang.String s = b.getVdsName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }
Source:
public static void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected boolean isMemorySizeLegal ( org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) ; return org.ovirt.engine.core.bll.VmHandler.isMemorySizeLegal ( vmStaticData.getos ( ) , vmStaticData.getmem_size_mb ( ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , version.toString ( ) ) ; }

Target:
protected boolean isMemorySizeLegal ( org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStaticData = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) ; return org.ovirt.engine.core.bll.VmHandler.isMemorySizeLegal ( vmStaticData.getOs ( ) , vmStaticData.getMemSizeMb ( ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , version.toString ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { if ( ( getDiskStorageType ( ) . getEntity ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }
Source:
public void freeMacs ( java.util.List < java.lang.String > macs ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; for ( java.lang.String mac : macs ) { macsStorage.freeMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; } } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public java.util.List < java.lang.String > allocateMacAddresses ( int numberOfAddresses ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; return allocateNewMacsWithoutLocking ( numberOfAddresses ) ; } }
Source:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.info ( ( "Message sent: " + ( new java.lang.String ( message , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.UTF8 ) ) ) ) ; final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }

Target:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( new java.lang.String ( message , org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.UTF8 ) ) ) ) ; } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , response ) ; }
Source:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.EnableLoadBalancer ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }

Target:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableLoadBalancer ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.VmAffinityGroupListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.hostdev.VmHostDeviceListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; }
Source:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return ( ( java.util.List < Q > ) ( org.apache.commons.collections.CollectionUtils.intersection ( filteredList , searchList ) ) ) ; } else { return filteredList ; } }

Target:
protected java.util.List < Q > getBackendCollection ( org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , org.ovirt.engine.core.common.interfaces.SearchType searchType ) { java.util.List < Q > filteredList = getBackendCollection ( entityType , query , queryParams ) ; java.lang.String search = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { java.util.List < Q > searchList = getBackendCollection ( searchType ) ; return ( ( java.util.List < Q > ) ( org.apache.commons.collections.CollectionUtils.intersection ( filteredList , searchList ) ) ) ; } else { return filteredList ; } }
Source:
private boolean validateCrossAttachments ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachmentsForVds ) { networkAttachmentsForVds.add ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsGroupId ( ) ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator crossAttachmentsValidator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( networkAttachmentsForVds , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ) ; return validate ( crossAttachmentsValidator.validateNetworkExclusiveOnNics ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getHostInterfaces ( ) { if ( ( hostNics ) == null ) { hostNics = interfaceDao.getAllInterfacesForVds ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsId ( ) ) ; } return hostNics ; }
Source:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void setupMocks ( ) { vmInterfaceManager = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.network.VmInterfaceManager ( macPool ) ) ; org.mockito.Mockito.doReturn ( vmNetworkStatisticsDao ) . when ( vmInterfaceManager ) . getVmNetworkStatisticsDao ( ) ; org.mockito.Mockito.doReturn ( vmNicDao ) . when ( vmInterfaceManager ) . getVmNicDao ( ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( vmInterfaceManager ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmInterfaceManager ) . removeFromExternalNetworks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; }
Source:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , domain , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=" + groupname : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getDirectoryGroupSearchPattern ( java.lang.String groupname , java.lang.String domain ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.common.businessentities.aaa.DbGroup.class , false ) ; final java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_GROUPS_SEARCH_TEMPLATE , domain , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "name=" + groupname : constraint ) ) ; return sb.toString ( ) ; }
Source:
public void testRpmRelease ( ) { org.junit.Assert.assertEquals ( "20130212.fc18.noarch" , new org.ovirt.engine.core.compat.RpmVersion ( "ovirt-node-iso-2.6.0-20130212.fc18.noarch" ) . getRpmRelease ( ) ) ; org.junit.Assert.assertEquals ( "1.1.i386" , new org.ovirt.engine.core.compat.RpmVersion ( "test-javadb-common-10.2.2.2.2-1.1.i386" ) . getRpmRelease ( ) ) ; org.junit.Assert.assertEquals ( "2.3.10.4.fc18.x86_64" , new org.ovirt.engine.core.compat.RpmVersion ( "java-1.7.0-openjdk-devel-1.7.0.25-2.3.10.4.fc18.x86_64" ) . getRpmRelease ( ) ) ; org.junit.Assert.assertEquals ( "1.el6" , new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "RHEV-Agent" , true ) . getRpmRelease ( ) ) ; org.junit.Assert.assertEquals ( "1.el6" , new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "rhev-agent" , false ) . getRpmRelease ( ) ) ; }

Target:
public void testRpmRelease ( ) { org.junit.jupiter.api.Assertions.assertEquals ( "20130212.fc18.noarch" , new org.ovirt.engine.core.compat.RpmVersion ( "ovirt-node-iso-2.6.0-20130212.fc18.noarch" ) . getRpmRelease ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "1.1.i386" , new org.ovirt.engine.core.compat.RpmVersion ( "test-javadb-common-10.2.2.2.2-1.1.i386" ) . getRpmRelease ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "2.3.10.4.fc18.x86_64" , new org.ovirt.engine.core.compat.RpmVersion ( "java-1.7.0-openjdk-devel-1.7.0.25-2.3.10.4.fc18.x86_64" ) . getRpmRelease ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "1.el6" , new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "RHEV-Agent" , true ) . getRpmRelease ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( "1.el6" , new org.ovirt.engine.core.compat.RpmVersion ( "rhev-agent-2.3.7.10.3-1.el6" , "rhev-agent" , false ) . getRpmRelease ( ) ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Host ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.HostPredicate ( host.getId ( ) ) ) ) ; } }
Source:
private void setIsoPrefixVDSMethod ( java.lang.String isoPrefix ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue isoPrefixReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; isoPrefixReturnValue.setReturnValue ( isoPrefix ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsoPrefix ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.IrsBaseVDSCommandParameters.class ) ) ) . thenReturn ( isoPrefixReturnValue ) ; }

Target:
private void setIsoPrefixVDSMethod ( final java.lang.String isoPrefix ) { org.mockito.Mockito.doAnswer ( new org.mockito.stubbing.Answer < java.lang.String > ( ) { @ java.lang.Override public java.lang.String answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { return org.ovirt.engine.core.bll.ImagesHandler.cdPathWindowsToLinux ( invocation.getArguments ( ) [ 0 ] . toString ( ) , isoPrefix ) ; } } ) . when ( command ) . cdPathWindowsToLinux ( org.mockito.Matchers.anyString ( ) ) ; }