auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateActionsPanels ( org.ovirt.engine.ui.uicommonweb.models.GuideModel < ? > object ) { compulsoryActionsPanel.clear ( ) ; optionalActionsPanel.clear ( ) ; for ( final org.ovirt.engine.ui.uicommonweb.UICommand command : object.getCompulsoryActions ( ) ) { addButton ( command , compulsoryActionsPanel , org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.resources.wrenchImage ( ) ) ; } for ( final org.ovirt.engine.ui.uicommonweb.UICommand command : object.getOptionalActions ( ) ) { addButton ( command , optionalActionsPanel , org.ovirt.engine.ui.webadmin.section.main.view.popup.guide.GuidePopupView.resources.plusButtonImage ( ) ) ; } }

Target:
private void updateActionsPanels ( org.ovirt.engine.ui.uicommonweb.models.GuideModel < ? > object ) { compulsoryActionsPanel.clear ( ) ; optionalActionsPanel.clear ( ) ; for ( final org.ovirt.engine.ui.uicommonweb.UICommand command : object.getCompulsoryActions ( ) ) { addButton ( command , compulsoryActionsPanel , IconType.WRENCH ) ; } for ( final org.ovirt.engine.ui.uicommonweb.UICommand command : object.getOptionalActions ( ) ) { addButton ( command , optionalActionsPanel , IconType.PLUS ) ; } }
Source:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . getVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; long sleepInterval = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }

Target:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . getVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; long sleepInterval = java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.model.ExternalVmImport vmImport ) { if ( vmImport.getStorageDomain ( ) . isSetId ( ) ) { return asGuid ( vmImport.getStorageDomain ( ) . getId ( ) ) ; } else { java.lang.String storageDomainName = vmImport.getStorageDomain ( ) . getName ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain = getEntity ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic.class , VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , storageDomainName , true ) ; return storageDomain.getId ( ) ; } }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.model.ExternalVmImport vmImport ) { if ( vmImport.getStorageDomain ( ) . isSetId ( ) ) { return asGuid ( vmImport.getStorageDomain ( ) . getId ( ) ) ; } else { java.lang.String storageDomainName = vmImport.getStorageDomain ( ) . getName ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain = getEntity ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic.class , QueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , storageDomainName , true ) ; return storageDomain.getId ( ) ; } }
Source:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }

Target:
protected void setDefaultMigrationPolicy ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) ) != null ) { boolean isMigrationSupported = org.ovirt.engine.core.common.FeatureSupported.isMigrationSupported ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getArchitecture ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.common.businessentities.MigrationSupport migrationSupport = ( isMigrationSupported ) ? org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE : org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ; org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . setMigrationSupport ( migrationSupport ) ; } }
Source:
public void onSuccessDontTryNextAgent ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent2 ) ) ) . thenThrow ( new java.lang.IllegalStateException ( ) ) ; command.executeCommand ( ) ; }

Target:
private void mockVdsDynamicDao ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic currentVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; currentVds.setId ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ; currentVds.setStatus ( VDSStatus.NonResponsive ) ; org.mockito.Mockito.when ( vdsDynamicDAO.get ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ) . thenReturn ( currentVds ) ; org.mockito.Mockito.when ( dbFacade.getVdsDynamicDao ( ) ) . thenReturn ( vdsDynamicDAO ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void GetAllProviders ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
protected void startPollingAsyncTasks ( java.util.Collection < org.ovirt.engine.core.compat.Guid > taskIds ) { for ( org.ovirt.engine.core.compat.Guid taskID : taskIds ) { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . StartPollingTask ( taskID ) ; } }

Target:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parametersForTask = getParametersForTask ( parentCommand , getParameters ( ) ) ; org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , parametersForTask , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) ) ) ; p.setEntityId ( getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( getTaskType ( ) , p ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.network.Network result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( result.getId ( ) ) ; result = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME2 ) ; org.junit.Assert.assertNull ( result ) ; }
Source:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check job with step and no async task are not deleted" , ( ( dao.get ( new org.ovirt.engine.core.compat.Guid ( "54947df8-0e9e-4471-a2f9-9af509fb0002" ) ) ) != null ) ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }

Target:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertNotNull ( "Check job with step and no async task are not deleted" , dao.get ( new org.ovirt.engine.core.compat.Guid ( "54947df8-0e9e-4471-a2f9-9af509fb0002" ) ) ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }
Source:
public static java.lang.Object load ( java.io.File f ) { try ( java.io.ObjectInputStream ois = new java.io.ObjectInputStream ( new java.io.FileInputStream ( f ) ) ) { final org.ovirt.vdsmfake.domain.BaseObject baseObject = ( ( org.ovirt.vdsmfake.domain.BaseObject ) ( ois.readObject ( ) ) ) ; baseObject.setLastUpdate ( f.lastModified ( ) ) ; return baseObject ; } catch ( java.lang.Exception e ) { org.ovirt.vdsmfake.PersistUtils.log.error ( "Cannot save object" , e ) ; throw new java.lang.RuntimeException ( "Cannot load object" , e ) ; } }

Target:
public java.lang.Object load ( java.lang.Class < ? > clazz , java.lang.String id ) { return cache.get ( ( ( clazz.getSimpleName ( ) ) + id ) ) ; }
Source:
public void testVmsRuleNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; assertEquals ( false , entity.isVmEnforcing ( ) ) ; assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }

Target:
public void testVmsRuleNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; model.setEnforcing ( false ) ; model.setPositive ( true ) ; org.ovirt.engine.api.model.AffinityGroup entity = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.restapi.types.AffinityGroupMapper.map ( model , entity ) ; org.junit.Assert.assertEquals ( EntityAffinityRule.POSITIVE , entity.getVmAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( false , entity.isVmEnforcing ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVmAffinityEnabled ( ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.INSERT ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.put ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.INSERT ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , host.getName ( ) ) . getId ( ) ; }

Target:
public org.ovirt.engine.core.compat.Guid getDataCenterId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > storagepools = org.ovirt.engine.api.restapi.resource.BackendDataCenterResource.getStoragePools ( storageDomainId , this ) ; return ( storagepools.size ( ) ) > 0 ? storagepools.get ( 0 ) . getId ( ) : null ; }
Source:
public void testGetTagVmMapByByVmIdAndDefaultTag ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > result = dao.getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map mapping : result ) { assertEquals ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID , mapping.getvm_id ( ) ) ; } }

Target:
public void testGetTagVmMapByByVmIdAndDefaultTag ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > result = dao.getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap mapping : result ) { assertEquals ( org.ovirt.engine.core.dao.TagDAOTest.EXISTING_VM_ID , mapping.getvm_id ( ) ) ; } }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . connectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getBroker ( ) . connectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; proceedProxyReturnValue ( ) ; }
Source:
private void mtuValidTest ( org.ovirt.engine.core.bll.ValidationResult expected , int mtu , boolean featureSupported ) { mockConfigRule.mockConfigValue ( ConfigValues.MTUOverrideSupported , dataCenter.getcompatibility_version ( ) , featureSupported ) ; org.mockito.Mockito.when ( network.getMtu ( ) ) . thenReturn ( mtu ) ; org.junit.Assert.assertEquals ( expected , validator.mtuValid ( ) ) ; }

Target:
private void mtuValidTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , int mtu , boolean featureSupported ) { mockConfigRule.mockConfigValue ( ConfigValues.MTUOverrideSupported , dataCenter.getcompatibility_version ( ) , featureSupported ) ; org.mockito.Mockito.when ( network.getMtu ( ) ) . thenReturn ( mtu ) ; org.junit.Assert.assertThat ( validator.mtuValid ( ) , matcher ) ; }
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.roles ( ) ; 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 = 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 ) ; }
Source:
private static java.util.concurrent.locks.Lock getSyncObject ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExt ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.FileTypeExtension > domainPerFileType = new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.FileTypeExtension > ( domainId , fileTypeExt ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.putIfAbsent ( domainPerFileType , new java.util.concurrent.locks.ReentrantLock ( ) ) ; return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.get ( domainPerFileType ) ; }

Target:
private static java.util.concurrent.locks.Lock getSyncObject ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.common.businessentities.ImageType imageType ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.ImageType > domainPerFileType = new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.ImageType > ( domainId , imageType ) ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.putIfAbsent ( domainPerFileType , new java.util.concurrent.locks.ReentrantLock ( ) ) ; return org.ovirt.engine.core.bll.IsoDomainListSyncronizer.syncDomainForFileTypeMap.get ( domainPerFileType ) ; }
Source:
protected org.ovirt.engine.api.model.VM setVmOvfConfiguration ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.Vm setVmOvfConfiguration ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; if ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.stopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.stopProgress ( ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getTenantName ( ) ) == null ? 0 : getTenantName ( ) . hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.TenantProviderProperties ) ) { return false ; } org.ovirt.engine.core.common.businessentities.TenantProviderProperties other = ( ( org.ovirt.engine.core.common.businessentities.TenantProviderProperties ) ( obj ) ) ; return java.util.Objects.equals ( tenantName , other.tenantName ) ; }
Source:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( "VdcUser" ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , "VdcUser" ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testRefreshUserSessionAfterExpiration ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; org.junit.Assert.assertNull ( "Get should return null since the session wasn't refresh" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }
Source:
public void getNumberOfActiveVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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 java.lang.Integer.valueOf ( 0 ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfActiveVmsInClusterByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , 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:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDao ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getVmToHostAssignments ( ) { java.util.Map < java.lang.String , java.lang.String > s = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; s.put ( "vm1" , "host1" ) ; s.put ( "vm2" , "host2" ) ; s.put ( "vm3" , "host1" ) ; s.put ( "vm4" , "host2" ) ; return s ; }

Target:
public java.util.Map < java.lang.Long , java.lang.String > getInstanceToHostAssignments ( ) { java.util.Map < java.lang.Long , java.lang.String > s = new java.util.HashMap < java.lang.Long , java.lang.String > ( ) ; s.put ( 1L , "host1" ) ; s.put ( 2L , "host2" ) ; s.put ( 3L , "host1" ) ; s.put ( 4L , "host2" ) ; return s ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callBack = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , null ) ; updateCommand ( command , result ) ; if ( callBack != null ) { callBack.executed ( result ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callback = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , null ) ; updateCommand ( command , result ) ; if ( callback != null ) { callback.executed ( result ) ; } return result ; }
Source:
public void testMigrateWithHostId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVM" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithHostId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVmToServer , org.ovirt.engine.core.common.action.MigrateVmToServerParameters.class , new java.lang.String [ ] { "VmId" , "VdsId" , "ForceMigrationForNonMigratableVm" } , new java.lang.Object [ ] { GUIDS [ 0 ] , GUIDS [ 1 ] , java.lang.Boolean.FALSE } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; action.getHost ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "{ fencingEnabled=" ) ; sb.append ( fencingEnabled ) ; sb.append ( ", skipFencingIfSDActive=" ) ; sb.append ( skipFencingIfSDActive ) ; sb.append ( ", skipFencingIfConnectivityBroken=" ) ; sb.append ( skipFencingIfConnectivityBroken ) ; sb.append ( ", hostsWithBrokenConnectivityThreshold=" ) ; sb.append ( hostsWithBrokenConnectivityThreshold ) ; sb.append ( " }" ) ; return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { return org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( this ) . append ( "fencingEnabled" , fencingEnabled ) . append ( "skipFencingIfSDActive" , skipFencingIfSDActive ) . append ( "skipFencingIfConnectivityBroken" , skipFencingIfConnectivityBroken ) . append ( "hostsWithBrokenConnectivityThreshold" , hostsWithBrokenConnectivityThreshold ) . build ( ) ; }
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 ( ev.matchesDefinition ( EntityModel.entityChangedEventDefinition ) ) { if ( sender == ( getOverrideSerialNumberPolicy ( ) ) ) { overrideSerialNumberPolicyChanged ( ) ; } else if ( sender == ( getSerialNumberPolicy ( ) ) ) { serialNumberPolicyChanged ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ev.matchesDefinition ( HasEntity.entityChangedEventDefinition ) ) { if ( sender == ( getOverrideSerialNumberPolicy ( ) ) ) { overrideSerialNumberPolicyChanged ( ) ; } else if ( sender == ( getSerialNumberPolicy ( ) ) ) { serialNumberPolicyChanged ( ) ; } } }
Source:
public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.Quota quota ) { return quota.getQuotaName ( ) ; }

Target:
void initEditors ( ) { volumeTypeListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.storage.VolumeType > ( ) ) ; storageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; volumeFormatListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.storage.VolumeFormat > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.storage.VolumeFormat > ( ) ) ; sourceStorageListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; diskProfileListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.profiles.DiskProfile > ( ) ) ; quotaListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Quota > ( ) ) ; }
Source:
public static void verifyIconModel ( org.ovirt.engine.api.model.Icon model , int index ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getFirst ( ) , model.getMediaType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getSecond ( ) , model.getData ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; }

Target:
public static void verifyIconModel ( org.ovirt.engine.api.model.Icon model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getFirst ( ) , model.getMediaType ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.common.businessentities.VmIcon.dataUrlToTypeAndData ( org.ovirt.engine.api.restapi.resource.BackendIconsResourceTest.DATA_URLS [ index ] ) . getSecond ( ) , model.getData ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { 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.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getExecutionContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "CreateAllSnapshotsFromVmCommand::executeVmCommand: Failed to create snapshot!" ) ; } } }

Target:
protected void buildChildCommandInfos ( ) { org.ovirt.engine.core.compat.Guid vmSnapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { addChildCommandInfo ( image.getImageId ( ) , VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) ) ; } }
Source:
public void getClusterWithVds ( ) { final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }

Target:
public void getClusterWithVds ( ) { final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public boolean IsMacInUse ( java.lang.String mac ) { synchronized ( mLocObj ) { return ( mAllocatedMacs.contains ( mac ) ) || ( mAllocatedCustomMacs.contains ( mac ) ) ; } }

Target:
public boolean IsMacInUse ( java.lang.String mac ) { mLocObj.readLock ( ) . lock ( ) ; try { return ( mAllocatedMacs.contains ( mac ) ) || ( mAllocatedCustomMacs.contains ( mac ) ) ; } finally { mLocObj.readLock ( ) . unlock ( ) ; } }
Source:
public void onFailureTryNextAgent ( ) { mockExecutor ( agent1 , false ) ; mockExecutor ( agent2 , true ) ; mockCheckStatus ( "on" ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; }

Target:
private void mockExecutor ( boolean success ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result ; if ( success ) { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.ON ) ; } else { result = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR , org.ovirt.engine.core.common.businessentities.pm.PowerStatus.UNKNOWN ) ; } org.mockito.Mockito.doReturn ( result ) . when ( executor ) . fence ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.class ) ) ; }
Source:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; discoveryThread.start ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; if ( org.ovirt.engine.core.common.config.Config.GetValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; discoveryThread.start ( ) ; } else { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }