auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testAddIncompleteParameters_2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; model.setSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters_2" , "provisionedSize|size" ) ; } }

Target:
public void testAddIncompleteParameters_2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "testAddIncompleteParameters_2" , "provisionedSize|size" ) ; } }
Source:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.junit.Assert.assertFalse ( validationResult.isValid ( ) ) ; org.junit.Assert.assertTrue ( ( ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME ) == ( validationResult.getMessage ( ) ) ) ) ; }

Target:
public void canRemoveLastBrick ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getDistributedVolume ( volumeId1 , 1 ) ; org.ovirt.engine.core.bll.ValidationResult validationResult = brickValidator.canRemoveBrick ( volumeEntity.getBricks ( ) , volumeEntity , 1 , false ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CAN_NOT_REMOVE_ALL_BRICKS_FROM_VOLUME ) ) ; }
Source:
public void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void onSucceeded ( ) { syncDbRecords ( true ) ; endSuccessfully ( ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.infoFormat ( "Successfully merged snapshot {0} images {1}..{2}" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }

Target:
public void onSucceeded ( ) { syncDbRecords ( true ) ; endSuccessfully ( ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Successfully merged snapshot '{}' images '{}'..'{}'" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > extractRootDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < org.ovirt.engine.core.common.businessentities.Disk > rootDisks = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage candidate : vm.getImages ( ) ) { if ( isRoot ( candidate , vm.getImages ( ) ) ) { rootDisks.add ( candidate ) ; } } return rootDisks ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > extractRootDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < org.ovirt.engine.core.common.businessentities.storage.Disk > rootDisks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage candidate : vm.getImages ( ) ) { if ( isRoot ( candidate , vm.getImages ( ) ) ) { rootDisks.add ( candidate ) ; } } return rootDisks ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; 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 { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( vmId ) ; vm.setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( vmId ) ) . thenReturn ( vm ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( vmId ) ; vm.setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( vmId ) ) . thenReturn ( vm ) ; return vm ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult getNetworkInUse ( java.util.Collection < java.lang.String > names ) { if ( names.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int numberOfEntities = names.size ( ) ; boolean useSingular = numberOfEntities == 1 ; return useSingular ? getNetworkInUseSingular ( names ) : getNetworkInUsePlural ( names ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsed ( java.util.Collection < java.lang.String > entitiesNames , org.ovirt.engine.core.common.errors.EngineMessage entitiesReplacementPlural , org.ovirt.engine.core.common.errors.EngineMessage entitiesReplacementSingular ) { return new org.ovirt.engine.core.common.utils.PluralMessages ( ) . getNetworkInUse ( entitiesNames , entitiesReplacementSingular , entitiesReplacementPlural ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImageInfo ( final org.ovirt.engine.core.compat.Guid storagePoolId , final org.ovirt.engine.core.compat.Guid storageId , final org.ovirt.engine.core.compat.Guid diskId , final org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( storagePoolId , storageId , diskId , imageId ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( ret.getReturnValue ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImageInfoFromVdsm ( final org.ovirt.engine.core.common.businessentities.storage.DiskImage targetImage ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue ret = runVdsCommand ( VDSCommandType.GetImageInfo , new org.ovirt.engine.core.common.vdscommands.GetImageInfoVDSCommandParameters ( targetImage.getStoragePoolId ( ) , targetImage.getStorageIds ( ) . get ( 0 ) , targetImage.getId ( ) , targetImage.getImageId ( ) ) ) ; return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( ret.getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.warn ( "Failed to get info of volume '{0}' using GetImageInfo" , targetImage.getImageId ( ) , e ) ; return null ; } }
Source:
private void mockVmValidator ( ) { org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( vm ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( vm ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( vmValidator ) . getDbFacade ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( vmValidator ) . getDiskDao ( ) ; }

Target:
public void testMigrationPolicyChangeVmDown ( ) { prepareVmToPassValidate ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; vmStatic.setMigrationSupport ( MigrationSupport.MIGRATABLE ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , getVmActiveGraphics ( ) , vm.getDefaultDisplayType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateDisplayType ( ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , getVmActiveGraphics ( ) , vm.getDefaultDisplayType ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public int hashCode ( ) { return java.util.Objects.hash ( id , compatVersion , compatibilityVersion , cpuName , description , maxVdsMemoryOverCommit , countThreadsAsCores , migrateOnError , name , storagePoolId , storagePoolName , transparentHugepages , virtService , glusterService , glusterCliBasedSchedulingOn , tunnelMigration , emulatedMachine , trustedService , haReservation , clusterPolicyName , clusterPolicyProperties , requiredRngSources , enableKsm , enableBallooning , optimizationType , serialNumberPolicy , customSerialNumber , groupHostsAndVms , fencingPolicy , autoConverge , migrateCompressed , glusterTunedProfile , addtionalFeaturesSupported , maintenanceReasonRequired , ksmMergeAcrossNumaNodes ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , compatVersion , compatibilityVersion , cpuName , description , maxVdsMemoryOverCommit , countThreadsAsCores , migrateOnError , name , storagePoolId , storagePoolName , transparentHugepages , virtService , glusterService , glusterCliBasedSchedulingOn , tunnelMigration , emulatedMachine , trustedService , haReservation , clusterPolicyName , clusterPolicyProperties , requiredRngSources , enableKsm , enableBallooning , optimizationType , serialNumberPolicy , customSerialNumber , groupHostsAndVms , fencingPolicy , autoConverge , migrateCompressed , glusterTunedProfile , addtionalFeaturesSupported , maintenanceReasonRequired , ksmMergeAcrossNumaNodes , customMigrationNetworkBandwidth , migrationBandwidthLimitType , migrationPolicyId ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentNicIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( nicNameAndNicIdIsIncoherent ( nicId , nicName ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return validateCoherentNicIdentification ( attachment.getId ( ) , attachment.getNicId ( ) , attachment.getNicName ( ) , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY ) ; }
Source:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }

Target:
protected boolean checkSingleQxlDisplay ( ) { if ( ! ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getSingleQxlPci ( ) ) ) { return true ; } return org.ovirt.engine.core.bll.VmHandler.isSingleQxlDeviceLegal ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getDefaultDisplayType ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.AddVmCommand.getEffectiveCompatibilityVersion ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot addSnapshotToDB ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.bll.memory.MemoryImageBuilder memoryImageBuilder ) { boolean taskExists = ( ! ( getDisksList ( ) . isEmpty ( ) ) ) || ( memoryImageBuilder.isCreateTasks ( ) ) ; return new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . addSnapshot ( snapshotId , getParameters ( ) . getDescription ( ) , ( taskExists ? org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.LOCKED : org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK ) , getParameters ( ) . getSnapshotType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) , true , memoryImageBuilder.getVolumeStringRepresentation ( ) , getDisksList ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCompensationContext ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.Snapshot addSnapshotToDB ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.bll.memory.MemoryImageBuilder memoryImageBuilder ) { cachedSelectedActiveDisks = null ; boolean taskExists = ( ! ( getDisksList ( ) . isEmpty ( ) ) ) || ( memoryImageBuilder.isCreateTasks ( ) ) ; return new org.ovirt.engine.core.bll.snapshots.SnapshotsManager ( ) . addSnapshot ( snapshotId , getParameters ( ) . getDescription ( ) , ( taskExists ? org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.LOCKED : org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK ) , getParameters ( ) . getSnapshotType ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) , true , memoryImageBuilder.getVolumeStringRepresentation ( ) , getDisksList ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getCompensationContext ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addBonds ( org.ovirt.engine.core.common.businessentities.network.Bond ... bonds ) { if ( emptyParameters ( bonds ) ) { return this ; } if ( ( parameters.getBonds ( ) ) == null ) { parameters.setBonds ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Bond > ( ) ) ; } parameters.getBonds ( ) . addAll ( java.util.Arrays.asList ( bonds ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getRemovedNetworkAttachments ( ) ) == null ) { parameters.setRemovedNetworkAttachments ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { parameters.getRemovedNetworkAttachments ( ) . add ( networkAttachment.getId ( ) ) ; } return this ; }
Source:
public boolean canShowConsole ( org.ovirt.engine.ui.userportal.widget.basic.ConsoleProtocol selectedProtocol , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( selectedProtocol == null ) { return false ; } boolean isSpiceAvailable = ( selectedProtocol.equals ( ConsoleProtocol.SPICE ) ) && ( canOpenSpiceConsole ( item ) ) ; boolean isRdpAvailable = ( selectedProtocol.equals ( ConsoleProtocol.RDP ) ) && ( canOpenRDPConsole ( item ) ) ; boolean isVncAvailable = selectedProtocol.equals ( ConsoleProtocol.VNC ) ; return ( isSpiceAvailable || isRdpAvailable ) || isVncAvailable ; }

Target:
public boolean canShowConsole ( org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol selectedProtocol , org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( selectedProtocol == null ) { return false ; } boolean isSpiceAvailable = ( selectedProtocol.equals ( ConsoleProtocol.SPICE ) ) && ( canOpenSpiceConsole ( item ) ) ; boolean isRdpAvailable = ( selectedProtocol.equals ( ConsoleProtocol.RDP ) ) && ( canOpenRDPConsole ( item ) ) ; boolean isVncAvailable = selectedProtocol.equals ( ConsoleProtocol.VNC ) ; return ( isSpiceAvailable || isRdpAvailable ) || isVncAvailable ; }
Source:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getAddParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( ( network != null ) && ( network.isSetProfileRequired ( ) ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return parameters ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendNetworksResource.AddedNetworkResolver ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( java.util.Objects.equals ( serverId , entity.serverId ) ) && ( java.util.Objects.equals ( glusterServerUuid , entity.glusterServerUuid ) ) ) && ( java.util.Objects.equals ( knownAddresses , entity.knownAddresses ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServer entity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServer ) ( obj ) ) ; return ( ( ( java.util.Objects.equals ( serverId , entity.serverId ) ) && ( java.util.Objects.equals ( glusterServerUuid , entity.glusterServerUuid ) ) ) && ( java.util.Objects.equals ( knownAddresses , entity.knownAddresses ) ) ) && ( java.util.Objects.equals ( peerStatus , entity.peerStatus ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.profiles.DiskProfileValidator validator = new org.ovirt.engine.core.bll.profiles.DiskProfileValidator ( getParameters ( ) . getProfile ( ) ) ; return ( ( ( validate ( validator.diskProfileIsSet ( ) ) ) && ( validate ( validator.storageDomainExists ( ) ) ) ) && ( validate ( validator.qosExistsOrNull ( ) ) ) ) && ( validate ( validator.diskProfileNameNotUsed ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.bll.profiles.DiskProfileValidator getProfileValidator ( ) { return new org.ovirt.engine.core.bll.profiles.DiskProfileValidator ( getProfile ( ) ) ; }
Source:
private void deleteObsoleteHistoryData ( ) throws java.sql.SQLException { if ( ( prop.getInteger ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ) > 0 ) { final int deletedRecords = eventsManager.deleteObsoleteHistoryData ( prop.getInteger ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ) ; if ( deletedRecords > 0 ) { org.ovirt.engine.core.notifier.NotificationService.log.debug ( ( deletedRecords + " records were deleted from \"event_notification_hist\" table." ) ) ; } } }

Target:
public boolean hasTransports ( ) { return ! ( transports.isEmpty ( ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void GetAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile ) ; org.ovirt.engine.api.model.DiskProfile map = map ( diskProfile ) ; org.ovirt.engine.core.common.action.DiskProfileParameters parameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( map ) ; return performCreate ( ActionType.AddDiskProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
protected javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DiskProfile diskProfile ) { validateParameters ( diskProfile ) ; org.ovirt.engine.api.model.DiskProfile map = map ( diskProfile ) ; org.ovirt.engine.core.common.action.DiskProfileParameters parameters = new org.ovirt.engine.core.common.action.DiskProfileParameters ( map ) ; return performCreate ( ActionType.AddDiskProfile , parameters , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private boolean validateBondSlavesCount ( ) { boolean returnValue = true ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondEntry : bonds.entrySet ( ) ) { if ( ( bondEntry.getValue ( ) . size ( ) ) < 2 ) { returnValue = false ; violations.add ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }

Target:
private boolean validateBondSlavesCount ( ) { boolean returnValue = true ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondEntry : bonds.entrySet ( ) ) { if ( ( bondEntry.getValue ( ) . size ( ) ) < 2 ) { returnValue = false ; addViolation ( VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; } } return returnValue ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStop ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStop ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public synchronized org.ovirt.engine.sdk.Api getConnection ( ) throws java.io.IOException , org.ovirt.engine.sdk.exceptions.ServerException , org.ovirt.engine.sdk.exceptions.UnsecuredConnectionAttemptError { if ( ( api ) == null ) { java.lang.String url = java.lang.String.format ( "%s://%s:%s/ovirt-engine/api" , protocol , server , port ) ; org.ovirt.optimizer.ovirt.OvirtClient.log.debug ( java.lang.String.format ( "Logging to %s as %s" , url , username ) ) ; api = new org.ovirt.engine.sdk.Api ( url , username , password , null , null , requestTimeout , true , true , null , false ) ; } return api ; }

Target:
public synchronized org.ovirt.engine.sdk.Api getConnection ( ) throws java.io.IOException , org.ovirt.engine.sdk.exceptions.ServerException , org.ovirt.engine.sdk.exceptions.UnsecuredConnectionAttemptError { if ( ( api ) == null ) { java.lang.String url = getUrl ( ) ; org.ovirt.optimizer.ovirt.OvirtClient.log.debug ( java.lang.String.format ( "Logging to %s as %s using v3 API" , url , username ) ) ; api = new org.ovirt.engine.sdk.Api ( url , username , password , null , null , requestTimeout , true , true , null , false ) ; } return api ; }
Source:
private boolean checkEquals ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > actual , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > expected ) { boolean equals = false ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity aVolume : actual ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity eVolume : expected ) { if ( aVolume.getId ( ) . equals ( eVolume.getId ( ) ) ) { equals = true ; break ; } } if ( ! equals ) { break ; } } return equals ; }

Target:
private boolean checkEquals ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > actual , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > expected ) { java.util.Set < org.ovirt.engine.core.compat.Guid > actualSet = actual.stream ( ) . map ( BusinessEntity :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedSet = expected.stream ( ) . map ( BusinessEntity :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; return actualSet.equals ( expectedSet ) ; }
Source:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command.getName ( ) . equals ( "OnRemove" ) ) { OnRemove ( ) ; } else if ( command.getName ( ) . equals ( "OnRestore" ) ) { OnRestore ( ) ; } else if ( command.getName ( ) . equals ( "onClone" ) ) { onClone ( ) ; } else if ( command.getName ( ) . equals ( "closeClone" ) ) { closeClone ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.getName ( ) . equals ( "OnRemove" ) ) { OnRemove ( ) ; } else if ( command.getName ( ) . equals ( "OnRestore" ) ) { OnRestore ( ) ; } else if ( command.getName ( ) . equals ( "onClone" ) ) { onClone ( ) ; } else if ( command.getName ( ) . equals ( "closeClone" ) ) { closeClone ( ) ; } }
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.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmWithoutConfiguration ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = getVmDao ( ) . get ( vmId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( vm.getId ( ) ) ; vm.setInterfaces ( interfaces ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = getDiskImageDao ( ) . getAllSnapshotsForVmSnapshot ( snapshotId ) ; vm.setImages ( new java.util.ArrayList ( disks ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage currDisk : disks ) { currDisk.setActive ( true ) ; } return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmWithoutConfiguration ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid snapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = vmDao.get ( vmId ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = vmNetworkInterfaceDao.getAllForVm ( vm.getId ( ) ) ; vm.setInterfaces ( interfaces ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = diskImageDao.getAllSnapshotsForVmSnapshot ( snapshotId ) ; vm.setImages ( new java.util.ArrayList ( disks ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage currDisk : disks ) { currDisk.setActive ( true ) ; } return vm ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; 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 } , null ) ; control.replay ( ) ; try { resource.update ( getUpdate ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testValidModifiedBondsFailsWhenInsufficientNumberOfSlaves ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , false , false ) ; }

Target:
public void testNetworksUniquelyConfiguredOnHostWhenNotUniquelyConfigured ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.Network networkA = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; networkA.setId ( id ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( networkA ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentReferencingSameNetwork = createNetworkAttachment ( networkA ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( networkA ) ) ; org.junit.Assert.assertThat ( validator.networksUniquelyConfiguredOnHost ( java.util.Arrays.asList ( networkAttachment , networkAttachmentReferencingSameNetwork ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORKS_ALREADY_ATTACHED_TO_IFACES ) ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.VM > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.VM vm : collection ) { assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Vm > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( org.ovirt.engine.api.model.Vm vm : collection ) { assertTrue ( ( populated ? vm.isSetConsole ( ) : ! ( vm.isSetConsole ( ) ) ) ) ; } }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; }

Target:
public java.util.List < T > convert ( java.lang.Object source ) { return source != null ? ( ( java.util.List < T > ) ( source ) ) : new java.util.ArrayList < T > ( ) ; }
Source:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }