auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < org.ovirt.engine.core.common.utils.ExternalId > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > users = new java.util.ArrayList ( ids.size ( ) ) ; for ( org.ovirt.engine.core.common.utils.ExternalId id : ids ) { org.ovirt.engine.core.aaa.DirectoryUser user = findUser ( id ) ; if ( user != null ) { users.add ( user ) ; } } return users ; }

Target:
public java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findUsers ( java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > users = new java.util.ArrayList < > ( ids.size ( ) ) ; for ( java.lang.String id : ids ) { org.ovirt.engine.core.aaa.DirectoryUser user = findUserById ( id ) ; if ( user != null ) { users.add ( user ) ; } } return users ; }
Source:
public java.lang.String getFloppyImagePath ( ) { if ( ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ) { return getReinitialize ( ) ? "" : ( ( java.lang.String ) ( getFloppyImage ( ) . getSelectedItem ( ) ) ) ; } else { return "" ; } }

Target:
public java.lang.String getFloppyImagePath ( ) { if ( ( ( java.lang.Boolean ) ( getAttachFloppy ( ) . getEntity ( ) ) ) ) { return ( getInitializationType ( ) ) == ( org.ovirt.engine.core.common.businessentities.InitializationType.Sysprep ) ? "" : ( ( java.lang.String ) ( getFloppyImage ( ) . getSelectedItem ( ) ) ) ; } else { return "" ; } }
Source:
private void setupClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > expectedNetworkCluster = java.util.Collections.singletonList ( networkCluster ) ; org.ovirt.engine.core.dao.network.NetworkClusterDao networkClusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.NetworkClusterDao.class ) ; org.mockito.Mockito.when ( networkClusterDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedNetworkCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getNetworkClusterDao ( ) ) . thenReturn ( networkClusterDaoMock ) ; }

Target:
private void setupNetworkClusterDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > expectedCluster = java.util.Collections.singletonList ( cluster ) ; org.mockito.Mockito.when ( clusterDaoMock.getAllForStoragePool ( storagePoolId ) ) . thenReturn ( expectedCluster ) ; }
Source:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }

Target:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.job.ExecutionMessageDirector.auditLogDirector.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { providerModel = model ; setAgentTabVisibility ( model.getNeutronAgentModel ( ) . isPluginConfigurationAvailable ( ) . getEntity ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; vmwarePropertiesWidget.edit ( model.getVmwarePropertiesModel ( ) ) ; kvmPropertiesWidget.edit ( model.getKvmPropertiesModel ( ) ) ; xenPropertiesWidget.edit ( model.getXenPropertiesModel ( ) ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel model ) { providerModel = model ; setAgentTabVisibility ( model.getNeutronAgentModel ( ) . isPluginConfigurationAvailable ( ) . getEntity ( ) ) ; driver.edit ( model ) ; neutronAgentWidget.edit ( model.getNeutronAgentModel ( ) ) ; vmwarePropertiesWidget.edit ( model.getVmwarePropertiesModel ( ) ) ; kvmPropertiesWidget.edit ( model.getKvmPropertiesModel ( ) ) ; xenPropertiesWidget.edit ( model.getXenPropertiesModel ( ) ) ; if ( model.isEditProviderMode ( ) ) { setCurrentActiveProviderWidget ( ) ; } }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void testAllDomainsHaveSpaceForAllDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.Matchers.eq ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.DiskImage > emptyList ( ) ) , org.mockito.Matchers.anyList ( ) ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runInternalMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters ) { return runMultipleActionsImpl ( actionType , parameters , true , false , false , null ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > runMultipleActions ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.List < org.ovirt.engine.core.common.action.ActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private boolean canDoSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ! ( isLiveSnapshotEnabled ( ) ) ) && ( ! ( vm.isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ; if ( ( vds != null ) && ( ! ( vds.getLiveSnapshotSupport ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_QEMU_UNSUPPORTED_OPERATION ) ; } return true ; }

Target:
private boolean isSpecifiedDisksExist ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { if ( ( disks == null ) || ( disks.isEmpty ( ) ) ) { return true ; } org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = createDiskImageValidator ( disks ) ; if ( ! ( validate ( diskImagesValidator.diskImagesNotExist ( ) ) ) ) { return false ; } return true ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { passwordEditor.setLabel ( constants.hostInstallPasswordLabel ( ) ) ; hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { hostVersionEditor.setLabel ( constants.hostInstallHostVersionLabel ( ) ) ; isoEditor.setLabel ( constants.hostInstallIsoLabel ( ) ) ; overrideIpTablesEditor.setLabel ( constants.hostInstallOverrideIpTablesLabel ( ) ) ; authLabel.setText ( constants.hostPopupAuthLabel ( ) ) ; userNameEditor.setLabel ( constants.hostPopupUsernameLabel ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; return performCreation ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; validateEnums ( org.ovirt.engine.api.model.Role.class , role ) ; return performCreation ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class ) ) ; }
Source:
public void canDoActionCanNotFindTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST.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 testGetEntityNameByIdAndTypeForVmInterface ( ) { org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface = dbFacade.getVmNetworkInterfaceDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_INTERFACE_ID ) ; org.junit.Assert.assertNotNull ( vmInterface ) ; java.lang.String name = vmInterface.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.VM_INTERFACE_ID , VdcObjectType.VmInterface ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOperationAllowedOnDisk ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskContentType > allowedTypes = org.ovirt.engine.core.bll.validator.storage.DiskOperationsValidator.allowedCommandsOnTypes.get ( actionType ) ; if ( allowedTypes == null ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannot validate operation on disk for action of type %s as it is not an allowed command for the disk content type." , actionType ) ) ; } if ( ! ( allowedTypes.contains ( disk.getContentType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION , java.lang.String.format ( "$diskContentType %s" , disk.getContentType ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isOperationAllowedOnDisk ( org.ovirt.engine.core.common.action.ActionType actionType ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskContentType > allowedTypes = org.ovirt.engine.core.bll.validator.storage.DiskOperationsValidator.allowedCommandsOnTypes.get ( actionType ) ; if ( allowedTypes == null ) { throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "Cannot validate operation on disk for action of type %s as it is not an allowed command for the disk content type." , actionType ) ) ; } if ( ! ( allowedTypes.contains ( disk.getContentType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_CONTENT_TYPE_NOT_SUPPORTED_FOR_OPERATION , java.lang.String.format ( "$diskContentType %s" , disk.getContentType ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void rollbackQuotaByVmId ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }

Target:
public void rollbackQuotaByVmId ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { removeQuotaFromCache ( vm.getStoragePoolId ( ) , vm.getQuotaId ( ) ) ; } }
Source:
protected void ExecuteVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getstatus ( ) ) != ( VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.LockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }

Target:
protected void ExecuteVmCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.VmHandler.LockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) . getDynamicData ( ) , org.ovirt.engine.core.bll.RemoveVmCommand.getCompensationContext ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( removeVm ( ) ) ; }
Source:
public static void getRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.api.restapi.resource.BackendVmNicsResource parent = ( ( org.ovirt.engine.api.restapi.resource.BackendVmNicsResource ) ( collection ) ) ; parent.addStatistics ( model , entity ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.Nic deprecatedPopulate ( org.ovirt.engine.api.model.Nic model , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; org.ovirt.engine.api.restapi.resource.BackendNicHelper.addReportedDevices ( this , model , entity ) ; if ( details.contains ( "statistics" ) ) { org.ovirt.engine.api.restapi.resource.BackendNicHelper.addStatistics ( this , model , entity ) ; } return model ; }
Source:
public void resetStatusUpdateTime ( org.ovirt.engine.core.compat.Guid id ) { this . vmStatusUpdated.remove ( id ) ; }

Target:
public void vmsMonitoring ( ) { if ( isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( this ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector ) . perform ( ) ; } }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.HashMap map = ( ( java.util.HashMap ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; searchableListModel.setItems ( ( ( java.lang.Iterable ) ( map.get ( true ) ) ) ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > map = ( ( java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; templates.add ( map.get ( true ) ) ; searchableListModel.setItems ( templates ) ; }
Source:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( ) { java.util.Collection < java.lang.String > removedNetworks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( removedAttachment ) . getName ( ) ) ; } java.util.List < java.lang.String > vmNames = getVmInterfaceManager ( ) . findActiveVmsUsingNetworks ( host.getId ( ) , removedNetworks ) ; if ( vmNames.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_CANNOT_DETACH_NETWORK_USED_BY_VMS , commaSeparated ( vmNames ) ) ; } }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterVolumeStatus restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterVolume restVolume = org.ovirt.engine.api.restapi.types.GlusterVolumeMapper.map ( volume , null ) ; assertEquals ( restVolume.getStatus ( ) , restStatus ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus backendStatus , org.ovirt.engine.api.model.GlusterVolumeStatus restStatus ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ( ) ; volume.setStatus ( backendStatus ) ; org.ovirt.engine.api.model.GlusterVolume restVolume = org.ovirt.engine.api.restapi.types.GlusterVolumeMapper.map ( volume , null ) ; org.junit.Assert.assertEquals ( restVolume.getStatus ( ) , restStatus ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) != null ? org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) != null ? org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingMigratedMessage ( ) ) ) ; }
Source:
public void testFetchGlobalQuotaUsageForGlobalVdsGroup ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaVdsGroup > quotaVdsGroupList = dao.getQuotaVdsGroupByVdsGroupGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup = quotaVdsGroupList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroupList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertNotNull ( quotaVdsGroup ) ; org.junit.Assert.assertEquals ( true , ( ( quotaVdsGroup.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( 100 ) , quotaVdsGroup.getVirtualCpu ( ) ) ; }

Target:
public void testFetchGlobalQuotaUsageForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster = quotaClusterList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaClusterList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertNotNull ( quotaCluster ) ; org.junit.Assert.assertEquals ( true , ( ( quotaCluster.getMemSizeMBUsage ( ) ) > 0 ) ) ; org.junit.Assert.assertEquals ( java.lang.Integer.valueOf ( 100 ) , quotaCluster.getVirtualCpu ( ) ) ; }
Source:
public void testIsCrossReference ( ) { org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReferece ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReferece ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReferece ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReferece ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReferece ( null , "TEMPLATES" ) ) ; }

Target:
public void testIsCrossReference ( ) { org.junit.Assert.assertTrue ( "EVENTS" , comp.isCrossReference ( "EVENTS" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Cross" , comp.isCrossReference ( "fsfsdf" , "TEMPLATES" ) ) ; org.junit.Assert.assertFalse ( "Garbage Object" , comp.isCrossReference ( "EVENTS" , "fsfds" ) ) ; org.junit.Assert.assertFalse ( "Null Object" , comp.isCrossReference ( "EVENTS" , null ) ) ; org.junit.Assert.assertFalse ( "Null text" , comp.isCrossReference ( null , "TEMPLATES" ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult isVmInterfacesConfigured ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : vm.getInterfaces ( ) ) { if ( ( nic.getVnicProfileId ( ) ) == null ) { return ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( vm.getVdsGroupCompatibilityVersion ( ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateInterfacesConfigured ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : vm.getInterfaces ( ) ) { if ( ( nic.getVnicProfileId ( ) ) == null ) { return org.ovirt.engine.core.common.FeatureSupported.networkLinking ( vm.getVdsGroupCompatibilityVersion ( ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testNotEnoughForMultipleDiskAndDomainsFirstDomainFails ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; imagesDisks.addAll ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 15 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID2 ) ; org.junit.Assert.assertFalse ( "Validation should fail. First domain should not have enough free space for request." , cmd.validateStorageDomains ( ) ) ; }

Target:
public void testCanDoActionNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = mockDisksList ( 4 ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( imagesDisks ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
private void failureEventHandler ( final java.lang.String description , final java.lang.String errorMessage ) { handleNotLoggedInEvent ( errorMessage ) ; frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ) ; }

Target:
private void failureEventHandler ( final java.lang.String description , final java.util.List < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { handleNotLoggedInEvent ( errorMessage ) ; messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
public void testGetAllForVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForVdsGroup ( existingVds.getvds_group_id ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { assertEquals ( existingVds.getvds_group_id ( ) , vds.getvds_group_id ( ) ) ; } }

Target:
public void testGetAllForVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsStatic > result = dao.getAllForVdsGroup ( existingVds.getvds_group_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsStatic vds : result ) { org.junit.Assert.assertEquals ( existingVds.getvds_group_id ( ) , vds.getvds_group_id ( ) ) ; } }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { return getStorageDomainValidator ( entry ) . isDomainWithinThresholds ( ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsHaveSpaceForNewDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksImages ) { final java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > disksMap = getDomainsDisksMap ( disksImages ) ; return validOrFirstFailure ( ( entry ) -> { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForNewDisks ( disksList ) ; } ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfile ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { if ( ( vnicProfile == null ) || ( ( vnicProfile.getNetworkId ( ) ) == null ) ) { return null ; } return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfile ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { if ( ( vnicProfile == null ) || ( ( vnicProfile.getNetworkId ( ) ) == null ) ) { return null ; } return networkDao.get ( vnicProfile.getNetworkId ( ) ) ; }
Source:
public static boolean isNonVmNonVlanNetwork ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return ( ! ( network.isVmNetwork ( ) ) ) && ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( network ) ) ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.IpV6Address createIpv6FromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { final org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = new org.ovirt.engine.core.common.businessentities.network.IpV6Address ( ) ; final org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol ipv6BootProtocol = nic.getIpv6BootProtocol ( ) ; ipv6Address.setBootProtocol ( ipv6BootProtocol ) ; if ( ipv6BootProtocol == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { ipv6Address.setAddress ( nic.getIpv6Address ( ) ) ; ipv6Address.setPrefix ( nic.getIpv6Prefix ( ) ) ; ipv6Address.setGateway ( nic.getIpv6Gateway ( ) ) ; } return ipv6Address ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
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 getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public void setSelection ( java.lang.Boolean value ) { if ( ( ( selection ) == null ) && ( value == null ) ) { return ; } if ( ( ( selection ) == null ) || ( ! ( selection.equals ( value ) ) ) ) { selection = value ; getSelectionChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Selection" ) ) ; } }

Target:
public void setSelection ( java.lang.Boolean value ) { if ( ( ( selection ) == null ) && ( value == null ) ) { return ; } if ( ( ( selection ) == null ) || ( ! ( selection.equals ( value ) ) ) ) { selection = value ; getSelectionChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Selection" ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel templateListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } templateListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
protected java.lang.Iterable < org.ovirt.engine.core.common.businessentities.VmTemplate > asIterableReturnValue ( java.lang.Object returnValue ) { return ( ( java.util.Map < org.ovirt.engine.core.common.businessentities.VmTemplate , ? > ) ( returnValue ) ) . keySet ( ) ; }
Source:
public void testAddLunDisk ( ) { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; model.setName ( NAMES [ 0 ] ) ; model.setLunStorage ( new org.ovirt.engine.api.model.Storage ( ) ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . add ( new org.ovirt.engine.api.model.LogicalUnit ( ) ) ; model.setSize ( null ) ; model.setProvisionedSize ( null ) ; testAddDiskImpl ( model ) ; }

Target:
public void testAddIscsiLunDisk_IncompleteParameters_ConnectionPort ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . get ( 0 ) . setPort ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "validateDiskForCreation" , "port" ) ; } }
Source:
public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { getView ( ) . setRefreshButtonVisibility ( ( ! ( getModelProvider ( ) . getModel ( ) . getTimer ( ) . isActive ( ) ) ) ) ; }

Target:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getEventBus ( ) . addHandler ( org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent.getType ( ) , new org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent.ManualRefreshHandler ( ) { @ java.lang.Override public void onManualRefresh ( org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent event ) { if ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostInterfacePresenter.this . isVisible ( ) ) && ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostInterfacePresenter.this . getModelProvider ( ) . getModel ( ) . equals ( event.getSource ( ) ) ) ) { getView ( ) . removeContent ( ) ; } } } ) ) ; }
Source:
protected void onAdd ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > value , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor widget ) { super . onAdd ( value , widget ) ; value.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.webadmin.section.main.view.popup.host.VfsNicLabelWidget.this , null ) ; } } ) ; }

Target:
protected void onAdd ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > value , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor widget ) { super . onAdd ( value , widget ) ; getModel ( ) . updateSuggestedLabels ( ) ; value.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { selectedLabelsChanged ( ) ; } } ) ; }