auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure , org.ovirt.engine.core.compat.Guid adElementId ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpPermissionsWithAdElementId ( adElementId ) , failure ) ; control.replay ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > lunList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( returnValue ) ) ; sanStorageModel.applyData ( lunList , true ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > lunList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( returnValue ) ) ; model.applyData ( lunList , true ) ; }
Source:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.scheduling.PolicyUnit , java.lang.Integer > ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }

Target:
public void addFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { usedFunctions.add ( new org.ovirt.engine.core.common.utils.Pair ( policyUnit , 1 ) ) ; for ( int i = 0 ; i < ( unusedFunctions.size ( ) ) ; i ++ ) { if ( unusedFunctions.get ( i ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { unusedFunctions.remove ( policyUnit ) ; break ; } } refreshCustomProperties ( null , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; }
Source:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeNewTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , boolean addLatest ) { if ( newItems.isEmpty ( ) ) { return null ; } if ( addLatest ) { return ( newItems.size ( ) ) >= 2 ? newItems.get ( 1 ) : newItems.get ( 0 ) ; } return newItems.get ( 0 ) ; }

Target:
protected static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeNewTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , boolean addLatest ) { if ( newItems.isEmpty ( ) ) { return null ; } if ( addLatest ) { return ( newItems.size ( ) ) >= 2 ? newItems.get ( 1 ) : newItems.get ( 0 ) ; } return newItems.get ( 0 ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_REMOVED ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RemoveGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getRoleDao ( ) ) ; existingRole = dao.get ( new org.ovirt.engine.core.compat.Guid ( "f5972bfa-7102-4d33-ad22-9dd421bfba78" ) ) ; newRole = new org.ovirt.engine.core.common.businessentities.Role ( ) ; newRole.setname ( "new role" ) ; newRole.setdescription ( "This is a new role." ) ; newRole.setType ( RoleType.USER ) ; newRole.setAllowsViewingChildren ( false ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getRoleDao ( ) ; existingRole = dao.get ( new org.ovirt.engine.core.compat.Guid ( "f5972bfa-7102-4d33-ad22-9dd421bfba78" ) ) ; newRole = new org.ovirt.engine.core.common.businessentities.Role ( ) ; newRole.setname ( "new role" ) ; newRole.setdescription ( "This is a new role." ) ; newRole.setType ( RoleType.USER ) ; newRole.setAllowsViewingChildren ( false ) ; }
Source:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , quotaId , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; }

Target:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; }
Source:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template , template.getStoragePoolId ( ) ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }

Target:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; if ( template == null ) { return ; } setupWindowModelFrom ( template ) ; updateHostPinning ( template.getMigrationSupport ( ) ) ; doChangeDefautlHost ( template.getDedicatedVmForVds ( ) ) ; }
Source:
public void clusterServiceDefined ( ) { org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.clusterServiceDefined ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void clusterServiceDefined ( ) { org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.clusterServiceDefined ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetGraphicsExpectations ( 0 ) ; super . testUpdate ( ) ; }
Source:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validate ( networkClusterValidator.defaultRouteNetworkCannotBeUnset ( ) ) ) ) && ( validate ( networkClusterValidator.glusterNetworkInUseAndUnset ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getCluster ( ) ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }

Target:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validate ( networkClusterValidator.glusterNetworkInUseAndUnset ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getCluster ( ) ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }
Source:
private static java.lang.String decrypt ( java.lang.String source , java.security.Key key ) throws java.io.UnsupportedEncodingException , java.security.InvalidKeyException , java.security.NoSuchAlgorithmException , javax.crypto.BadPaddingException , javax.crypto.IllegalBlockSizeException , javax.crypto.NoSuchPaddingException { java.lang.String result = "" ; byte [ ] cipherbytes = org.apache.commons.codec.binary.Base64.decodeBase64 ( source ) ; javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , key ) ; byte [ ] plainbytes = rsa.doFinal ( cipherbytes ) ; result = new java.lang.String ( plainbytes , "UTF-8" ) ; return result ; }

Target:
private static java.lang.String decrypt ( java.lang.String source , java.security.Key key ) throws java.io.UnsupportedEncodingException , java.security.InvalidKeyException , java.security.NoSuchAlgorithmException , javax.crypto.BadPaddingException , javax.crypto.IllegalBlockSizeException , javax.crypto.NoSuchPaddingException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , key ) ; return new java.lang.String ( rsa.doFinal ( org.apache.commons.codec.binary.Base64.decodeBase64 ( source ) ) , "UTF-8" ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StoragePool [ ] { dataCenter } ) ) ; initClusters ( dataCenters ) ; } else { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoUpDC ( ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( dataCenter != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StoragePool [ ] { dataCenter } ) ) ; initClusters ( dataCenters ) ; } else { getModel ( ) . disableEditing ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoUpDC ( ) ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid createVmDiskOnSd ( boolean wipeAfterDelete , boolean passDiscard ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; disk.setId ( diskId ) ; disk.setWipeAfterDelete ( wipeAfterDelete ) ; storageDomainDisks.add ( disk ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , passDiscard ) ) ; return diskId ; }

Target:
private void createVmDiskOnSd ( boolean wipeAfterDelete , boolean passDiscard ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; org.ovirt.engine.core.compat.Guid diskId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; disk.setId ( diskId ) ; disk.setWipeAfterDelete ( wipeAfterDelete ) ; storageDomainDisks.add ( disk ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , passDiscard ) ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( getEntity ( ) ) ) . getTemplate ( ) ; setItems ( template.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) ; setItems ( template.getInterfaces ( ) ) ; } else { setItems ( null ) ; } }
Source:
public void testValidateNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForMerge ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void testValidateNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public java.lang.String getVmPoolName ( ) { if ( ( ( mVmPoolName ) == null ) && ( ( mVmPool ) == null ) ) { mVmPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . get ( getVmPoolId ( ) ) ; if ( ( mVmPool ) != null ) { mVmPoolName = mVmPool.getVmPoolName ( ) ; } } return mVmPoolName ; }

Target:
public java.lang.String getVmPoolName ( ) { if ( ( ( mVmPoolName ) == null ) && ( ( mVmPool ) == null ) ) { mVmPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . get ( getVmPoolId ( ) ) ; if ( ( mVmPool ) != null ) { mVmPoolName = mVmPool.getName ( ) ; } } return mVmPoolName ; }
Source:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplateWithVersion ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getOSType ( ) . getSelectedItemChangedEvent ( ) . 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 ) { } } ) ; }

Target:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplateWithVersion ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; }
Source:
private void fillConnectionDetailsIfNeeded ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( connection.getId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection = org.ovirt.engine.core.bll.storage.connection.ISCSIStorageHelper.findConnectionWithSameDetails ( connection ) ; if ( dbConnection != null ) { connection.setId ( dbConnection.getId ( ) ) ; } } }

Target:
private void fillConnectionDetailsIfNeeded ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( connection.getId ( ) ) == null ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections dbConnection = findConnectionWithSameDetails ( connection ) ; if ( dbConnection != null ) { connection.setId ( dbConnection.getId ( ) ) ; } } }
Source:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.Erratum erratum ) { if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.BUGFIX ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.bug ( ) ; } else if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.ENHANCEMENT ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.enhancement ( ) ; } else if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.SECURITY ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.security ( ) ; } return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.unknown ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Erratum erratum ) { if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.BUGFIX ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.bug ( ) ; } else if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.ENHANCEMENT ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.enhancement ( ) ; } else if ( ( erratum.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Erratum.ErrataType.SECURITY ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.security ( ) ; } return org.ovirt.engine.ui.webadmin.section.main.view.popup.ErrataTableView.constants.unknown ( ) ; }
Source:
public boolean equals ( java.lang.Object o ) { return ( ( o != null ) && ( ( getClass ( ) ) == ( o.getClass ( ) ) ) ) && ( map.equals ( ( ( org.ovirt.engineextensions.aaa.ldap.MapProperties ) ( o ) ) . map ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { return ( ( ( o != null ) && ( ( getClass ( ) ) == ( o.getClass ( ) ) ) ) && ( map.equals ( ( ( org.ovirt.engineextensions.aaa.ldap.MapProperties ) ( o ) ) . map ) ) ) && ( ( value ) == null ? ( ( ( org.ovirt.engineextensions.aaa.ldap.MapProperties ) ( o ) ) . value ) == null : value.equals ( ( ( org.ovirt.engineextensions.aaa.ldap.MapProperties ) ( o ) ) . value ) ) ; }
Source:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source == null ) || ( ( java.lang.Boolean ) ( source ) ) ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean prepareStorageServer ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = org.ovirt.engine.core.bll.storage.connection.ISCSIStorageHelper.updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; return true ; }

Target:
private boolean prepareStorageServer ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > res = updateIfaces ( connections , parameters.getVds ( ) . getId ( ) ) ; connections.clear ( ) ; connections.addAll ( res ) ; return true ; }
Source:
public static org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > autoConvert ( long interval , java.util.concurrent.TimeUnit fromUnit ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > result = new org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > ( ) ; for ( java.util.concurrent.TimeUnit timeUnit : org.ovirt.engine.core.common.utils.TimeConverter.orderedTimeUnits ) { long tInterval = interval ; interval = org.ovirt.engine.core.common.utils.TimeConverter.convert ( interval , fromUnit , timeUnit ) ; if ( interval >= 1 ) { result.setFirst ( interval ) ; result.setSecond ( timeUnit ) ; break ; } interval = tInterval ; } return result ; }

Target:
public static org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > autoConvert ( long interval , java.util.concurrent.TimeUnit fromUnit ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Long , java.util.concurrent.TimeUnit > result = new org.ovirt.engine.core.common.utils.Pair ( ) ; for ( java.util.concurrent.TimeUnit timeUnit : org.ovirt.engine.core.common.utils.TimeConverter.orderedTimeUnits ) { long tInterval = interval ; interval = org.ovirt.engine.core.common.utils.TimeConverter.convert ( interval , fromUnit , timeUnit ) ; if ( interval >= 1 ) { result.setFirst ( interval ) ; result.setSecond ( timeUnit ) ; break ; } interval = tInterval ; } return result ; }
Source:
public static void UnLockVm ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vmId , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } else { org.ovirt.engine.core.bll.VmHandler.log.errorFormat ( "Trying to unlock vm {0} in status {1} - not moving to down!" , vm.getvm_name ( ) , vm.getstatus ( ) ) ; } }

Target:
public static void UnLockVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vm.getId ( ) , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } else { org.ovirt.engine.core.bll.VmHandler.log.errorFormat ( "Trying to unlock vm {0} in status {1} - not moving to down!" , vm.getvm_name ( ) , vm.getstatus ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { if ( returnValue != null ) { _defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { _defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = vmTemplateDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = vmTemplateDao.get ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( vmTemplate ) ; java.lang.String name = vmTemplate.getName ( ) ; org.junit.Assert.assertEquals ( name , underTest.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.EntityDaoImplTest.VM_TEMPLATE_ID , VdcObjectType.VmTemplate ) ) ; }
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.network.VdsNetworkInterface > siblingVlanInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; }

Target:
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.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; }
Source:
private static org.ovirt.engine.api.rsdl.ServiceTreeNode buildNode ( java.lang.Class < ? > resource , java.lang.String path , java.lang.String getterMethod ) { org.ovirt.engine.api.rsdl.ServiceTreeNode node = new org.ovirt.engine.api.rsdl.ServiceTreeNode.Builder ( ) . name ( resource.getSimpleName ( ) ) . path ( path ) . getter ( getterMethod ) . subCollections ( org.ovirt.engine.api.rsdl.ServiceTree.getSubServices ( resource ) ) . actions ( org.ovirt.engine.api.rsdl.ServiceTree.getActions ( resource ) ) . build ( ) ; if ( ! ( org.ovirt.engine.api.rsdl.ServiceTree.nodes.containsKey ( resource ) ) ) { org.ovirt.engine.api.rsdl.ServiceTree.nodes.put ( resource , node ) ; } return node ; }

Target:
private static org.ovirt.engine.api.rsdl.ServiceTreeNode buildNode ( java.lang.Class < ? > resource , java.lang.String path ) { org.ovirt.engine.api.rsdl.ServiceTreeNode node = new org.ovirt.engine.api.rsdl.ServiceTreeNode.Builder ( ) . name ( resource.getSimpleName ( ) ) . path ( path ) . subCollections ( org.ovirt.engine.api.rsdl.ServiceTree.getSubServices ( resource ) ) . actions ( org.ovirt.engine.api.rsdl.ServiceTree.getActions ( resource ) ) . build ( ) ; if ( ! ( org.ovirt.engine.api.rsdl.ServiceTree.nodes.containsKey ( resource ) ) ) { org.ovirt.engine.api.rsdl.ServiceTree.nodes.put ( resource , node ) ; } return node ; }
Source:
public void storagePoolName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.storage_pool p = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; p.setname ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStoragePool ( p ) ; final java.lang.String s = b.getStoragePoolName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }

Target:
public void storagePoolName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setname ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStoragePool ( p ) ; final java.lang.String s = b.getStoragePoolName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , s ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getFreeBonds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > freeBonds = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond : allBonds ) { if ( ! ( nicMap.containsKey ( bond.getName ( ) ) ) ) { freeBonds.add ( bond ) ; } } return freeBonds ; }

Target:
private java.util.List < java.lang.String > getFreeBonds ( ) { java.util.List < java.lang.String > freeBonds = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond : allBonds ) { if ( ! ( nicMap.containsKey ( bond.getName ( ) ) ) ) { freeBonds.add ( bond.getName ( ) ) ; } } return freeBonds ; }
Source:
private boolean runVm ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.utils.lock.EngineLock lock ) { boolean succeeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( lock ) ) . getSucceeded ( ) ; if ( ! succeeded ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_RESTART_FAILED ) ; } return succeeded ; }

Target:
private boolean runVm ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.utils.lock.EngineLock lock ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( lock ) ) . getSucceeded ( ) ; }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . 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 ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { super . onLogin ( loginModel ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . 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 ) { updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }
Source:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getstorage_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForStorageDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = dbFacade.getStorageDomainDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertNotNull ( storageDomain ) ; java.lang.String name = storageDomain.getstorage_name ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STORAGE_DOMAIN_ID , VdcObjectType.Storage ) ) ) ; }
Source:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void testGetAllStoragePoolSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Datacenter" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( storagePoolResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllStoragePoolSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Datacenter" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( storagePoolResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
private java.lang.Integer parseInt ( java.lang.Object entity ) { if ( entity instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( entity ) ) ; } if ( ( entity == null ) || ( ! ( entity instanceof java.lang.String ) ) ) { return null ; } java.lang.String text = ( ( java.lang.String ) ( entity ) ) ; try { return new java.lang.Integer ( text ) ; } catch ( java.lang.Exception e ) { return null ; } }

Target:
private java.lang.Integer parseInt ( java.lang.Object entity ) { if ( entity instanceof java.lang.Integer ) { return ( ( java.lang.Integer ) ( entity ) ) ; } if ( ! ( entity instanceof java.lang.String ) ) { return null ; } java.lang.String text = ( ( java.lang.String ) ( entity ) ) ; try { return new java.lang.Integer ( text ) ; } catch ( java.lang.Exception e ) { return null ; } }
Source:
public void setUp ( ) { mockVm ( ) ; org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( cmd.getVm ( ) ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotHavingDeviceSnapshotsAttachedToOtherVms ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( cmd ) . createVmValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; mockSnapshot ( SnapshotType.REGULAR ) ; spySdValidator ( ) ; }

Target:
public void setUp ( ) { mockVm ( ) ; org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( cmd.getVm ( ) ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotHavingDeviceSnapshotsAttachedToOtherVms ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( cmd ) . createVmValidator ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; mockSnapshot ( SnapshotType.REGULAR ) ; spySdValidator ( ) ; }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }
Source:
protected javax.ws.rs.core.UriInfo setUpTryBackExpectations ( ) { return setUpActionExpectations ( VdcActionType.TryBackToAllSnapshotsOfVm , org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters.class , new java.lang.String [ ] { "VmId" , "DstSnapshotId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID } , true , true , null , null , null , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.JOB_ID , JobExecutionStatus.FINISHED , ( ( org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.BASE_HREF ) + "/action" ) , false ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpTryBackExpectations ( ) { return setUpActionExpectations ( VdcActionType.TryBackToAllSnapshotsOfVm , org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters.class , new java.lang.String [ ] { "VmId" , "DstSnapshotId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID } , true , true , null ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver ( ) { public org.ovirt.engine.api.model.Disk lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return collection.lookupEntity ( guid ) ; } } ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.api.model.Disk > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.api.model.Disk lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return collection.lookupEntity ( guid ) ; } } ; org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.DiskStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.api.model.Disk > ( entityType , guid , query ) ) ; }