auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testHostsRuleStructureNeg ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( false ) ; rule.setPositive ( true ) ; model.setHostsRule ( rule ) ; 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.getVdsAffinityRule ( ) ) ; assertEquals ( false , entity.isVdsEnforcing ( ) ) ; }

Target:
public void testHostsRuleStructure ( ) throws java.lang.Exception { org.ovirt.engine.api.model.AffinityGroup model = new org.ovirt.engine.api.model.AffinityGroup ( ) ; org.ovirt.engine.api.model.AffinityRule rule = new org.ovirt.engine.api.model.AffinityRule ( ) ; rule.setEnabled ( true ) ; rule.setEnforcing ( true ) ; rule.setPositive ( false ) ; model.setHostsRule ( rule ) ; 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.NEGATIVE , entity.getVdsAffinityRule ( ) ) ; org.junit.Assert.assertEquals ( true , entity.isVdsEnforcing ( ) ) ; }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; imagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }
Source:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ) ; for ( org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }

Target:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ) ; for ( org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { org.ovirt.engine.core.utils.MockConfigRule.mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } fireAsyncOperationCompleteEvent ( state ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runInternalAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.context.CommandContext context ) { return getBackend ( ) . runInternalAction ( actionType , parameters , context ) ; }
Source:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( FixturesTool.INSTANCE_TYPE ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_RHEL5_POOL_50 , result.iterator ( ) . next ( ) . getId ( ) ) ; }

Target:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( FixturesTool.INSTANCE_TYPE ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , result.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.VM_RHEL5_POOL_50 , result.iterator ( ) . next ( ) . getId ( ) ) ; }
Source:
public void testGetTagVmMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > result = dao.getTagVmMapByTagName ( existingTag.gettag_name ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map mapping : result ) { assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }

Target:
public void testGetTagVmMapByTagName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.TagsVmMap > result = dao.getTagVmMapByTagName ( existingTag.gettag_name ( ) ) ; assertNotNull ( result ) ; assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.TagsVmMap mapping : result ) { assertEquals ( existingTag.gettag_id ( ) , mapping.gettag_id ( ) ) ; } }
Source:
protected void ExecuteIrsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getIrsProxy ( ) . activateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.ProceedProxyReturnValue ( ) ; setReturnValue ( _result.mStorageStatus ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getIrsProxy ( ) . activateStorageDomain ( org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.ActivateStorageDomainVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( _result.mStorageStatus ) ; }
Source:
public static void isPoolNameUnique ( 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 ) { if ( source != null ) { return ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.IsVmPoolWithSameNameExistsParameters ( name ) , aQuery ) ; }

Target:
public static void isPoolNameUnique ( 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 ) { if ( source != null ) { return ! ( ( java.lang.Boolean ) ( source ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmPoolWithSameNameExists , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "Note" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( sender ) ) ; setNote ( entity.getNote ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "ForceLabel" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( sender ) ) ; force.setLabel ( entity.getForceLabel ( ) ) ; } }
Source:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . move ( setUpMoveParams ( false ) ) ) ; }

Target:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( resource.move ( setUpMoveParams ( false ) ) ) ; }
Source:
private void validateProvider ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { if ( contains ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_PROVIDER ) ) { try { org.ovirt.engine.core.ldap.LdapProviderType.valueOfIgnoreCase ( get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_PROVIDER ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NullPointerException ex ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.INVALID_ARGUMENT_VALUE , java.lang.String.format ( "Invalid provider, valid providers are: '%s'." , org.apache.commons.lang.StringUtils.join ( new java.lang.String [ ] { org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_AD , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_IPA , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_RHDS , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_ITDS , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_OLDAP } , ", " ) ) ) ; } } }

Target:
private void validateProvider ( ) throws org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult { if ( contains ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_PROVIDER ) ) { try { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ldap.LdapProviderType.valueOfIgnoreCase ( get ( org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.ARG_PROVIDER ) ) ; } catch ( java.lang.IllegalArgumentException | java.lang.NullPointerException ex ) { throw new org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsResult ( ManageDomainsResultEnum.INVALID_ARGUMENT_VALUE , java.lang.String.format ( "Invalid provider, valid providers are: '%s'." , org.apache.commons.lang.StringUtils.join ( new java.lang.String [ ] { org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_AD , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_IPA , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_RHDS , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_ITDS , org.ovirt.engine.extensions.aaa.builtin.tools.ManageDomainsArguments.PROV_OLDAP } , ", " ) ) ) ; } } }
Source:
public static void GetVmNicList ( 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void setVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType volumeType ) { this . volumeType = volumeType ; if ( ! ( volumeType.isReplicatedType ( ) ) ) { setReplicaCount ( 0 ) ; } if ( ! ( volumeType.isStripedType ( ) ) ) { setStripeCount ( 0 ) ; } }

Target:
public void setVolumeType ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType volumeType ) { this . volumeType = volumeType ; if ( ! ( volumeType.isReplicatedType ( ) ) ) { setReplicaCount ( 0 ) ; } if ( ! ( volumeType.isStripedType ( ) ) ) { setStripeCount ( 0 ) ; } if ( ! ( volumeType.isDispersedType ( ) ) ) { setDisperseCount ( 0 ) ; setRedundancyCount ( 0 ) ; } }
Source:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.api.restapi.resource.Cluster cluster = new org.ovirt.engine.api.restapi.resource.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }

Target:
public void testMigrateWithClusterId ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.MigrateVm , org.ovirt.engine.core.common.action.MigrateVmParameters.class , new java.lang.String [ ] { "VmId" , "ForceMigrationForNonMigratableVm" , "TargetClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE , GUIDS [ 1 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; org.ovirt.engine.api.restapi.resource.Cluster cluster = new org.ovirt.engine.api.restapi.resource.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; action.setCluster ( cluster ) ; verifyActionResponse ( resource.migrate ( action ) ) ; }
Source:
public static void getTimeZoneList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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.HashMap < java.lang.String , java.lang.String > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTimeZones , params , aQuery ) ; }

Target:
public static void getExternalNetworkMap ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.HashMap < org.ovirt.engine.core.common.businessentities.network.Network , java.util.Set < org.ovirt.engine.core.compat.Guid > > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 1 ) . getReturnValue ( ) ) ) ; InitClusters ( clusters , true , false ) ; InitTemplates ( templates ) ; InitCdImage ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 1 ) . getReturnValue ( ) ) ) ; initClusters ( clusters , true , false ) ; initTemplates ( templates ) ; initCdImage ( ) ; }
Source:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result1.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { vmListModel1.Cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . stopProgress ( ) ; vmListModel1.cancel ( ) ; }
Source:
public void testDiskAttachedToAnyNonDownVMAllDown ( ) { org.ovirt.engine.core.common.businessentities.VM vm1 = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; org.ovirt.engine.core.common.businessentities.VM vm2 = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm1.setName ( "Vm1" ) ; vm2.setName ( "Vm2" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = java.util.Arrays.asList ( vm1 , vm2 ) ; org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( vmList ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyNonDownVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToAnyNonDownVMNoVMs ( ) { org.junit.Assert.assertThat ( validator.isDiskAPluggedToAnyNonDownVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( imageId ) ; org.ovirt.engine.core.compat.Guid domainId = diskImage.getStorageIds ( ) . get ( 0 ) ; org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( domainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }

Target:
private boolean validateSourceStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain sourceDomain ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( sourceDomain ) ; return validate ( validator.isDomainExistAndActive ( ) ) ; }
Source:
public static void getStorageDomainListByTemplate ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.DiskImage disk , java.lang.String value ) { importModel.getDiskImportData ( disk.getId ( ) ) . setSelectedQuotaString ( value ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportDiskData importData = importModel.getDiskImportData ( disk.getId ( ) ) ; if ( importData == null ) { return "" ; } return new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.storage.VolumeType > ( ) . render ( org.ovirt.engine.core.common.businessentities.storage.VolumeType.forValue ( importData.getSelectedVolumeType ( ) . getValue ( ) ) ) ; }
Source:
public void searchNotUsingTags ( ) { java.lang.String [ ] searchTexts = new java.lang.String [ ] { "Hosts:" , "Vms:" , "Datacenters:" , "Clusters:" } ; for ( java.lang.String searchText : searchTexts ) { org.junit.Assert.assertFalse ( new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) . analyzeSyntaxState ( searchText , false ) . isSearchUsingTags ( ) ) ; } }

Target:
public void searchUsingTags ( ) { org.junit.Assert.assertEquals ( expected , new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) . analyzeSyntaxState ( input , false ) . isSearchUsingTags ( ) ) ; }
Source:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source == null ) || ( ( java.lang.Boolean ) ( source ) ) ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( java.lang.Boolean.TRUE ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.users.VdcUser u = new org.ovirt.engine.core.common.users.VdcUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; }

Target:
public void getUserIdVdcUserDefault ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser u = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; b.setCurrentUser ( u ) ; final org.ovirt.engine.core.compat.Guid g = b.getUserId ( ) ; org.junit.Assert.assertEquals ( Guid.Empty , g ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetNicsExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmTemplateInterface , org.ovirt.engine.core.common.action.RemoveVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.TEMPLATE_ID , org.ovirt.engine.api.restapi.resource.BackendTemplateNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void setConsoleHelpers ( ) { this . consoleUtils = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . Resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) ) ) ; this . consoleManager = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . Resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) ) ) ; this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . Resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }

Target:
private void setConsoleHelpers ( ) { this . consoleUtils = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) ) ) ; this . consoleManager = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) ) ) ; this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }
Source:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { org.ovirt.engine.api.restapi.LocalConfig localConfig = org.ovirt.engine.api.restapi.LocalConfig.getInstance ( ) ; supportedVersions = localConfig.getSupportedVersions ( ) ; defaultVersion = localConfig.getDefaultVersion ( ) ; }

Target:
public void init ( javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { org.ovirt.engine.api.restapi.LocalConfig localConfig = org.ovirt.engine.api.restapi.LocalConfig.getInstance ( ) ; supportedVersions = localConfig.getSupportedVersions ( ) ; defaultVersion = localConfig.getDefaultVersion ( ) ; java.util.Set < org.ovirt.engine.api.restapi.DeprecatedVersionInfo > deprecatedVersionInfos = localConfig.getDeprecatedVersions ( ) ; deprecatedVersionsSet = deprecatedVersionInfos.stream ( ) . map ( DeprecatedVersionInfo :: getVersion ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; deprecatedVersionsMap = deprecatedVersionInfos.stream ( ) . collect ( java.util.stream.Collectors.toMap ( DeprecatedVersionInfo :: getVersion , java.util.function.Function.identity ( ) ) ) ; }
Source:
private void map ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity , org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; } }

Target:
private void map ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity , org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; asyncTask.setEnableCallBack ( cmdEntity.isEnableCallBack ( ) ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getPath ( ) ) ) ) { getPathChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; } else if ( ( ev.equals ( EntityModel.EntityChangedEventDefinition ) ) && ( sender == ( getOverride ( ) ) ) ) { Override_EntityChanged ( args ) ; } }
Source:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYPRESS ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }

Target:
protected void onPreviewNativeEvent ( com.google.gwt.user.client.Event.NativePreviewEvent event ) { super . onPreviewNativeEvent ( event ) ; if ( ( ( keyPressHandler ) != null ) && ( ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYPRESS ) ) || ( ( event.getTypeInt ( ) ) == ( com.google.gwt.user.client.Event.ONKEYDOWN ) ) ) ) { keyPressHandler.onKeyPress ( event.getNativeEvent ( ) ) ; } }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static java.util.Map < org.ovirt.engine.core.compat.Version , java.util.List < java.lang.String > > getCustomPropertiesList ( ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.customPropertiesList ; }
Source:
public void volumesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.IMAGE_ID ) ) ) ; mockVdsCommand ( VDSCommandType.GetVolumesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void volumesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.IMAGE_ID ) ) ) ; mockVdsCommand ( VDSCommandType.GetVolumesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.times ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc retVal = org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.getBroker ( ) . migrateStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) ) ; status = retVal.getStatus ( ) ; setReturnValue ( retVal.getDowntime ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturn retVal = org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.getBroker ( ) . migrateStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.getParameters ( ) . getVmId ( ) . toString ( ) ) ; status = retVal.getStatus ( ) ; setReturnValue ( retVal.getDowntime ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDev = getParameters ( ) . getDev ( ) ; if ( ( graphicsDev.getDeviceId ( ) ) == null ) { graphicsDev.setDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } getVmDeviceDao ( ) . save ( graphicsDev ) ; setSucceeded ( true ) ; setActionReturnValue ( graphicsDev.getId ( ) . getDeviceId ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice graphicsDev = getParameters ( ) . getDev ( ) ; if ( ( graphicsDev.getDeviceId ( ) ) == null ) { graphicsDev.setDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } vmDeviceDao.save ( graphicsDev ) ; setSucceeded ( true ) ; setActionReturnValue ( graphicsDev.getId ( ) . getDeviceId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( java.util.List < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
private boolean isNewAttachment ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { return networkAttachmentId == null ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }
Source:
public void setUp ( ) { hostWithCpus = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; hostWithCpus.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostWithCpus.setOnlineCpus ( "0, 1, 2,3, 5" ) ; hostWithoutCpus = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; hostWithoutCpus.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostWithoutCpus.setOnlineCpus ( null ) ; perHostMessages = new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
public void setUp ( ) { hostWithCpus = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; hostWithCpus.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostWithCpus.setOnlineCpus ( "0, 1, 2,3, 5" ) ; hostWithoutCpus = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; hostWithoutCpus.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; hostWithoutCpus.setOnlineCpus ( null ) ; perHostMessages = new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ; vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; }
Source:
public void testGetByNameReturnsNullIfNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( testItem ) ) ; org.junit.Assert.assertThat ( map.get ( "different name" ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }

Target:
public void testGetByNameReturnsNullIfNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem testItem = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Collections.singletonList ( testItem ) ) ; org.junit.Assert.assertThat ( map.get ( "different name" ) , org.hamcrest.CoreMatchers.nullValue ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , 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 ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }