auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; org.junit.Assert.assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; updateTemplate ( ) ; initNetworkInterfaces ( networkBehavior , null ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; updateTemplate ( ) ; initNetworkInterfaces ( networkBehavior , null ) ; updateMemoryBalloon ( ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 , getEntity ( 0 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveIscsiBond , org.ovirt.engine.core.common.action.RemoveIscsiBondParameters.class , new java.lang.String [ ] { "IscsiBondId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 , getEntity ( 0 ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveIscsiBond , org.ovirt.engine.core.common.action.RemoveIscsiBondParameters.class , new java.lang.String [ ] { "IscsiBondId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = org.ovirt.engine.core.bll.GetAllPoolVmsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForVmPool ( org.ovirt.engine.core.bll.GetAllPoolVmsQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; } org.ovirt.engine.core.bll.GetAllPoolVmsQuery.getQueryReturnValue ( ) . setReturnValue ( vmsList ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVMs ( ) { return vmDao.getAllForVmPool ( org.ovirt.engine.core.bll.GetAllPoolVmsQuery.getParameters ( ) . getId ( ) ) ; }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.error ( "Ending command '{}' with failure." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { getReturnValue ( ) . setEndActionTryAgain ( false ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > runBalance ( java.lang.String balanceName , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.BALANCE , createBalanceArgs ( balanceName , hostIDs , propertiesMap ) ) ; return parseBalanceResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( ( "Could not communicate with the external scheduler while balancing " + e ) ) ; return null ; } }

Target:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > runBalance ( java.lang.String balanceName , java.util.List < org.ovirt.engine.core.compat.Guid > hostIDs , java.util.Map < java.lang.String , java.lang.String > propertiesMap ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.BALANCE , createBalanceArgs ( balanceName , hostIDs , propertiesMap ) ) ; return parseBalanceResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while balancing" , e ) ; return null ; } }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getNetworkMappings ( ) ) == null ? 0 : getNetworkMappings ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getMessagingConfiguration ( ) ) == null ? 0 : getMessagingConfiguration ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.AgentConfiguration ) ) { return false ; } org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.AgentConfiguration other = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties.AgentConfiguration ) ( obj ) ) ; return ( java.util.Objects.equals ( networkMappings , other.networkMappings ) ) && ( java.util.Objects.equals ( messagingConfiguration , other.messagingConfiguration ) ) ; }
Source:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }

Target:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( isImagesAlreadyOnTarget ( ) ) ) ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }
Source:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { setPayload ( model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; setConsoleDevice ( model ) ; setVirtioScsiController ( model ) ; setSoundcard ( model ) ; setCertificateInfo ( model ) ; setVmOvfConfiguration ( model , entity ) ; setRngDevice ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Vm doPopulate ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setPayload ( this , model ) ; org.ovirt.engine.api.restapi.resource.MemoryPolicyHelper.setupMemoryBalloon ( model , this ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setConsoleDevice ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setVirtioScsiController ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setSoundcard ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setCertificateInfo ( this , model ) ; org.ovirt.engine.api.restapi.resource.BackendVmDeviceHelper.setRngDevice ( this , model ) ; setVmOvfConfiguration ( model , entity ) ; return model ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters params = new org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters ( getStoragePoolForVds ( ) . getId ( ) , org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) ) ; if ( runVdsCommand ( VDSCommandType.SpmStopOnIrs , params ) . getSucceeded ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_FORCE_SELECTED_SPM ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_FORCE_SELECTED_SPM_STOP_FAILED ) ; } org.ovirt.engine.core.bll.ForceSelectSPMCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters params = new org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommandParameters ( getStoragePoolForVds ( ) . getId ( ) , org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) ) ; if ( runVdsCommand ( VDSCommandType.SpmStopOnIrs , params ) . getSucceeded ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.USER_FORCE_SELECTED_SPM ) ; } else { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.USER_FORCE_SELECTED_SPM_STOP_FAILED ) ; } org.ovirt.engine.core.bll.ForceSelectSPMCommand.setSucceeded ( true ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }

Target:
public void addNotEmptyIdConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; newPosixConnection.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isConnWithSameDetailsExists ( newPosixConnection , null ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_NOT_EMPTY ) ; }
Source:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdsCommand ( VDSCommandType.RetrieveImageData , successfulReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }

Target:
public void successfulConfFileConvertToMap ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( VdcActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "hosted-engine-config.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VdcActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "sdUUID" ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.Matchers.hasKey ( "host_id" ) ) ; }
Source:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testInventoryFile ( ) { java.nio.file.Path inventoryFile = java.nio.file.Paths.get ( "myfile" ) ; java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . inventoryFile ( inventoryFile ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.IGNORE_SSH_CONFIG , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , ( "--inventory=" + inventoryFile ) , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
public static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap principal ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( accumulator , principal.get ( GroupRecord.GROUPS , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) ; principal.put ( GroupRecord.GROUPS , accumulator ) ; }

Target:
private static java.util.List < org.ovirt.engine.api.extensions.ExtMap > flatGroups ( org.ovirt.engine.api.extensions.ExtMap entity , org.ovirt.engine.api.extensions.ExtKey key , java.util.List < org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : entity.get ( key , java.util.Collections.< org.ovirt.engine.api.extensions.ExtMap > emptyList ( ) ) ) { accumulator.add ( group ) ; org.ovirt.engine.core.aaa.DirectoryUtils.flatGroups ( group , GroupRecord.GROUPS , accumulator ) ; } return accumulator ; }
Source:
private static void AddVmUsersToList ( java.util.List < org.ovirt.engine.core.compat.Guid > input , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > users = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDAO ( ) . getAllForVm ( vmId ) ; if ( users != null ) { for ( org.ovirt.engine.core.common.businessentities.DbUser user : users ) { if ( ! ( input.contains ( user.getuser_id ( ) ) ) ) { input.add ( user.getuser_id ( ) ) ; } } } }

Target:
private static void AddVmUsersToList ( java.util.List < org.ovirt.engine.core.compat.Guid > input , org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > users = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAllForVm ( vmId ) ; if ( users != null ) { for ( org.ovirt.engine.core.common.businessentities.DbUser user : users ) { if ( ! ( input.contains ( user.getuser_id ( ) ) ) ) { input.add ( user.getuser_id ( ) ) ; } } } }
Source:
public void testIsNetworkInSyncWhenBridgedFlagDifferent ( ) { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 1 ) ; iface.setBridged ( true ) ; network.setVmNetwork ( false ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenBridgedFlagDifferent ( ) { iface.setMtu ( 1 ) ; network.setMtu ( 1 ) ; iface.setVlanId ( 1 ) ; network.setVlanId ( 1 ) ; iface.setBridged ( true ) ; network.setVmNetwork ( false ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void testInvalidTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "06-test6.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme6 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertFalse ( "Theme 6 should not load" , theme6.load ( ) ) ; }

Target:
public void testInvalidTemplateReplaceProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "06-test6.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme6 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.jupiter.api.Assertions.assertFalse ( theme6.load ( ) , "Theme 6 should not load" ) ; }
Source:
private boolean isRunAndPaused ( ) { return ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; }

Target:
public void reportCompleted ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }
Source:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > messages ) { java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVMProperties ( vm.getVdsGroupCompatibilityVersion ( ) , vm.getStaticData ( ) ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateMemorySize ( org.ovirt.engine.core.common.businessentities.VM vm ) { int maxSize ; if ( getOsRepository ( ) . get64bitOss ( ) . contains ( vm.getOs ( ) ) ) { maxSize = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VM64BitMaxMemorySizeInMB , vm.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; } else { maxSize = org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; } if ( ( vm.getMemSizeMb ( ) ) > maxSize ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MEMORY_EXCEEDS_SUPPORTED_LIMIT ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { getEntity ( id ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( getDiskSubResource ( id ) . get ( ) , null ) ) ) ; return performAction ( VdcActionType.RemoveDiskSnapshots , new org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters ( diskImage.getImageId ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { getEntity ( id ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.api.restapi.types.DiskMapper.map ( getDiskSubResource ( id ) . get ( ) , null ) ) ) ; return performAction ( VdcActionType.RemoveDiskSnapshots , new org.ovirt.engine.core.common.action.RemoveDiskSnapshotsParameters ( diskImage.getImageId ( ) ) ) ; }
Source:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.TaskStateError ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( ( "SPMAsyncTask::ClearAsyncTask: At time of attempt to clear task '{}' the response code" + " was '{}' and message was '{}'. Task will not be cleaned" ) , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }

Target:
private boolean isTaskStateError ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { if ( ( ( vdsReturnValue != null ) && ( ( vdsReturnValue.getVdsError ( ) ) != null ) ) && ( ( vdsReturnValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.EngineError.TaskStateError ) ) ) { org.ovirt.engine.core.bll.tasks.SPMAsyncTask.log.info ( ( "SPMAsyncTask::ClearAsyncTask: At time of attempt to clear task '{}' the response code" + " was '{}' and message was '{}'. Task will not be cleaned" ) , getVdsmTaskId ( ) , vdsReturnValue.getVdsError ( ) . getCode ( ) , vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; return true ; } return false ; }
Source:
public void addOrUpdateTaskInDB ( final org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { persistCommand ( copyToCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . saveOrUpdate ( asyncTask ) ; }

Target:
private void buildCmdHierarchy ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( cmdEntity.getRootCommandId ( ) ) ) ) { childHierarchy.putIfAbsent ( cmdEntity.getRootCommandId ( ) , new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ; if ( ! ( childHierarchy.get ( cmdEntity.getRootCommandId ( ) ) . contains ( cmdEntity.getId ( ) ) ) ) { childHierarchy.get ( cmdEntity.getRootCommandId ( ) ) . add ( cmdEntity.getId ( ) ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockUser.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.USER_ID ) ; org.mockito.Mockito.when ( mockNetworkPredicate.eval ( mockExternalNetwork ) ) . thenReturn ( false ) ; org.mockito.Mockito.when ( mockNetworkPredicate.eval ( mockManagementNetworkCandidate ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.DC_ID , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.USER_ID , true ) ) . thenReturn ( dcNetworks ) ; final org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.DC_ID ) ; params.setFiltered ( true ) ; underTest = new org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.TestGetManagementNetworkCandidatesQuery ( params ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mockUser.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.USER_ID ) ; org.mockito.Mockito.when ( mockNetworkPredicate.test ( mockExternalNetwork ) ) . thenReturn ( false ) ; org.mockito.Mockito.when ( mockNetworkPredicate.test ( mockManagementNetworkCandidate ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.DC_ID , org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.USER_ID , true ) ) . thenReturn ( dcNetworks ) ; final org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.DC_ID ) ; params.setFiltered ( true ) ; underTest = new org.ovirt.engine.core.bll.network.dc.GetManagementNetworkCandidatesQueryTest.TestGetManagementNetworkCandidatesQuery ( params ) ; }
Source:
private static org.ovirt.engine.core.common.action.VdcActionType getEndActionType ( org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask ) { org.ovirt.engine.core.common.action.VdcActionType commandType = dbAsyncTask.getActionParameters ( ) . getCommandType ( ) ; if ( ! ( VdcActionType.Unknown.equals ( commandType ) ) ) { return commandType ; } return dbAsyncTask.getaction_type ( ) ; }

Target:
private static org.ovirt.engine.core.common.action.VdcActionType getEndActionType ( org.ovirt.engine.core.common.businessentities.AsyncTask dbAsyncTask ) { org.ovirt.engine.core.common.action.VdcActionType commandType = dbAsyncTask.getActionParameters ( ) . getCommandType ( ) ; if ( ! ( VdcActionType.Unknown.equals ( commandType ) ) ) { return commandType ; } return dbAsyncTask.getActionType ( ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { return ( ( ( ( obj != null ) && ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ( obj ) ) . getId ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getKey ( ) , ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ( obj ) ) . getKey ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getValue ( ) , ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ) ( obj ) ) . getValue ( ) ) ) ; }

Target:
public java.util.List < java.lang.String > getAllowedValues ( ) { return allowedValues ; }
Source:
private void addOrUpdateServerHook ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook > serverHooks , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VDS , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > pairResult ) { if ( ( getServerHookFromList ( serverHooks , pairResult.getFirst ( ) . getId ( ) ) ) == null ) { addServerHook ( pairResult.getFirst ( ) . getId ( ) ) ; } else { updateServerHookStatusInDb ( getGlusterHook ( ) . getId ( ) , pairResult.getFirst ( ) . getId ( ) , getNewStatus ( ) ) ; } }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; if ( ( getGlusterHook ( ) ) != null ) { jobProperties.put ( GlusterConstants.HOOK_NAME , getGlusterHook ( ) . getName ( ) ) ; } } return jobProperties ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.QoS qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK.name ( ) ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; return hostNIC ; }

Target:
protected org.ovirt.engine.api.model.HostNic postPopulate ( org.ovirt.engine.api.model.HostNic model ) { org.ovirt.engine.api.model.HostNic hostNIC = super . postPopulate ( model ) ; org.ovirt.engine.api.model.Qos qos = hostNIC.getQos ( ) ; qos.setType ( QosType.HOSTNETWORK.name ( ) ) ; qos.setName ( null ) ; qos.setDataCenter ( null ) ; return hostNIC ; }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.canRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { 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 ( ) { getCompensationContext ( ) . snapshotEntity ( getVmPool ( ) ) ; setPoolBeingDestroyed ( ) ; setPrestartedToZero ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; } } ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( ( ( ( stopVms ( ) ) && ( removeVmsInPool ( ) ) ) && ( removeVmPool ( ) ) ) ) ; }
Source:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }

Target:
public void testIscsiLunCanBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; org.mockito.Mockito.when ( diskLunMapDAO.getDiskIdByLunId ( disk.getLun ( ) . getLUN_id ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed for valid iscsi lun" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; }
Source:
public void testAddVMToAffinityGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( GUIDS [ 0 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( vm ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testAddVMToAffinityGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( GUIDS [ 0 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( vm ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
private void removeEntityLeftOver ( org.ovirt.engine.core.compat.Guid entityId , java.lang.String entityName , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.OvfEntityData ovfEntityData = getUnregisteredOVFDataDao ( ) . getByEntityIdAndStorageDomain ( entityId , storageDomainId ) ; if ( ovfEntityData != null ) { log.infoFormat ( "Entity {0} with id {1}, already exists as unregistered entity. override it with the new entity from the engine" , entityName , entityId ) ; getUnregisteredOVFDataDao ( ) . removeEntity ( entityId , storageDomainId ) ; } }

Target:
private void removeEntityLeftOver ( org.ovirt.engine.core.compat.Guid entityId , java.lang.String entityName , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.OvfEntityData ovfEntityData = getUnregisteredOVFDataDao ( ) . getByEntityIdAndStorageDomain ( entityId , storageDomainId ) ; if ( ovfEntityData != null ) { log.info ( "Entity '{}' with id '{}', already exists as unregistered entity. override it with the new entity from the engine" , entityName , entityId ) ; getUnregisteredOVFDataDao ( ) . removeEntity ( entityId , storageDomainId ) ; } }
Source:
private void ProposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.Count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }

Target:
private void ProposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderGeneralModel ( ) ) ; providerNetworkListModel = new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel ( ) ; list.add ( providerNetworkListModel ) ; setDetailModels ( list ) ; }
Source:
public void mockConfig ( ) { java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedClusters = new java.util.HashSet < > ( ) ; supportedClusters.add ( version ) ; org.mockito.Mockito.when ( host.getSupportedClusterVersionsSet ( ) ) . thenReturn ( supportedClusters ) ; org.mockito.Mockito.when ( host.getVdsGroupCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultRouteSupported , version , java.lang.Boolean.FALSE ) ; configRule.mockConfigValue ( ConfigValues.DefaultMtu , 1500 ) ; }

Target:
public void mockConfig ( ) { java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedClusters = new java.util.HashSet < > ( ) ; supportedClusters.add ( version ) ; org.mockito.Mockito.when ( host.getSupportedClusterVersionsSet ( ) ) . thenReturn ( supportedClusters ) ; org.mockito.Mockito.when ( host.getVdsGroupCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultRouteSupported , version , java.lang.Boolean.FALSE ) ; configRule.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; }
Source:
protected final void addCanDoActionMessages ( org.ovirt.engine.core.common.errors.EngineMessage ... messages ) { for ( org.ovirt.engine.core.common.errors.EngineMessage msg : messages ) { addCanDoActionMessage ( msg ) ; } }

Target:
protected boolean validate ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { if ( ! ( validationResult.isValid ( ) ) ) { addValidationMessage ( validationResult.getMessage ( ) ) ; for ( java.lang.String variableReplacement : validationResult.getVariableReplacements ( ) ) { addValidationMessage ( variableReplacement ) ; } } return validationResult.isValid ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . withParameter ( "force" , force ) . 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.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . withParameter ( "force" , force ) . 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.GlusterVolumeSnapshotCreateReturnForXmlRpc ( response ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetPermissionsOnBehalfByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetPermissionsOnBehalfByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; }