auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public static java.lang.String combine ( java.lang.String head , java.util.List < org.ovirt.engine.api.model.ParametersSet > params ) { java.lang.String combined_params = "" ; if ( params != null ) { for ( org.ovirt.engine.api.model.ParametersSet ps : params ) { for ( org.ovirt.engine.api.model.Parameter param : ps.getParameters ( ) ) { combined_params += java.lang.String.format ( org.ovirt.engine.api.common.util.LinkHelper.MATRIX_PARAMETER_TEMPLATE , param.getName ( ) , param.getValue ( ) ) ; } } } return head + combined_params ; }

Target:
public static java.lang.String combine ( java.lang.String head , java.util.List < org.ovirt.engine.api.model.ParametersSet > params ) { java.lang.StringBuilder combined_params = new java.lang.StringBuilder ( ) ; if ( params != null ) { for ( org.ovirt.engine.api.model.ParametersSet ps : params ) { for ( org.ovirt.engine.api.model.Parameter param : ps.getParameters ( ) ) { combined_params.append ( java.lang.String.format ( org.ovirt.engine.api.common.util.LinkHelper.MATRIX_PARAMETER_TEMPLATE , param.getName ( ) , param.getValue ( ) ) ) ; } } } combined_params.insert ( 0 , head ) ; return combined_params.toString ( ) ; }
Source:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangeable ( true ) ; getGlusterHostPassword ( ) . setIsChangeable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangeable ( false ) ; getGlusterHostPassword ( ) . setIsChangeable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.RemoveVdsCommand.getParameters ( ) . getVdsId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VDS , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > locks = new java.util.HashMap < > ( ) ; locks.put ( org.ovirt.engine.core.bll.RemoveVdsCommand.getParameters ( ) . getVdsId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VDS , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return locks ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Bookmark model , org.ovirt.engine.api.model.Bookmark transform ) { assertNotNull ( transform ) ; assertEquals ( model.getName ( ) , transform.getName ( ) ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getValue ( ) , transform.getValue ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Bookmark model , org.ovirt.engine.api.model.Bookmark transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getValue ( ) , transform.getValue ( ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSNiceType.class ) ; } else if ( "ARCHITECTURE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.VdsConditionFieldAutoCompleter.EXTERNAL_STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ExternalStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VDSNiceType.class ) ; } else if ( "ARCHITECTURE" . equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ; } return retval ; }
Source:
public void OnExport ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.compat.Guid storageDomainId = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( model.getStorage ( ) . getSelectedItem ( ) ) ) . getId ( ) ; if ( ! ( model.Validate ( ) ) ) { return ; } model.StartProgress ( null ) ; GetTemplatesNotPresentOnExportDomain ( ) ; }

Target:
public void onExport ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( getWindow ( ) ) ) ; if ( ! ( model.Validate ( ) ) ) { return ; } model.StartProgress ( null ) ; getTemplatesNotPresentOnExportDomain ( ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getAllForStoragePool ( pool ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : domains ) { if ( ( domain.getStorageDomainType ( ) ) == type ) { returnValue = domain.getId ( ) ; break ; } } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainIdForPoolByType ( org.ovirt.engine.core.compat.Guid pool , org.ovirt.engine.core.common.businessentities.StorageDomainType type ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = getStorageDomainByTypeAndPool ( pool , type ) ; if ( domain != null ) { returnValue = domain.getId ( ) ; } return returnValue ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.tags_vm_map tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDAO ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . gettag_id ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getvm_id ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.tags_vm_map tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . gettag_id ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getvm_id ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }
Source:
protected boolean validateName ( java.lang.String newVmName , org.ovirt.engine.ui.uicommonweb.models.EntityModel entity , org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] validators ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel temp = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; temp.setIsValid ( true ) ; temp.setEntity ( newVmName ) ; temp.ValidateEntity ( validators ) ; if ( ! ( temp.getIsValid ( ) ) ) { entity.setInvalidityReasons ( temp.getInvalidityReasons ( ) ) ; entity.setIsValid ( false ) ; } return temp.getIsValid ( ) ; }

Target:
protected boolean validateName ( java.lang.String newVmName , org.ovirt.engine.ui.uicommonweb.models.EntityModel entity , org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] validators ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel temp = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; temp.setIsValid ( true ) ; temp.setEntity ( newVmName ) ; temp.validateEntity ( validators ) ; if ( ! ( temp.getIsValid ( ) ) ) { entity.setInvalidityReasons ( temp.getInvalidityReasons ( ) ) ; entity.setIsValid ( false ) ; } return temp.getIsValid ( ) ; }
Source:
protected void handleVdsError ( org.ovirt.engine.core.common.AuditLogType errType , java.lang.String error ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . add ( error ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( error ) ; }

Target:
protected void handleVdsError ( org.ovirt.engine.core.common.AuditLogType errType , java.lang.String error ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . add ( error ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( error ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setError ( null ) ; }
Source:
public void getQosByVmId ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.qos.CpuQos > cpuQosMap = dao.getCpuQosByVmIds ( java.util.Collections.singleton ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.Assert.assertNotNull ( cpuQosMap ) ; org.junit.Assert.assertEquals ( FixturesTool.QOS_ID_4 , cpuQosMap.get ( FixturesTool.VM_RHEL5_POOL_50 ) . getId ( ) ) ; }

Target:
public void getQosByVmId ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.qos.CpuQos > cpuQosMap = dao.getCpuQosByVmIds ( java.util.Collections.singleton ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( cpuQosMap ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.QOS_ID_4 , cpuQosMap.get ( FixturesTool.VM_RHEL5_POOL_50 ) . getId ( ) ) ; }
Source:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
private void doTestGetNotFound ( java.lang.String id ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( id , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.NetworkComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( newItems ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > newItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( newItems , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setItems ( newItems ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getStoragePool ( ) . getId ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( cluster.getId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVdsGroupDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getStoragePool ( ) . getId ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( cluster.getId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void testSaveAndGetByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule schedule = dao.getByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotScheduleDaoTest.VOLUME_ID_2 ) ; org.junit.Assert.assertNull ( schedule ) ; newSchedule = insertSnapshotSchedule ( ) ; schedule = dao.getByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotScheduleDaoTest.VOLUME_ID_2 ) ; org.junit.Assert.assertNotNull ( schedule ) ; org.junit.Assert.assertEquals ( schedule , newSchedule ) ; }

Target:
public void testSaveAndGetByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule schedule = dao.getByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotScheduleDaoTest.VOLUME_ID_2 ) ; org.junit.jupiter.api.Assertions.assertNull ( schedule ) ; newSchedule = insertSnapshotSchedule ( ) ; schedule = dao.getByVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotScheduleDaoTest.VOLUME_ID_2 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( schedule ) ; org.junit.jupiter.api.Assertions.assertEquals ( schedule , newSchedule ) ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc vmUpdateDevice ( java.lang.String vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.vmUpdateDevice ( vmId , device.getInnerMap ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc glusterServicesList ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String [ ] serviceNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterServicesGet ( serviceNames ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesReturnForXmlRpc ( serverId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotDisabledNativePolicyUsb ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( false ) ; usb.setType ( "native" ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , null ) , UsbPolicy.DISABLED ) ; }

Target:
public void stringToCpuTune ( ) { org.ovirt.engine.api.model.CpuTune cpuTune = org.ovirt.engine.api.restapi.types.VmMapper.stringToCpuTune ( "0#0" ) ; assertNotNull ( cpuTune ) ; assertNotNull ( cpuTune.getVcpuPin ( ) ) ; assertEquals ( 1 , cpuTune.getVcpuPin ( ) . size ( ) ) ; assertEquals ( 0 , ( ( int ) ( cpuTune.getVcpuPin ( ) . get ( 0 ) . getVcpu ( ) ) ) ) ; assertEquals ( "0" , cpuTune.getVcpuPin ( ) . get ( 0 ) . getCpuSet ( ) ) ; }
Source:
protected void InitDetailModels ( ) { super . InitDetailModels ( ) ; org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportInterfaceListModel ( ) ) ; this . templateImportDiskListModel = new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateImportDiskListModel ( ) ; list.add ( templateImportDiskListModel ) ; setDetailModels ( list ) ; }

Target:
public void setEntity ( java.lang.Object value ) { super . setEntity ( ( value == null ? null : ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( value ) ) . getTemplate ( ) ) ) ; }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.LoginUserParameters > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to login: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute logoff: " + caught ) , caught ) ; getEventsHandler ( ) . runQueryFailed ( null ) ; failureEventHandler ( caught ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getAdGroupDao ( ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( LdapRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getAdGroupDao ( ) ; newAdGroup = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; newAdGroup.setid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newAdGroup.setdomain ( "domain" ) ; newAdGroup.setname ( "name" ) ; newAdGroup.setstatus ( LdapRefStatus.Active ) ; existingAdGroup = dao.get ( new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ) ; }
Source:
private void loadHosts ( ) { org.ovirt.engine.core.common.businessentities.Cluster selectedCluster = clusters.getSelectedItem ( ) ; if ( selectedCluster == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getUpHostListByCluster ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { postMigrateGetUpHosts ( privateVmList , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ) ; } } ) , selectedCluster.getName ( ) ) ; }

Target:
private void loadHosts ( ) { org.ovirt.engine.core.common.businessentities.Cluster selectedCluster = clusters.getSelectedItem ( ) ; if ( selectedCluster == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getUpHostListByCluster ( new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > returnValue ) { postMigrateGetUpHosts ( privateVmList , returnValue ) ; } } ) , selectedCluster.getName ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.gluster.DeleteGlusterVolumeCommand createTestCommand ( org.ovirt.engine.core.compat.Guid volumeId ) { return new org.ovirt.engine.core.bll.gluster.DeleteGlusterVolumeCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters ( volumeId ) ) ; }

Target:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.DeleteGlusterVolumeCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( null ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > asImages ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { if ( disks == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { res.add ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) ) ; } } return res ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > asImages ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks == null ) { return null ; } java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { res.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ) ; } } return res ; }
Source:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { processUnremovedDisks ( true ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { removeVmFromDb ( ) ; if ( getParameters ( ) . isRemoveDisks ( ) ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : diskImages ) { getCompensationContext ( ) . snapshotEntityStatus ( image.getImage ( ) , ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( image.getImage ( ) . getId ( ) , ImageStatus.LOCKED ) ; } getCompensationContext ( ) . stateChanged ( ) ; } 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 getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( GlusterConstants.VOLUME , getParameters ( ) . getVolume ( ) . getName ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; if ( ( volume ) != null ) { jobProperties.put ( GlusterConstants.VOLUME , volume.getName ( ) ) ; } } return jobProperties ; }
Source:
public void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; osRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( new org.ovirt.engine.api.restapi.resource.VmMapperMockConfigUtils ( ) ) ; }

Target:
public void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; osRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( new org.ovirt.engine.api.restapi.resource.VmMapperMockConfigUtils ( ) ) ; }
Source:
protected void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , canDo , success ) ) ; try { doAdd ( getRestModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , valid , success ) ) ; try { doAdd ( getRestModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void logout ( final java.lang.Object userObject , final org.ovirt.engine.ui.frontend.communication.UserCallback callback ) { getService ( ) . logOff ( ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( userObject ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; loginOperation.getCallback ( ) . onSuccess ( loginOperation , result ) ; }
Source:
public void getManagementNetworkName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ManagementNetwork , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > returnMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( returnMap.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) == null ) { throw new java.lang.RuntimeException ( "Engine did not provide icon IDs of default OS." ) ; } osIdToDefaultIconIdMap = java.util.Collections.unmodifiableMap ( returnMap ) ; initializeLargeToSmallIconMap ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsHostAvailable" . equals ( propName ) ) { hostTab.setVisible ( object.getIsHostAvailable ( ) ) ; } else if ( "IsHostTabValid" . equals ( propName ) ) { if ( object.getIsHostTabValid ( ) ) { hostTab.markAsValid ( ) ; } else { hostTab.markAsInvalid ( null ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsHostAvailable" . equals ( propName ) ) { setupHostTabAvailability ( object ) ; } else if ( "IsHostTabValid" . equals ( propName ) ) { if ( object.getIsHostTabValid ( ) ) { hostTab.markAsValid ( ) ; } else { hostTab.markAsInvalid ( null ) ; } } }
Source:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceType.DISK , VmDeviceType.DISK , null , true , false ) ; }

Target:
public static void addDiskToVm ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . save ( disk ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , true , false ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) ) ; } }
Source:
public void removeByNetworkId ( org.ovirt.engine.core.compat.Guid networkId ) { getCallsHandler ( ) . executeModification ( "RemoveNetworkAttachmentByNetworkId" , createIdParameterMapper ( networkId ) ) ; }

Target:
public void removeByNetworkId ( org.ovirt.engine.core.compat.Guid networkId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = getAllForNetwork ( networkId ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { hostNetworkQosDao.remove ( networkAttachment.getId ( ) ) ; } getCallsHandler ( ) . executeModification ( "RemoveNetworkAttachmentByNetworkId" , createIdParameterMapper ( networkId ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Bookmark model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ index ] , model.getValue ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Bookmark model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ index ] , model.getValue ( ) ) ; verifyLinks ( model ) ; }
Source:
public void passDiscardSupportedForDestSd ( ) { diskToDiskVmElements.put ( diskWithTwoVmElements , java.util.Arrays.asList ( diskVmElement2 , diskVmElement3 ) ) ; initMultipleDiskVmElementValidator ( ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement2 , ValidationResult.VALID ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement3 , ValidationResult.VALID ) ; org.junit.Assert.assertThat ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void passDiscardSupportedForDestSd ( ) { diskToDiskVmElements.put ( diskWithTwoVmElements , java.util.Arrays.asList ( diskVmElement2 , diskVmElement3 ) ) ; initMultipleDiskVmElementValidator ( ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement2 , ValidationResult.VALID ) ; mockDiskVmElementValidatorPassDiscardValidation ( diskWithTwoVmElements , diskVmElement3 , ValidationResult.VALID ) ; org.hamcrest.MatcherAssert.assertThat ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSd ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }