auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getStorageDomainSharedStatus ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object.getStatus ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( object.getStorageDomainSharedStatus ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( object.getStatus ( ) ) ; } }
Source:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getCluster ( ) , vm , blacklist , java.util.Collections.emptyList ( ) , new java.util.ArrayList < > ( ) ) ; }

Target:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return ! ( schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getCluster ( ) , vm , blacklist , java.util.Collections.emptyList ( ) , new java.util.ArrayList < > ( ) ) . isEmpty ( ) ) ; }
Source:
protected void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetConsoleDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override 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 ( ) ) ) ) ; } } ) ) ; }

Target:
protected void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetConsoleDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; } } ) ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVm ( ) . getImages ( ) ) { map.put ( diskImage , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVm ( ) . getImages ( ) ) { map.put ( diskImage , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getStorageDomainId ( ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCurrentUser ( ) ) ) ; }
Source:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { return ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getCluster ( ) . getName ( ) ) + "/" ) + ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getDataCenter ( ) . getname ( ) ) ; }

Target:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { return ( ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getCluster ( ) . getName ( ) ) + "/" ) + ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( data ) ) . getDataCenter ( ) . getName ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters buildRemoveAllVmImagesParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters params = new org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , images ) ; params.setParentCommand ( org.ovirt.engine.core.bll.RemoveVmCommand.getActionType ( ) ) ; params.setEntityInfo ( org.ovirt.engine.core.bll.RemoveVmCommand.getParameters ( ) . getEntityInfo ( ) ) ; params.setParentParameters ( org.ovirt.engine.core.bll.RemoveVmCommand.getParameters ( ) ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters buildRemoveAllVmImagesParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters params = new org.ovirt.engine.core.common.action.RemoveAllVmImagesParameters ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) , images ) ; params.setParentCommand ( getActionType ( ) ) ; params.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; params.setParentParameters ( getParameters ( ) ) ; return params ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) ) == null ) { return ; } org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.reestablishConnectionIfNeeded ( ) ; vdsInitialStatus = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) . getStatus ( ) ; if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) ) == null ) { return ; } vdsInitialStatus = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand.getVds ( ) . getStatus ( ) ; if ( isOvirtReInstallOrUpgrade ( ) ) { upgradeNode ( ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = getBackend ( ) . runQuery ( search , searchParameters ) ; returnValue.setReturnValue ( org.ovirt.engine.ui.frontend.server.gwt.hibernate.HibernateCleaner.doClean ( returnValue.getReturnValue ( ) ) ) ; return returnValue ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) . getstorage_pool_id ( ) ) == null ? null : org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) . getstorage_pool_id ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.AddVdsGroupCommand.getActionType ( ) . getActionGroup ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { return java.util.Collections.singletonList ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( ( ( org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) . getStoragePoolId ( ) ) == null ? null : org.ovirt.engine.core.bll.AddVdsGroupCommand.getVdsGroup ( ) . getStoragePoolId ( ) . getValue ( ) ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.bll.AddVdsGroupCommand.getActionType ( ) . getActionGroup ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; setIsEmpty ( ( ( ( ( java.util.List ) ( getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue.getReturnValue ( ) ) ) ) ; setIsEmpty ( ( ( ( ( java.util.List ) ( getItems ( ) ) ) . size ( ) ) == 0 ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( id ) ; java.lang.String host = org.ovirt.engine.api.common.util.QueryHelper.getMatrixConstraint ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.common.util.QueryHelper.getMatrixConstraint ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.NGuid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( dataCenterId ) ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( java.lang.String clusterId ) { org.ovirt.engine.core.compat.NGuid dataCenterId = getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( clusterId ) ) , null ) . getStoragePoolId ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( dataCenterId ) ) ; return getBackendCollection ( VdcQueryType.GetAllNetworks , params ) ; }
Source:
public void testCheckGlusterQuorumWithTwoServersDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing" , ( ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( java.util.Arrays.asList ( "Vol-1" , "Vol-2" ) . equals ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) ) ) ; }

Target:
public void testCheckGlusterQuorumWithTwoServersDown ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.junit.Assert.assertTrue ( "Quorum check is failing" , ( ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( java.util.Arrays.asList ( "Vol-1" , "Vol-2" ) . equals ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) ) ) ; }
Source:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) ) ) { org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_pool > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( dataCenter.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) ) ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StoragePool > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( dataCenter.getId ( ) ) ) ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object object , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( java.lang.Boolean.FALSE.equals ( model.getImportSourceValid ( ) . getEntity ( ) ) ) { message.setText ( model.getImportSourceValid ( ) . getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object object , org.ovirt.engine.ui.uicompat.EventArgs args ) { message.setText ( model.getImportSourceValid ( ) . getMessage ( ) ) ; }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; java.lang.System.out.println ( comps ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }

Target:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }
Source:
public static void addVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , int numberOfVideoDevices ) { for ( int i = 0 ; i < numberOfVideoDevices ; i ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.VIDEO , vmBase.getDefaultDisplayType ( ) . getDefaultVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getVideoDeviceSpecParams ( vmBase ) , true , false ) ; } }

Target:
public void addVideoDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , int numberOfVideoDevices ) { for ( int i = 0 ; i < numberOfVideoDevices ; i ++ ) { addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmBase.getId ( ) ) , VmDeviceGeneralType.VIDEO , vmBase.getDefaultDisplayType ( ) . getDefaultVmDeviceType ( ) , getVideoDeviceSpecParams ( vmBase ) , true , false ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Template model = getRestModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.Template model = getRestModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void testValidateQosNotPartiallyConfiguredWhenNotUpdatingAttachments ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . build ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.junit.Assert.assertThat ( validator.validateQosNotPartiallyConfigured ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosNotPartiallyConfiguredWhenNotUpdatingAttachments ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.junit.Assert.assertThat ( validator.validateQosNotPartiallyConfigured ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList , getDisksList ( ) ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList , getDisksList ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
public void executeCommandWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATED ) ; }

Target:
public void executeCommandWhenServerIdPresent ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID , org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommandTest.SERVER_ID ) , null ) ) ; setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATED ) ; }
Source:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setFile ( null ) ; control.replay ( ) ; try { resource.update ( cdrom ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "update" , "file" ) ; } }

Target:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setFile ( null ) ; try { resource.update ( cdrom ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "update" , "file" ) ; } }
Source:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; org.ovirt.engine.core.common.businessentities.Provider provider = ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getSelectedItem ( ) ) ) ; if ( provider != null ) { providerNetworkListModel.setIsAvailable ( provider.getType ( ) . getProvidedTypes ( ) . contains ( VdcObjectType.Network ) ) ; } }

Target:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; org.ovirt.engine.core.common.businessentities.Provider provider = getSelectedItem ( ) ; if ( provider != null ) { providerNetworkListModel.setIsAvailable ( provider.getType ( ) . getProvidedTypes ( ) . contains ( VdcObjectType.Network ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage_domains createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.storage_domains sd = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; sd.setstorage_domain_type ( StorageDomainType.Master ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setavailable_disk_size ( availableSpace ) ; sd.setused_disk_size ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setstorage_domain_type ( StorageDomainType.Master ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setavailable_disk_size ( availableSpace ) ; sd.setused_disk_size ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand.getName ( ) . equals ( EditNetworkModel.APPLY_COMMAND_NAME ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private void Commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { } } , null ) ; } }

Target:
private void Commit ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getInPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { list.remove ( VmInterfaceType.e1000 ) ; if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }
Source:
private static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusterByServiceList ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > list , boolean supportsVirtService , boolean supportsGlusterService ) { final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : list ) { if ( ( supportsVirtService && ( cluster.supportsVirtService ( ) ) ) || ( supportsGlusterService && ( cluster.supportsGlusterService ( ) ) ) ) { filteredList.add ( cluster ) ; } } java.util.Collections.sort ( filteredList , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return filteredList ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid vdsgroupid = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getVdsGroupId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( vdsgroupid , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid vdsgroupid = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( vdsgroupid , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }

Target:
public void setUp ( ) { super . setUp ( ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . initTemplateDisks ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . checkNumberOfMonitors ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; initCommandMethods ( ) ; initDestSDs ( ) ; generateStorageToDisksMap ( ) ; cmd.init ( ) ; }
Source:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
private org.ovirt.api.metamodel.tool.JavaTypeReference getListReference ( org.ovirt.api.metamodel.concepts.ListType type ) { org.ovirt.api.metamodel.concepts.Type elementType = type.getElementType ( ) ; org.ovirt.api.metamodel.tool.JavaTypeReference reference = getTypeReference ( elementType , true ) ; reference.addImport ( java.util.List.class ) ; reference.setText ( ( ( "List<" + ( reference.getText ( ) ) ) + ">" ) ) ; return reference ; }

Target:
private org.ovirt.api.metamodel.tool.JavaTypeReference getListReference ( org.ovirt.api.metamodel.concepts.ListType type ) { org.ovirt.api.metamodel.concepts.Type elementType = type.getElementType ( ) ; org.ovirt.api.metamodel.tool.JavaTypeReference reference = getTypeReference ( elementType , true ) ; if ( reference != null ) { reference.addImport ( java.util.List.class ) ; reference.setText ( ( ( "List<" + ( reference.getText ( ) ) ) + ">" ) ) ; } return reference ; }
Source:
public void testGetExportNotFound ( ) throws java.lang.Exception { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetExportNotFound ( ) throws java.lang.Exception { setUpGetStorageDomainExpectations ( StorageDomainType.ImportExport ) ; setUpGetEntityExpectations ( StorageDomainType.ImportExport , org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID , true ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false , null ) ; } }

Target:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false , null , false ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.IVdsEventListener getEventListener ( ) { if ( ( eventListener ) == null ) { javax.enterprise.inject.spi.Bean < ? > bean = beanManager.getBeans ( org.ovirt.engine.core.common.businessentities.IVdsEventListener.class ) . iterator ( ) . next ( ) ; eventListener = ( ( org.ovirt.engine.core.common.businessentities.IVdsEventListener ) ( beanManager.getReference ( bean , bean.getBeanClass ( ) , beanManager.createCreationalContext ( bean ) ) ) ) ; } return eventListener ; }

Target:
public org.ovirt.engine.core.common.businessentities.IVdsEventListener getEventListener ( ) { return eventListener.get ( ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true ) ; setUpVDSGroupExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , false , false , false ) ; setUpEntityQueryExpectations ( 1 , true , true , true ) ; setUpVDSGroupExpectations ( GUIDS [ 1 ] ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkOnCluster , org.ovirt.engine.core.common.action.NetworkClusterParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyUpdate ( resource.update ( getModel ( 0 ) ) , 0 ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.VDS prevHost = getPreviousHost ( hosts ) ; hosts.add ( 0 , null ) ; proxyHostPropertiesModel.getProxyHost ( ) . setItems ( hosts ) ; proxyHostPropertiesModel.getProxyHost ( ) . setSelectedItem ( prevHost ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { org.ovirt.engine.core.common.businessentities.VDS prevHost = getPreviousHost ( hosts ) ; hosts.add ( 0 , null ) ; proxyHostPropertiesModel.getProxyHost ( ) . setItems ( hosts ) ; proxyHostPropertiesModel.getProxyHost ( ) . setSelectedItem ( prevHost ) ; }
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.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplates ( templates ) ; initCdImage ( ) ; }
Source:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = dao.getPermittedStorageDomainsByStoragePool ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_USER_ID , ActionGroup.CONFIGURE_VM_STORAGE , org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_USER_ID , ActionGroup.CONFIGURE_VM_STORAGE , org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_STORAGE_POOL_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setParentId ( Guid.Empty ) ; diskImage.setit_guid ( Guid.Empty ) ; diskImage.setvm_guid ( getVmId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.setDiskAlias ( diskImage , getVm ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( diskImage ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; diskImage.setParentId ( Guid.Empty ) ; diskImage.setit_guid ( Guid.Empty ) ; org.ovirt.engine.core.bll.ImagesHandler.setDiskAlias ( diskImage , getVm ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.addDiskImage ( diskImage , getVmId ( ) ) ; return null ; }