auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "end_time" , sinceDate ) . addValue ( "status" , org.apache.commons.lang.StringUtils.join ( statusesList , "," ) ) ; getCallsHandler ( ) . executeModification ( "DeleteJobOlderThanDateWithStatus" , parameterSource ) ; }

Target:
public void deleteJobOlderThanDateWithStatus ( java.util.Date sinceDate , java.util.List < org.ovirt.engine.core.common.job.JobExecutionStatus > statusesList ) { updateQuery ( entityManager.createNamedQuery ( "Job.deleteJobOlderThanDateWithStatus" ) . setParameter ( "sinceDate" , sinceDate ) . setParameter ( "statuses" , statusesList ) ) ; }
Source:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.MODIFICATION_TYPE , Sql.ModificationTypes.UPDATE ) ; context.put ( Schema.InvokeKeys.ENTITY_KEYS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.getGroupKeys ( args , context.get ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.POSITIONAL , java.lang.String.class ) ) ) ; if ( ! ( context.containsKey ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS ) ) ) { org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; } }

Target:
public void invoke ( org.ovirt.engine.api.extensions.ExtMap context , java.util.Map < java.lang.String , java.lang.Object > args ) { context.mput ( Schema.InvokeKeys.ENTITY , Schema.Entities.GROUP ) . mput ( Schema.InvokeKeys.ENTITY_KEYS , new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Schema.GroupIdentifiers.NAME , args.get ( "group" ) ) . mput ( Schema.SharedKeys.ADD_GROUP , context.get ( ContextKeys.POSITIONAL ) ) ) ; org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.commands.get ( "_schema-modify" ) . invoke ( context ) ; context.putIfAbsent ( ContextKeys.EXIT_STATUS , org.ovirt.engine.extension.aaa.jdbc.binding.cli.Cli.SUCCESS ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , null ) ; 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 ( 0 , null ) ; 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:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "partial" , partial ) . withOptionalParameter ( "remoteUserName" , userName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public 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 , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
public static void getExternalSubnetsByNetworkId ( 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.ExternalSubnet > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExternalSubnetsOnProviderByNetwork , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.network.ExternalSubnet.IpVersion > getExternalSubnetIpVerionList ( ) { return java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet.IpVersion.values ( ) ) ; }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( org.ovirt.engine.core.bll.BaseImagesCommand.getParameters ( ) . isImportEntity ( ) ) ? getDestinationDiskImage ( ) : getDiskImage ( ) ; diskImage.setimageStatus ( imageStatus ) ; getImageDao ( ) . update ( diskImage.getImage ( ) ) ; }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getRelevantDiskImage ( ) ; diskImage.setimageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalAction ( VdcActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( ActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalAction ( ActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.Event event ) { if ( event.isSetSeverity ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.LogSeverity.class , event.getSeverity ( ) , true ) ; } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.Event event ) { if ( event.isSetSeverity ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.LogSeverity.class , event.getSeverity ( ) , true ) ; } if ( event.isSetHost ( ) ) { hostValidator.validateEnums ( event.getHost ( ) ) ; } }
Source:
private static java.lang.String [ ] createIncoherentIdentificationErrorReplacements ( java.lang.String violatingEntityId , org.ovirt.engine.core.compat.Guid referringId , java.lang.String referringName ) { return new java.lang.String [ ] { java.lang.String.format ( "$referrerId %s" , violatingEntityId ) , java.lang.String.format ( "$referringId %s" , referringId ) , java.lang.String.format ( "$referringName %s" , referringName ) } ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAttachmentNotReferenceVlanDevice ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = existingInterfacesMap.get ( attachment.getNicName ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ATTACHMENT_REFERENCE_VLAN_DEVICE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "ATTACHMENT_REFERENCE_VLAN_DEVICE_ENTITY" , attachment.getNetworkName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "nicName" , attachment.getNicName ( ) ) ) . when ( ( ( nic != null ) && ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( nic ) ) ) ) ; }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } }

Target:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } fireAsyncOperationCompleteEvent ( state ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IPv4Address createIpv4Address ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol ipv4BootProtocol ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryIpv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryIpv4Address.setBootProtocol ( ipv4BootProtocol ) ; primaryIpv4Address.setAddress ( randomIpv4Address ( ) ) ; primaryIpv4Address.setGateway ( randomIpv4Address ( ) ) ; primaryIpv4Address.setNetmask ( randomIpv4Address ( ) ) ; return primaryIpv4Address ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IPv4Address createIpv4Address ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ipv4BootProtocol ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address primaryIpv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; primaryIpv4Address.setBootProtocol ( ipv4BootProtocol ) ; primaryIpv4Address.setAddress ( randomIpv4Address ( ) ) ; primaryIpv4Address.setGateway ( randomIpv4Address ( ) ) ; primaryIpv4Address.setNetmask ( randomIpv4Address ( ) ) ; return primaryIpv4Address ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.constants.bootableDisk ( ) ) ; } return null ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isBoot ( ) ) { return org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.constants.bootableDisk ( ) ; } return "" ; }
Source:
private java.lang.String getOuterClassNames ( ) { java.util.Set < java.lang.String > classNames = new java.util.LinkedHashSet < > ( ) ; classNames.add ( org.ovirt.engine.ui.common.widget.tooltip.TooltipConfig.Defaults.TEMPLATE_CLASS_OUTER ) ; classNames.addAll ( extraTooltipClassNames ) ; return classNames.stream ( ) . collect ( java.util.stream.Collectors.joining ( " " ) ) ; }

Target:
private java.lang.String getOuterClassNames ( ) { java.util.Set < java.lang.String > classNames = new java.util.LinkedHashSet < > ( ) ; classNames.add ( org.ovirt.engine.ui.common.widget.tooltip.TooltipConfig.Defaults.TEMPLATE_CLASS_OUTER ) ; classNames.addAll ( extraTooltipClassNames ) ; return java.lang.String.join ( " " , classNames ) ; }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , getEntityList ( ) ) ; } }
Source:
protected boolean isRunAsStateless ( ) { return ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) ) != null ? org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isStateless ( ) ; }

Target:
protected boolean isRunAsStateless ( ) { return ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) ) != null ? org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getRunAsStateless ( ) : ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isStateless ( ) ) ; }
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.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return filteredList ; }

Target:
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 ; }
Source:
org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( java.util.List < java.util.Map < java.lang.String , java.lang.String > > migrationIds ) { org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.service.ClusterOptimizer.computeScore ( sourceSolution , migrationIds , java.util.Collections.< java.lang.String > emptySet ( ) , customDrlFiles ) ; }

Target:
org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore computeScore ( java.util.List < java.util.Map < java.lang.String , java.lang.String > > migrationIds ) { org.ovirt.optimizer.service.problemspace.OptimalDistributionStepsSolution sourceSolution = null ; synchronized ( this ) { sourceSolution = bestSolution ; } return org.ovirt.optimizer.service.ScoreOnlySolver.computeScore ( sourceSolution , migrationIds , java.util.Collections.< java.lang.String > emptySet ( ) , customDrlFiles ) ; }
Source:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; addTypeToStorageModels ( StorageDomainType.ISO , models ) ; return models ; }

Target:
public java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel glusterStorageModel = new org.ovirt.engine.ui.uicommonweb.models.storage.GlusterStorageModel ( ) ; models.add ( glusterStorageModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; addTypeToStorageModels ( StorageDomainType.ISO , models ) ; return models ; }
Source:
protected static org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel createSelectionTreeNodeModel ( boolean isReadOnly , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode roleNode ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel nodeModel ; nodeModel = new org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ( ) ; nodeModel.setTitle ( roleNode.getName ( ) ) ; nodeModel.setDescription ( roleNode.getName ( ) ) ; nodeModel.setIsChangeable ( ( ! isReadOnly ) ) ; return nodeModel ; }

Target:
protected static org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel createSelectionTreeNodeModel ( boolean isReadOnly , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode roleNode ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel nodeModel ; nodeModel = new org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ( ) ; nodeModel.setTitle ( roleNode.getName ( ) ) ; nodeModel.setDescription ( roleNode.getDesc ( ) ) ; nodeModel.setIsChangeable ( ( ! isReadOnly ) ) ; return nodeModel ; }
Source:
private void initImportClonedTemplateDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getImages ( ) ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { generateNewDiskId ( image ) ; updateManagedDeviceMap ( image , getVmTemplate ( ) . getManagedDeviceMap ( ) ) ; } else { newDiskIdForDisk.put ( image.getId ( ) , image ) ; } } }

Target:
private void initImportClonedTemplateDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getImages ( ) ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { generateNewDiskId ( image ) ; updateManagedDeviceMap ( image , getVmTemplate ( ) . getManagedDeviceMap ( ) ) ; } else { newDiskIdForDisk.put ( image.getId ( ) , image ) ; } } }
Source:
public < T extends java.lang.Object > T instanceOf ( java.lang.Class < T > clazz ) { javax.enterprise.inject.spi.Bean < ? > bean = org.ovirt.engine.core.di.Injector.injector.manager.getBeans ( clazz ) . iterator ( ) . next ( ) ; return ( ( T ) ( org.ovirt.engine.core.di.Injector.injector.manager.getReference ( bean , clazz , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( bean ) ) ) ) ; }

Target:
public < T extends java.lang.Object > T instanceOf ( java.lang.Class < T > clazz ) { javax.enterprise.inject.spi.Bean < ? > bean = org.ovirt.engine.core.di.Injector.injector.getManager ( ) . getBeans ( clazz ) . iterator ( ) . next ( ) ; return ( ( T ) ( org.ovirt.engine.core.di.Injector.injector.getManager ( ) . getReference ( bean , clazz , org.ovirt.engine.core.di.Injector.injector.getManager ( ) . createCreationalContext ( bean ) ) ) ) ; }
Source:
private java.util.List < java.lang.String > getAllHostNames ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allHosts ) { java.util.List < java.lang.String > allHostNames = new java.util.ArrayList < java.lang.String > ( allHosts.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : allHosts ) { allHostNames.add ( vds.getvds_name ( ) ) ; } return allHostNames ; }

Target:
private java.util.List < java.lang.String > getAllHostNames ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allHosts ) { java.util.List < java.lang.String > allHostNames = new java.util.ArrayList < java.lang.String > ( allHosts.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : allHosts ) { allHostNames.add ( vds.getVdsName ( ) ) ; } return allHostNames ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > RunMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass ) ; } }

Target:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllCanDoPass ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllCanDoPass ) ; } }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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 : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public static void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAll ( org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromVdsGroups" , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getAll ( org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromCluster" , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance , parameterSource ) ; }
Source:
public void canDoActionFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.assertFailsWithCanDoActionMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void validateFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.assertFailsWithValidateMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }
Source:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source == null ) || ( ( java.lang.Boolean ) ( source ) ) ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private java.lang.Boolean getAutoConverge ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.autoConvergence ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getAutoConverge ( ) ; } if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . getAutoConverge ( ) ) != null ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . getAutoConverge ( ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DefaultAutoConvergence ) ; } return null ; }

Target:
private void updateVmAfterMigrationToDifferentCluster ( ) { if ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getClusterId ( ) . equals ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) ) ) { return ; } org.ovirt.engine.core.common.action.ChangeVMClusterParameters params = new org.ovirt.engine.core.common.action.ChangeVMClusterParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . getTargetClusterId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getCustomCompatibilityVersion ( ) ) ; setSucceeded ( org.ovirt.engine.core.bll.MigrateVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.ChangeVMCluster , params ) . getSucceeded ( ) ) ; }
Source:
public void testWindowsTimeZonesKeys ( ) { final java.util.Set < java.lang.String > windowsTimeZoneKeys = WindowsJavaTimezoneMapping.windowsToJava.keySet ( ) ; for ( java.lang.String timeZoneKey : TimeZoneType.WINDOWS_TIMEZONE.getTimeZoneList ( ) . keySet ( ) ) { org.junit.Assert.assertThat ( windowsTimeZoneKeys , org.hamcrest.core.IsCollectionContaining.hasItem ( timeZoneKey ) ) ; } }

Target:
public void testWindowsTimeZonesKeys ( ) { final java.util.Set < java.lang.String > windowsTimeZoneKeys = org.ovirt.engine.core.compat.WindowsJavaTimezoneMapping.getKeys ( ) ; for ( java.lang.String timeZoneKey : TimeZoneType.WINDOWS_TIMEZONE.getTimeZoneList ( ) . keySet ( ) ) { org.junit.Assert.assertThat ( windowsTimeZoneKeys , org.hamcrest.core.IsCollectionContaining.hasItem ( timeZoneKey ) ) ; } }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }

Target:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.HOOK_ID ) ) ) ; setupMocks ( ) ; mockConfig ( ) ; mockBackend ( true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , true ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.atLeast ( 1 ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }
Source:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( createNewInterface ( ) , createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }

Target:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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 : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }