auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getNetworkById ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks ) { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : networks ) { if ( network.getId ( ) . equals ( networkId ) ) { return network ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getOldNetwork ( ) { if ( ( oldNetwork ) == null ) { oldNetwork = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . get ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . getId ( ) ) ; } return oldNetwork ; }
Source:
public static void GetoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void GetDefaultSpmPriority ( 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 ( ) , 5 ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , setUpClusters ( ) , null ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( isImagesAlreadyOnTarget ( ) ) ) ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }

Target:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { if ( ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) && ( ! ( isImagesAlreadyOnTarget ( ) ) ) ) { org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void testWarnOnActiveVmPositive ( ) { testWarnOnActiveVmInner ( true ) ; org.mockito.Mockito.verify ( mockAuditLogDirector ) . log ( auditLogableBaseCaptor.capture ( ) , org.mockito.ArgumentMatchers.same ( AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM ) ) ; final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase actualLoggable = auditLogableBaseCaptor.getValue ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_ID , actualLoggable.getClusterId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , actualLoggable.getCustomValue ( "networkname" ) ) ; }

Target:
public void testWarnOnActiveVmPositive ( ) { testWarnOnActiveVmInner ( true ) ; org.mockito.Mockito.verify ( mockAuditLogDirector ) . log ( auditLogableBaseCaptor.capture ( ) , org.mockito.ArgumentMatchers.same ( AuditLogType.NETWORK_UPDATE_DISPLAY_FOR_CLUSTER_WITH_ACTIVE_VM ) ) ; final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase actualLoggable = auditLogableBaseCaptor.getValue ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_CLUSTER_NAME , actualLoggable.getClusterName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.network.cluster.helper.DisplayNetworkClusterHelperTest.TEST_NETWORK_NAME , actualLoggable.getCustomValue ( "networkname" ) ) ; }
Source:
public void init ( ) { admin = new org.ovirt.engine.core.aaa.DirectoryUser ( getProfileName ( ) , org.ovirt.engine.core.aaa.internal.InternalDirectory.ADMIN_ID , org.ovirt.engine.core.aaa.internal.InternalDirectory.ADMIN_NAME ) ; }

Target:
public void init ( ) { admin = new org.ovirt.engine.core.aaa.DirectoryUser ( getProfileName ( ) , org.ovirt.engine.core.aaa.internal.InternalDirectory.ADMIN_ID , org.ovirt.engine.core.aaa.internal.InternalDirectory.ADMIN_NAME ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getDiskStorageType ( ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; return ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ? resources.vmsImage ( ) : ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ? resources.templatesImage ( ) : null ; }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
public void testMigrateMacsWhenNothingToMigrate ( ) { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , java.util.Collections.emptyList ( ) , commandContext ) ; org.mockito.Mockito.verifyNoMoreInteractions ( macPoolPerCluster , sourceMacPool , targetMacPool ) ; }
Source:
public void testConvertMiBToEiB ( ) { double mib = 15 * ( java.lang.Math.pow ( 1024 , 4 ) ) ; int eib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( mib ) ) , SizeUnit.MiB , SizeUnit.EiB ) . intValue ( ) ; org.junit.Assert.assertEquals ( 15 , eib ) ; }

Target:
public void testConvertMiBToEiB ( ) { double mib = 15 * ( java.lang.Math.pow ( 1024 , 4 ) ) ; int eib = org.ovirt.engine.core.common.utils.SizeConverter.convert ( ( ( long ) ( mib ) ) , SizeUnit.MiB , SizeUnit.EiB ) . intValue ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 15 , eib ) ; }
Source:
protected java.lang.String getClusterId ( org.ovirt.engine.api.model.VmPool pool ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , SearchType.Cluster , ( "Cluster: name=" + ( pool.getCluster ( ) . getName ( ) ) ) ) . getId ( ) . toString ( ) ; }

Target:
protected java.lang.String getClusterId ( org.ovirt.engine.api.model.VmPool pool ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( pool.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( pool.getCluster ( ) . getName ( ) ) ) ) . getId ( ) . toString ( ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDao mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.ClusterDao mockCluster ( ) { org.ovirt.engine.core.dao.ClusterDao mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; org.ovirt.engine.core.common.businessentities.Cluster value = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; value.getRequiredRngSources ( ) . add ( VmRngDevice.Source.RANDOM ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepPause" ) . withParameter ( "volumeName" , masterVolumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "force" , force ) . 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 glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "force" , force ) . 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 testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , true ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; org.ovirt.engine.core.bll.ValidationResult notABondValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND , org.ovirt.engine.core.bll.validator.HostInterfaceValidator.VAR_NETWORK_INTERFACE_IS_NOT_BOND_ENTITY , bond.getName ( ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , notABondValidationResult , notABondValidationResult , ValidationResult.VALID ) ; }
Source:
private boolean canDoSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ! ( isLiveSnapshotEnabled ( ) ) ) && ( ! ( vm.isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT ) ; } return true ; }

Target:
private boolean canDoSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ! ( isLiveSnapshotEnabled ( ) ) ) && ( ! ( vm.isDown ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DATA_CENTER_VERSION_DOESNT_SUPPORT_LIVE_SNAPSHOT ) ; } org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ; if ( ( vds != null ) && ( ! ( vds.getLiveSnapshotSupport ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_QEMU_UNSUPPORTED_OPERATION ) ; } return true ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ! ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) ) { return ; } if ( ( value != null ) && ( showTooltip ( parent , value ) ) ) { parent.setTitle ( getTooltip ( value ) ) ; } else { parent.setTitle ( "" ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; if ( ! ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) ) { return ; } if ( ( value != null ) && ( showTooltip ( parent , value ) ) ) { parent.setTitle ( getTooltip ( value ) ) ; } else { parent.setTitle ( "" ) ; } }
Source:
public void imagesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.never ( ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void imagesListIsEmpty ( ) { mockVdsCommand ( VDSCommandType.GetImagesList , successfulReturnValue ( java.util.Collections.emptyList ( ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( VDSCommandType.GetImagesList , org.mockito.Mockito.times ( 1 ) ) ; verifyCalled ( VDSCommandType.GetVolumesList , org.mockito.Mockito.never ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
private void runActionExecutionFailed ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = translateVdcFault ( fault ) ; fault.setMessage ( translatedMessage ) ; getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }

Target:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state , boolean aggregateErrors ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , aggregateErrors , ( aggregateErrors ? new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionType > ( ) : null ) , ( aggregateErrors ? new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) : null ) ) ; }
Source:
public void replaceWithCustomSeparator ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.lang.String separator = "," ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items , separator ) ; org.junit.Assert.assertTrue ( validateReplacementElementCount ( replacements , separator , ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) ) ; }

Target:
public void replaceWithCustomSeparator ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.lang.String separator = "," ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items , separator ) ; org.junit.jupiter.api.Assertions.assertTrue ( validateReplacementElementCount ( replacements , separator , ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) ) ; }
Source:
public void testGetAnnotationFromOverridingSubclass ( ) { org.ovirt.engine.core.utils.log.Logged logged = org.ovirt.engine.core.utils.log.LoggedUtils.getAnnotation ( new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.junit.Assert.assertEquals ( LogLevel.DEBUG , logged.executionLevel ( ) ) ; org.junit.Assert.assertEquals ( LogLevel.WARN , logged.errorLevel ( ) ) ; org.junit.Assert.assertEquals ( LogLevel.FATAL , logged.parametersLevel ( ) ) ; org.junit.Assert.assertEquals ( LogLevel.FATAL , logged.returnLevel ( ) ) ; }

Target:
public void testGetAnnotationFromOverridingSubclass ( ) { org.ovirt.engine.core.utils.log.Logged logged = org.ovirt.engine.core.utils.log.LoggedUtils.getAnnotation ( new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LogLevel.DEBUG , logged.executionLevel ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LogLevel.WARN , logged.errorLevel ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LogLevel.FATAL , logged.parametersLevel ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LogLevel.FATAL , logged.returnLevel ( ) ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private void addSelectionHandler ( final com.google.gwt.user.client.ui.Button button ) { final com.google.gwt.view.client.MultiSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > selectionModel = ( button == ( downButton ) ) ? topSelectionModel : bottomSelectionModel ; selectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { button.setEnabled ( ( ! ( selectionModel.getSelectedSet ( ) . isEmpty ( ) ) ) ) ; } } ) ; }

Target:
private void addSelectionHandler ( final com.google.gwt.user.client.ui.Button button ) { final com.google.gwt.view.client.MultiSelectionModel < org.ovirt.engine.ui.uicommonweb.models.EntityModel > selectionModel = getSelectionModelForButton ( button ) ; selectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { button.setEnabled ( ( ! ( selectionModel.getSelectedSet ( ) . isEmpty ( ) ) ) ) ; } } ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setname ( "testTemplate" ) ; final org.ovirt.engine.core.common.action.ImportVmTemplateParameters p = new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , t ) ; return p ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setName ( "testTemplate" ) ; final org.ovirt.engine.core.common.action.ImportVmTemplateParameters p = new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , t ) ; return p ; }
Source:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.ui.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( MainTabCustomPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabCustomView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabCustomProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { bind ( org.ovirt.engine.ui.webadmin.plugin.PluginManager.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.PluginEventHandler.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.api.PluginUiFunctions.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.plugin.restapi.RestApiSessionManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( DynamicUrlContentTabPresenter.ViewDef.class ) . to ( org.ovirt.engine.ui.webadmin.section.main.view.DynamicUrlContentTabView.class ) ; bind ( org.ovirt.engine.ui.webadmin.section.main.presenter.DynamicUrlContentTabProxyFactory.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public void succeedWhenStartupTimeoutHasPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( ( ( new java.util.Date ( ) . getTime ( ) ) - 20000 ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.Assert.assertTrue ( result ) ; }

Target:
public void succeedWhenStartupTimeoutHasPassed ( ) { java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; org.mockito.Mockito.when ( backend.getStartedAt ( ) ) . thenReturn ( new org.ovirt.engine.core.compat.DateTime ( ( ( new java.util.Date ( ) . getTime ( ) ) - 20000 ) ) ) ; boolean result = validator.isStartupTimeoutPassed ( messages ) ; org.junit.jupiter.api.Assertions.assertTrue ( result ) ; }
Source:
protected void doDisplayTypeChanged ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } displayTypeSelectedItemChanged ( osType , cluster.getCompatibilityVersion ( ) ) ; }

Target:
protected void initGraphicsConsoles ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } initGraphicsConsoles ( osType , cluster.getCompatibilityVersion ( ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VmTemplate x , org.ovirt.engine.core.common.businessentities.VmTemplate y ) { return x.getName ( ) . compareTo ( y.getName ( ) ) ; }

Target:
public boolean match ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster source ) { if ( ( ( source.getDataCenter ( ) ) == null ) || ( ( source.getCluster ( ) ) == null ) ) { return false ; } return ( source.getDataCenter ( ) . getId ( ) . equals ( dataCenterId ) ) && ( source.getCluster ( ) . getId ( ) . equals ( clusterId ) ) ; }
Source:
public static void GetLowUtilizationForPowerSave ( 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 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LowUtilizationForPowerSave , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

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.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; 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.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getVgEntity ( int index ) { org.ovirt.engine.api.restapi.resource.StorageDomain entity = new org.ovirt.engine.api.restapi.resource.StorageDomain ( ) ; entity.setstorage ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ index ] . toString ( ) ) ) ) ; entity.setstorage_type ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getVgEntity ( int index ) { org.ovirt.engine.api.restapi.resource.StorageDomain entity = new org.ovirt.engine.api.restapi.resource.StorageDomain ( ) ; entity.setStorage ( ( ( org.ovirt.engine.api.restapi.resource.BackendHostStorageResourceTest.VG_ID_PREFIX ) + ( GUIDS [ index ] . toString ( ) ) ) ) ; entity.setStorageType ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ; return entity ; }
Source:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }

Target:
protected boolean areTemplateImagesInStorageReady ( org.ovirt.engine.core.compat.Guid storageId ) { return org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storageId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getValidationMessages ( ) , false , true , true , destStorages.isEmpty ( ) , storageToDisksMap.get ( storageId ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "The theme should load" , testTheme.load ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "01-test.brand" ) ; testTheme = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.jupiter.api.Assertions.assertTrue ( testTheme.load ( ) , "The theme should load" ) ; }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) != null ) { org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDao ( ) . removeVmFromVmPool ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ; if ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . isUpdatePrestartedVms ( ) ) { org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolDao ( ) . boundVmPoolPrestartedVms ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) != null ) { vmPoolDao.removeVmFromVmPool ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmId ( ) ) ; if ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getParameters ( ) . isUpdatePrestartedVms ( ) ) { vmPoolDao.boundVmPoolPrestartedVms ( org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.getVmPoolId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmFromPoolCommand.setSucceeded ( true ) ; } }
Source:
protected void setUpGetNetworksByDataCenterExpectations ( int times , java.lang.Object failure ) 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 [ ] { GUIDS [ 2 ] } , getEntityList ( ) , failure ) ; } }

Target:
private 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 ; }
Source:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( user ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }

Target:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; java.lang.String session = org.jgroups.util.UUID.randomUUID ( ) . toString ( ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( session , user ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ; params.setRefresh ( false ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( params ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.StorageType map ( org.ovirt.engine.api.model.StorageType storageType , org.ovirt.engine.api.model.StorageType template ) { switch ( storageType ) { case ISCSI : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case FCP : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case NFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case LOCALFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case POSIXFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case GLUSTERFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case GLANCE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageType map ( org.ovirt.engine.api.model.StorageType storageType , org.ovirt.engine.api.model.StorageType template ) { switch ( storageType ) { case ISCSI : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case FCP : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case NFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case LOCALFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case POSIXFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case GLUSTERFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; case GLANCE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.storage.StorageType ; default : return null ; } }
Source:
public void setup ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) . when ( command ) . getCluster ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterId ) . when ( command ) . getClusterId ( ) ; }

Target:
public void setup ( ) { command.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }
Source:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDefaultSpmPriority ( 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 ( ) , 5 ) ; }
Source:
public void testVmDiskWithPassDiscardAndWadExistsSucceeds ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.compat.Guid diskId = createVmDiskOnSd ( true , true ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , false ) ) ; org.junit.Assert.assertTrue ( discardHelper.vmDiskWithPassDiscardAndWadExists ( storageDomainDisks , storageDomainVmDisks ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardSupport ( 0L ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }
Source:
public void lowThresholdStorageSpace ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void lowThresholdStorageSpace ( ) { final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > command = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; org.mockito.Mockito.when ( command.getImportValidator ( ) . validateSpaceRequirements ( org.mockito.Matchers.anyCollection ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void testValidateAndSetStorageQuotaSpecificOverGrace ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > parameters = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; parameters.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_SPECIFIC_OVER_GRACE , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1 ) ) ; org.junit.Assert.assertFalse ( quotaManager.validateAndSetStorageQuota ( storage_pool , parameters , canDoActionMessages ) ) ; assertNotEmptyCanDoActionMessage ( ) ; assertAuditLogWritten ( ) ; }

Target:
public void testValidateAndSetStorageQuotaSpecificOverGrace ( ) throws java.lang.Exception { org.junit.Assert.assertFalse ( consumeForStorageQuota ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.STORAGE_QUOTA_SPECIFIC_OVER_GRACE ) ) ; assertNotEmptyCanDoActionMessage ( ) ; assertAuditLogWritten ( ) ; }
Source:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDbGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }