auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( ( commandContext ) == null ) || ( ( commandContext.getExecutionContext ( ) ) == null ) ) || ( commandContext.getExecutionContext ( ) . isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.CorrelationIdTracker.setCorrelationId ( command.getCorrelationId ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; }

Target:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( ( commandContext ) == null ) || ( ( commandContext.getExecutionContext ( ) ) == null ) ) || ( commandContext.getExecutionContext ( ) . isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.CorrelationIdTracker.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( result ) ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) != null ) { applicationsTable.setRowData ( org.ovirt.engine.ui.uicommonweb.Linq.toList ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) ) ; } else { applicationsTable.setRowData ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) != null ) { applicationsTable.setRowData ( new java.util.ArrayList ( getDetailModel ( ) . getAppListModel ( ) . getItems ( ) ) ) ; } else { applicationsTable.setRowData ( new java.util.ArrayList < java.lang.String > ( ) ) ; } }
Source:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand < org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) ) ; setupMocks ( ) ; org.mockito.Mockito.doReturn ( getServer ( ) ) . when ( cmd ) . getUpServer ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; } } }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; } } }
Source:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }

Target:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.flush ( ) ; return tableModel != null ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }

Target:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }
Source:
private void saveLUNsInDB ( final java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : luns ) { proceedLUNInDb ( lun , getStorageDomain ( ) . getStorageType ( ) , getStorageDomain ( ) . getStorage ( ) ) ; } return null ; } } ) ; }

Target:
protected void saveLUNsInDB ( final java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > luns ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : luns ) { proceedLUNInDb ( lun , getStorageDomain ( ) . getStorageType ( ) , getStorageDomain ( ) . getStorage ( ) ) ; } return null ; } } ) ; }
Source:
private void verifyCapabilities ( org.ovirt.engine.api.model.Capabilities capabilities ) { assertNotNull ( capabilities ) ; assertEquals ( 2 , capabilities.getVersions ( ) . size ( ) ) ; verifyVersion ( capabilities.getVersions ( ) . get ( 0 ) , 1 , 5 , false , "bar" , 0 , false , false , false ) ; verifyVersion ( capabilities.getVersions ( ) . get ( 1 ) , 10 , 3 , true , "foo" , 15 , true , true , true ) ; verifyPermits ( capabilities ) ; verifySchedulingPolicies ( capabilities ) ; }

Target:
private void verifyCapabilities ( org.ovirt.engine.api.model.Capabilities capabilities ) { assertNotNull ( capabilities ) ; assertEquals ( 2 , capabilities.getVersions ( ) . size ( ) ) ; verifyVersion ( capabilities.getVersions ( ) . get ( 0 ) , 1 , 5 , false , "bar" , 0 , false , false , false ) ; verifyVersion ( capabilities.getVersions ( ) . get ( 1 ) , 10 , 3 , true , "foo" , 15 , true , true , true ) ; verifySchedulingPolicies ( capabilities ) ; }
Source:
public java.util.Map activateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { try { log.info ( "Activating storage domain, spUUID: sdUUID: {}" , new java.lang.Object [ ] { spUUID , sdUUID } ) ; final org.ovirt.vdsmfake.domain.DataCenter dataCenter = getDataCenterById ( spUUID ) ; final org.ovirt.vdsmfake.domain.StorageDomain storageDomain = dataCenter.getStorageDomainMap ( ) . get ( sdUUID ) ; storageDomain.setDomainStatus ( StorageDomain.DomainStatus.ACTIVE ) ; updateStorageDomain ( storageDomain ) ; return getOKStatus ( ) ; } catch ( java.lang.Exception e ) { throw error ( e ) ; } }

Target:
public java.util.Map activateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID ) { try { log.info ( "Activating storage domain, spUUID: sdUUID: {}" , new java.lang.Object [ ] { spUUID , sdUUID } ) ; final org.ovirt.vdsmfake.domain.DataCenter dataCenter = getDataCenterById ( spUUID ) ; final org.ovirt.vdsmfake.domain.StorageDomain storageDomain = dataCenter.getStorageDomainMap ( ) . get ( sdUUID ) ; if ( storageDomain != null ) { storageDomain.setDomainStatus ( StorageDomain.DomainStatus.ACTIVE ) ; updateStorageDomain ( storageDomain ) ; } return getOKStatus ( ) ; } catch ( java.lang.Exception e ) { throw error ( e ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetwork ( ) . getId ( ) ) ) ; return ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static void getTemplateDiskList ( 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private void setUpDAOMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }

Target:
private void setUpDAOMocks ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacadeMock = getDbFacadeMockInstance ( ) ; snapshotDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.SnapshotDao.class ) ; org.mockito.Mockito.when ( dbFacadeMock.getSnapshotDao ( ) ) . thenReturn ( snapshotDaoMock ) ; org.mockito.Mockito.when ( snapshotDaoMock.getAll ( vmId , getUser ( ) . getId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( java.util.Arrays.asList ( snapshot ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmPayload getPayload ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = null ; if ( ( vm.isSetPayloads ( ) ) && ( vm.getPayloads ( ) . isSetPayload ( ) ) ) { payload = getMapper ( org.ovirt.engine.api.model.Payload.class , org.ovirt.engine.core.common.businessentities.VmPayload.class ) . map ( vm.getPayloads ( ) . getPayload ( ) . get ( 0 ) , new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ) ; } return payload ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmPayload getPayload ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = null ; if ( ( vm.isSetPayloads ( ) ) && ( vm.getPayloads ( ) . isSetPayloads ( ) ) ) { payload = getMapper ( org.ovirt.engine.api.model.Payload.class , org.ovirt.engine.core.common.businessentities.VmPayload.class ) . map ( vm.getPayloads ( ) . getPayloads ( ) . get ( 0 ) , new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ) ; } return payload ; }
Source:
public void updateDc ( org.ovirt.engine.core.compat.Version dcCompatibilityVersion , boolean customPropertiesVisible , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Guid qosId ) { this . dcCompatibilityVersion = dcCompatibilityVersion ; this . customPropertiesVisible = customPropertiesVisible ; this . dcId = dcId ; customPropertiesSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SupportCustomDeviceProperties , dcCompatibilityVersion.toString ( ) ) ) ) ; getPortMirroring ( ) . setIsChangable ( isPortMirroringSupported ( ) ) ; initCustomPropertySheet ( ) ; initNetworkQoSList ( qosId ) ; }

Target:
public void updateDc ( org.ovirt.engine.core.compat.Version dcCompatibilityVersion , org.ovirt.engine.core.compat.Guid dcId ) { this . dcCompatibilityVersion = dcCompatibilityVersion ; this . dcId = dcId ; customPropertiesSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SupportCustomDeviceProperties , dcCompatibilityVersion.toString ( ) ) ) ) ; getPortMirroring ( ) . setIsChangable ( isPortMirroringSupported ( ) ) ; initCustomPropertySheet ( ) ; initNetworkQoSList ( ) ; }
Source:
public void testListCrashClientLocale ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public void testGetCurrentWithMatrixTrue ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" , "true" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Cdrom cdrom = resource.get ( ) ; verifyModelWithCurrentCd ( cdrom ) ; }

Target:
public void testGetCurrentWithMatrixTrue ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , "current" , "true" ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( getVm ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = resource.get ( ) ; verifyModelWithCurrentCd ( cdrom ) ; }
Source:
private void verifyAllContent ( org.ovirt.engine.api.model.Snapshot model , org.ovirt.engine.api.model.ConfigurationType type , java.lang.String data ) { assertNotNull ( model.getInitialization ( ) ) ; assertNotNull ( model.getInitialization ( ) . getConfiguration ( ) ) ; assertEquals ( data , model.getInitialization ( ) . getConfiguration ( ) . getData ( ) ) ; assertEquals ( type.value ( ) , model.getInitialization ( ) . getConfiguration ( ) . getType ( ) ) ; }

Target:
private void verifyAllContent ( org.ovirt.engine.api.model.Snapshot model , org.ovirt.engine.api.model.ConfigurationType type , java.lang.String data ) { assertNotNull ( model.getInitialization ( ) ) ; assertNotNull ( model.getInitialization ( ) . getConfiguration ( ) ) ; assertEquals ( data , model.getInitialization ( ) . getConfiguration ( ) . getData ( ) ) ; assertEquals ( type , model.getInitialization ( ) . getConfiguration ( ) . getType ( ) ) ; }
Source:
private void updateSnapshotsFromExport ( ) { if ( ( getVm ( ) . getSnapshots ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { getSnapshotDao ( ) . update ( snapshot ) ; } else { getSnapshotDao ( ) . save ( snapshot ) ; } } } }

Target:
private void updateSnapshotsFromExport ( ) { if ( ( getVm ( ) . getSnapshots ( ) ) == null ) { return ; } for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { getSnapshotDao ( ) . update ( snapshot ) ; } else { getSnapshotDao ( ) . save ( snapshot ) ; } } }
Source:
protected void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }

Target:
private void loadPolicyUnits ( ) { java.util.List < org.ovirt.engine.core.common.scheduling.PolicyUnit > allPolicyUnits = getPolicyUnitDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : allPolicyUnits ) { if ( policyUnit.isInternal ( ) ) { policyUnits.put ( policyUnit.getId ( ) , org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.getPolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } else { policyUnits.put ( policyUnit.getId ( ) , new org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl ( policyUnit , getPendingResourceManager ( ) ) ) ; } } }
Source:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult , java.util.List < java.lang.String > message ) { if ( ! ( validationResult.isValid ( ) ) ) { message.add ( validationResult.getMessage ( ) . name ( ) ) ; if ( ( validationResult.getVariableReplacements ( ) ) != null ) { for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { message.add ( variableReplacement ) ; } } } return validationResult.isValid ( ) ; }

Target:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult , java.util.List < java.lang.String > message ) { if ( ! ( validationResult.isValid ( ) ) ) { message.add ( validationResult.getMessage ( ) . name ( ) ) ; for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { message.add ( variableReplacement ) ; } } return validationResult.isValid ( ) ; }
Source:
private java.lang.String getNetworkId ( java.lang.String networkName ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } return null ; }

Target:
private java.lang.String getNetworkId ( java.lang.String networkName ) { if ( networkName != null ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.network.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } } return null ; }
Source:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Host" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView.constants.showReportHost ( ) , resourceSubActions ) ) ; } } }

Target:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Host" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView.constants.showReportHost ( ) , resourceSubActions ) ) ; } } }
Source:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( networkDeviceHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( networkDeviceHelper.getFreeVf ( nic , null ) ) ) ; }
Source:
private void commit ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = new org.ovirt.engine.ui.uicompat.Enlistment ( context ) ; enlistment.getDoneEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { doneOnCommitHandler ( ) ; } } ) ; org.ovirt.engine.ui.uicompat.IEnlistmentNotification notification = notifications.get ( commitIndex ) ; notification.commit ( enlistment ) ; }

Target:
private void commit ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = new org.ovirt.engine.ui.uicompat.Enlistment ( context ) ; enlistment.getDoneEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { doneOnCommitHandler ( ) ; } } ) ; org.ovirt.engine.ui.uicompat.IEnlistmentNotification notification = notifications.get ( commitIndex ) ; notification.commit ( enlistment ) ; }
Source:
public void saveNICsConfig ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.CommitNetworkChanges , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.VdsActionParameters ( getEntity ( ) . getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void saveNICsConfig ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.CommitNetworkChanges , new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.VdsActionParameters ( getEntity ( ) . getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( vmDao , getNetwork ( ) ) ; return ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notLabeled ( ) ) ) ) && ( validate ( validator.notExternalNetwork ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( vmDao , getNetwork ( ) ) ; return ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notLabeled ( ) ) ) ) && ( validate ( validator.notExternalNetwork ( ) ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain convert ( java.lang.Object source ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }
Source:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > expectedCluster = java.util.Collections.singletonList ( cluster ) ; org.ovirt.engine.core.dao.ClusterDao clusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.mockito.Mockito.when ( clusterDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getClusterDao ( ) ) . thenReturn ( clusterDaoMock ) ; }

Target:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > expectedCluster = java.util.Collections.singletonList ( cluster ) ; org.mockito.Mockito.when ( clusterDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedCluster ) ; }
Source:
public void vmTypeChanged ( org.ovirt.engine.core.common.businessentities.VmType vmType ) { deactivateInstanceTypeManager ( ) ; if ( getModel ( ) . getProvisioning ( ) . getIsAvailable ( ) ) { getModel ( ) . getProvisioning ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Server ) ) ) ; } super . vmTypeChanged ( vmType ) ; activateInstanceTypeManager ( ) ; }

Target:
public void vmTypeChanged ( org.ovirt.engine.core.common.businessentities.VmType vmType ) { if ( getModel ( ) . getProvisioning ( ) . getIsAvailable ( ) ) { getModel ( ) . getProvisioning ( ) . setEntity ( ( vmType == ( org.ovirt.engine.core.common.businessentities.VmType.Server ) ) ) ; } super . vmTypeChanged ( vmType ) ; }
Source:
public void initialize ( org.ovirt.engine.core.common.validation.annotation.ConfiguredRange constraintAnnotation ) { if ( ( constraintAnnotation.minConfigValue ( ) ) != ( org.ovirt.engine.core.common.config.ConfigValues.Invalid ) ) { min = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.minConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; } else { min = constraintAnnotation.min ( ) ; } max = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( constraintAnnotation.maxConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; }

Target:
public void initialize ( org.ovirt.engine.core.common.validation.annotation.ConfiguredRange constraintAnnotation ) { if ( ( constraintAnnotation.minConfigValue ( ) ) != ( org.ovirt.engine.core.common.config.ConfigValues.Invalid ) ) { min = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( constraintAnnotation.minConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; } else { min = constraintAnnotation.min ( ) ; } max = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( constraintAnnotation.maxConfigValue ( ) , ConfigCommon.defaultConfigurationVersion ) ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getstorage_ids ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : getstorage_ids ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : filteredStorageDomains ) { if ( storageDomainId.equals ( storageDomain.getId ( ) ) ) { domains.add ( storageDomain ) ; break ; } } } return domains ; }
Source:
public void init ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > > initialHashes = new java.util.ArrayList < > ( ) ; initialHashes.add ( new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.vdsbroker.monitoring.VmDevicesMonitoringTest.VM_ID , org.ovirt.engine.core.vdsbroker.monitoring.VmDevicesMonitoringTest.INITIAL_HASH ) ) ; org.mockito.Mockito.doReturn ( initialHashes ) . when ( vmDynamicDao ) . getAllDevicesHashes ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Version.getLast ( ) ) . when ( vdsManager ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( vdsManager ) . when ( resourceManager ) . getVdsManager ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.vdsbroker.monitoring.VmDevicesMonitoringTest.injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; }

Target:
public void init ( ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > > initialHashes = new java.util.ArrayList < > ( ) ; initialHashes.add ( new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.vdsbroker.monitoring.VmDevicesMonitoringTest.VM_ID , org.ovirt.engine.core.vdsbroker.monitoring.VmDevicesMonitoringTest.INITIAL_HASH ) ) ; org.mockito.Mockito.doReturn ( initialHashes ) . when ( vmDynamicDao ) . getAllDevicesHashes ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Version.getLast ( ) ) . when ( vdsManager ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( vdsManager ) . when ( resourceManager ) . getVdsManager ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void initCustomPropertySheet ( ) { setCustomPropertySheet ( new org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel ( ) ) ; if ( ( clusterPolicy.getParameterMap ( ) ) != null ) { getCustomProperties ( ) . putAll ( clusterPolicy.getParameterMap ( ) ) ; } customPropertiesInitialized = true ; refreshCustomProperties ( null ) ; }

Target:
private void initCustomPropertySheet ( ) { setCustomPropertySheet ( new org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueModel ( ) ) ; if ( ( clusterPolicy.getParameterMap ( ) ) != null ) { getCustomProperties ( ) . putAll ( clusterPolicy.getParameterMap ( ) ) ; } customPropertiesInitialized = true ; refreshCustomProperties ( null , false ) ; }
Source:
public void syncNetworkOnVlan ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setVlanId ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void syncNetworkOnVlan ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setVlanId ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpClusterExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) ) ; }
Source:
private boolean validateHostUniqueNameAndAddress ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStaticData ) { org.ovirt.engine.core.compat.Guid vdsForUniqueId = org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsForUniqueId ( ) ; if ( vdsForUniqueId == null ) { return ! ( org.ovirt.engine.core.bll.VdsHandler.isVdsExist ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) , org.ovirt.engine.core.bll.AddVdsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ; } else { return ! ( org.ovirt.engine.core.bll.VdsHandler.isVdsExistForPendingOvirt ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) , org.ovirt.engine.core.bll.AddVdsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vdsForUniqueId ) ) ; } }

Target:
private boolean validateHostUniqueNameAndAddress ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStaticData ) { org.ovirt.engine.core.compat.Guid vdsForUniqueId = org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsForUniqueId ( ) ; if ( vdsForUniqueId == null ) { return ! ( org.ovirt.engine.core.bll.VdsHandler.isVdsExist ( vdsStaticData , org.ovirt.engine.core.bll.AddVdsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ) ; } return ! ( org.ovirt.engine.core.bll.VdsHandler.isVdsExistForPendingOvirt ( vdsStaticData , org.ovirt.engine.core.bll.AddVdsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , vdsForUniqueId ) ) ; }
Source:
public void setAcceptableValues ( java.util.Collection < java.util.Date > values ) { java.util.List < java.util.Date > allowedDates = ( ( java.util.List < java.util.Date > ) ( values ) ) ; java.util.Collections.sort ( allowedDates ) ; setDateRange ( allowedDates.get ( 0 ) , allowedDates.get ( ( ( allowedDates.size ( ) ) - 1 ) ) ) ; }

Target:
public void setAcceptableValues ( java.util.Collection < java.util.Date > values ) { if ( values instanceof java.util.List < ? > ) { java.util.List < java.util.Date > allowedDates = ( ( java.util.List < java.util.Date > ) ( values ) ) ; java.util.Collections.sort ( allowedDates ) ; setDateRange ( allowedDates.get ( 0 ) , allowedDates.get ( ( ( allowedDates.size ( ) ) - 1 ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) return true ; if ( ( obj == null ) || ( ( obj.getClass ( ) ) != ( this . getClass ( ) ) ) ) return false ; org.ovirt.engine.core.vdsbroker.attestation.AttestationValue other = ( ( org.ovirt.engine.core.vdsbroker.attestation.AttestationValue ) ( obj ) ) ; return ( java.util.Objects.equals ( hostName , other.hostName ) ) && ( java.util.Objects.equals ( trustLevel , other.trustLevel ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.vdsbroker.attestation.AttestationValue ) ) { return false ; } org.ovirt.engine.core.vdsbroker.attestation.AttestationValue other = ( ( org.ovirt.engine.core.vdsbroker.attestation.AttestationValue ) ( obj ) ) ; return ( java.util.Objects.equals ( hostName , other.hostName ) ) && ( java.util.Objects.equals ( trustLevel , other.trustLevel ) ) ; }
Source:
public static boolean CanRemoveAdGroup ( org.ovirt.engine.core.compat.Guid groupId , java.util.ArrayList < java.lang.String > reasons ) { boolean returnValue = true ; if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.isLastSuperUserGroup ( groupId ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ERROR_CANNOT_REMOVE_LAST_SUPER_USER_ROLE.toString ( ) ) ; } if ( groupId.equals ( MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID ) ) { returnValue = false ; reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_BUILTIN_GROUP_EVERYONE.name ( ) ) ; } return returnValue ; }

Target:
protected boolean isLastSuperUserGroup ( org.ovirt.engine.core.compat.Guid groupId ) { return org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.isLastSuperUserGroup ( groupId ) ; }
Source:
public void testGetNotFound2 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound2 ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( asList ( getEntity ( 2 ) ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void setLibvirtVersion ( java.lang.String value ) { if ( ! ( libvirtVersion.equals ( value ) ) ) { libvirtVersion = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "LibvirtVersion" ) ) ; } }

Target:
public void setLibvirtVersion ( java.lang.String value ) { if ( ( ( libvirtVersion ) == null ) && ( value == null ) ) { return ; } if ( ( ( libvirtVersion ) == null ) || ( ! ( libvirtVersion.equals ( value ) ) ) ) { libvirtVersion = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "LibvirtVersion" ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.storage_pool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }