auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onLoad ( ) { super . onLoad ( ) ; contextMenuHandlerRegistration = numaPanel.addDomHandler ( new com.google.gwt.event.dom.client.ContextMenuHandler ( ) { @ java.lang.Override public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; showContextMenu ( nativeEvent.getClientX ( ) , nativeEvent.getClientY ( ) ) ; event.stopPropagation ( ) ; event.preventDefault ( ) ; } } , com.google.gwt.event.dom.client.ContextMenuEvent.getType ( ) ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; if ( ! ( dragEnabled ) ) { return ; } contextMenuHandlerRegistration = numaPanel.addDomHandler ( new com.google.gwt.event.dom.client.ContextMenuHandler ( ) { @ java.lang.Override public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { com.google.gwt.dom.client.NativeEvent nativeEvent = event.getNativeEvent ( ) ; showContextMenu ( nativeEvent.getClientX ( ) , nativeEvent.getClientY ( ) ) ; event.stopPropagation ( ) ; event.preventDefault ( ) ; } } , com.google.gwt.event.dom.client.ContextMenuEvent.getType ( ) ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosList = ( returnValue == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; qosList.add ( 0 , NetworkQoSModel.EMPTY_QOS ) ; return qosList ; }
Source:
public void canDoActionFailsForVdsNonUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsForVdsNonUp ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) ) ) ; prepareMocks ( cmd , VDSStatus.Down ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Error ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.mockito.Mockito.doReturn ( VDSStatus.Maintenance ) . when ( vds ) . getStatus ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testResolveCombinedMessage ( ) { final java.lang.String message = "${first} equals one, ${second} equals two, '${blank}' equals blank and ${nonExist} is unknown" ; final java.lang.String expectedResolved = java.lang.String.format ( "one equals one, two equals two, ' ' equals blank and %1s is unknown" , AuditLogDirector.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; values.put ( "first" , "one" ) ; values.put ( "second" , "two" ) ; values.put ( "blank" , " " ) ; java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }

Target:
public void testResolveCombinedMessage ( ) { final java.lang.String message = "${first} equals one, ${second} equals two, '${blank}' equals blank and ${nonExist} is unknown" ; final java.lang.String expectedResolved = java.lang.String.format ( "one equals one, two equals two, ' ' equals blank and %1s is unknown" , AuditLogDirector.UNKNOWN_VARIABLE_VALUE ) ; java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( "first" , "one" ) ; values.put ( "second" , "two" ) ; values.put ( "blank" , " " ) ; java.lang.String resolvedMessage = auditLogDirector.resolveMessage ( message , values ) ; org.junit.Assert.assertEquals ( expectedResolved , resolvedMessage ) ; }
Source:
private void updateDeviceProperties ( ) { if ( shouldUpdateReadOnly ( ) ) { vmDeviceForVm.setIsReadOnly ( getNewDisk ( ) . getReadOnly ( ) ) ; getVmDeviceDao ( ) . update ( vmDeviceForVm ) ; } if ( ( getOldDisk ( ) . getDiskInterface ( ) ) != ( getNewDisk ( ) . getDiskInterface ( ) ) ) { getVmDeviceDao ( ) . clearDeviceAddress ( getOldDisk ( ) . getId ( ) ) ; } }

Target:
private void updateDeviceProperties ( ) { if ( updateReadOnlyRequested ( ) ) { vmDeviceForVm.setIsReadOnly ( getNewDisk ( ) . getReadOnly ( ) ) ; getVmDeviceDao ( ) . update ( vmDeviceForVm ) ; } if ( ( getOldDisk ( ) . getDiskInterface ( ) ) != ( getNewDisk ( ) . getDiskInterface ( ) ) ) { getVmDeviceDao ( ) . clearDeviceAddress ( getOldDisk ( ) . getId ( ) ) ; } }
Source:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networks = createNetworksMap ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( networks , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.Network > networks = createNetworksMap ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( networks , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }
Source:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }

Target:
private void decreasePendingVms ( org.ovirt.engine.core.compat.Guid vdsId , int numOfCpus , int minAllocatedMem , java.lang.String vmName ) { getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( vdsId , 0 , ( - numOfCpus ) , ( - minAllocatedMem ) , 0 , 0 ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "Decreasing vds {0} pending vcpu count by {1} and vmem size by {2} (Vm: {3})" , vdsId , numOfCpus , minAllocatedMem , vmName ) ; }
Source:
public void notifyHostManagers ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( resourceManager ) == null ) { return ; } org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = resourceManager.GetVdsManager ( hostId ) ; int pendingCpus = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( this , hostId ) ; int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingMemory.collectForHost ( this , hostId ) ; vdsManager.updatePendingData ( pendingMemory , pendingCpus ) ; }

Target:
public void notifyHostManagers ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ( resourceManager ) == null ) { return ; } org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = resourceManager.getVdsManager ( hostId ) ; int pendingCpus = org.ovirt.engine.core.bll.scheduling.pending.PendingCpuCores.collectForHost ( this , hostId ) ; int pendingMemory = org.ovirt.engine.core.bll.scheduling.pending.PendingMemory.collectForHost ( this , hostId ) ; vdsManager.updatePendingData ( pendingMemory , pendingCpus ) ; }
Source:
protected void buildVmVideoCards ( ) { createInfo.put ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) , vm.getNumOfMonitors ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }

Target:
protected void buildVmVideoCards ( ) { createInfo.put ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) , vm.getNumOfMonitors ( ) , vm.getSingleQxlPci ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.FindMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getDbFacade ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getParameters ( ) . getId ( ) ) ; if ( vds != null ) { vds.setCpuName ( org.ovirt.engine.core.bll.CpuFlagsManagerHandler.findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getVdsGroupCompatibilityVersion ( ) ) ) ; } org.ovirt.engine.core.bll.GetVdsByVdsIdQuery.getQueryReturnValue ( ) . setReturnValue ( vds ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private static org.ovirt.engine.core.common.osinfo.OsRepository getOsRepository ( ) { return org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; }
Source:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; }

Target:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , result.getStorageDomainSharedStatus ( ) ) ; }
Source:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) || ( ( ( object.getMemSizeMB ( ) ) != null ) && ( ( object.getVirtualCpu ( ) ) != null ) ) ) { if ( ! ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) ) { selectedClusterGuid.add ( object.getVdsGroupId ( ) ) ; } return true ; } return false ; }

Target:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaCluster object ) { if ( ( selectedClusterGuid.contains ( object.getClusterId ( ) ) ) || ( ( ( object.getMemSizeMB ( ) ) != null ) && ( ( object.getVirtualCpu ( ) ) != null ) ) ) { if ( ! ( selectedClusterGuid.contains ( object.getClusterId ( ) ) ) ) { selectedClusterGuid.add ( object.getClusterId ( ) ) ; } return true ; } return false ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; updateWatchdogModels ( ) ; }
Source:
private void addOvfStoreDiskToDomain ( org.ovirt.engine.core.common.businessentities.DiskImage ovfDisk ) { org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo storageDomainOvfInfo = new org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo ( org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand.getStorageDomainId ( ) , null , ovfDisk.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfoStatus.OUTDATED , null ) ; org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand.getDbFacade ( ) . getStorageDomainOvfInfoDao ( ) . save ( storageDomainOvfInfo ) ; }

Target:
private void addOvfStoreDiskToDomain ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ovfDisk ) { org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo storageDomainOvfInfo = new org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfo ( org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand.getStorageDomainId ( ) , null , ovfDisk.getId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainOvfInfoStatus.OUTDATED , null ) ; org.ovirt.engine.core.bll.storage.AttachStorageDomainToPoolCommand.getDbFacade ( ) . getStorageDomainOvfInfoDao ( ) . save ( storageDomainOvfInfo ) ; }
Source:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( activeSnapshot ) ; org.junit.Assert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskSnapshotsCanBePreviewed ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( activeSnapshot ) ; org.hamcrest.MatcherAssert.assertThat ( validator.canDiskSnapshotsBePreviewed ( activeSnapshot.getId ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void setDefaultInterface ( ) { org.ovirt.engine.core.compat.Guid vmId = getVmId ( ) ; if ( ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmId ) ) || ( ( getDisk ( ) ) == null ) ) { getDiskInterface ( ) . setSelectedItem ( DiskInterface.VirtIO ) ; } else { getDiskInterface ( ) . setSelectedItem ( getDisk ( ) . getDiskVmElementForVm ( vmId ) . getDiskInterface ( ) ) ; } }

Target:
public void setDefaultInterface ( ) { org.ovirt.engine.core.compat.Guid vmId = getVmId ( ) ; if ( ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vmId ) ) || ( ( getDisk ( ) ) == null ) ) { boolean virtioScsiEnabled = java.lang.Boolean.TRUE.equals ( getIsVirtioScsiEnabled ( ) . getEntity ( ) ) ; getDiskInterface ( ) . setSelectedItem ( ( virtioScsiEnabled ? org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI : org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO ) ) ; } else { getDiskInterface ( ) . setSelectedItem ( getDisk ( ) . getDiskVmElementForVm ( vmId ) . getDiskInterface ( ) ) ; } }
Source:
public void networkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void unmanagedNetworkNotSynced ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , "net" ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; junit.framework.Assert.assertTrue ( helper.getNetworks ( ) . isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean isVmDuringInit = isVmDuringInitiating ( vm ) ; if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || isVmDuringInit ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmDuringInitialization ( org.ovirt.engine.core.common.businessentities.VM vm ) { boolean isVmDuringInit = isVmDuringInitiating ( vm ) ; if ( ( ( vm.isRunning ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.NotResponding ) ) ) || isVmDuringInit ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static org.ovirt.engine.api.model.VmType map ( org.ovirt.engine.api.model.VmType type , org.ovirt.engine.api.model.VmType incoming ) { switch ( type ) { case Desktop : return org.ovirt.engine.api.model.VmType.DESKTOP ; case Server : return org.ovirt.engine.api.model.VmType.SERVER ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.VmType mapVmType ( org.ovirt.engine.api.model.VmType type ) { if ( type == null ) { return null ; } switch ( type ) { case Desktop : return org.ovirt.engine.api.model.VmType.DESKTOP ; case Server : return org.ovirt.engine.api.model.VmType.SERVER ; case HighPerformance : return org.ovirt.engine.api.model.VmType.HIGH_PERFORMANCE ; default : throw new java.lang.IllegalArgumentException ( ( ( "Unknown virtual machine type \"" + type ) + "\"" ) ) ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeRebalanceStart ( org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isFixLayoutOnly ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isForceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { glusterTaskReturn = org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getBroker ( ) . glusterVolumeRebalanceStart ( org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isFixLayoutOnly ( ) , org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.getParameters ( ) . isForceAction ( ) ) ; task = glusterTaskReturn.getGlusterTask ( ) ; org.ovirt.engine.core.vdsbroker.gluster.StartRebalanceGlusterVolumeVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( task ) ; }
Source:
public boolean addOperationList ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > > operationList ) { boolean allowed = true ; for ( org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation : operationList ) { if ( ! ( addOperation ( operation , false ) ) ) { allowed = false ; } } processor.processOperation ( this ) ; return allowed ; }

Target:
public boolean addOperationList ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > > operationList ) { boolean allowed = true ; for ( org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation : operationList ) { if ( ! ( addOperationImpl ( operation ) ) ) { allowed = false ; } } processor.processOperation ( this ) ; return allowed ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.WatchDog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateWatchdog , org.ovirt.engine.core.common.action.WatchdogParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendWatchdogResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.WatchDog wd = resource.update ( getUpdate ( ) ) ; assertTrue ( wd.isSetAction ( ) ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; vmDao = dbFacade.getVmDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setName ( "New VM Pool" ) ; newVmPool.setVmPoolDescription ( "This is a new VM pool." ) ; newVmPool.setVdsGroupId ( org.ovirt.engine.core.dao.VmPoolDaoTest.VDS_GROUP_ID ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDaoTest.FREE_VM_ID , org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmPoolDao ( ) ; vmDao = dbFacade.getVmDao ( ) ; existingVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; deletableVmPool = dao.get ( org.ovirt.engine.core.dao.VmPoolDaoTest.DELETABLE_VM_POOL_ID ) ; newVmPool = new org.ovirt.engine.core.common.businessentities.VmPool ( ) ; newVmPool.setName ( "New VM Pool" ) ; newVmPool.setVmPoolDescription ( "This is a new VM pool." ) ; newVmPool.setClusterId ( org.ovirt.engine.core.dao.VmPoolDaoTest.CLUSTER_ID ) ; newVmPoolMap = new org.ovirt.engine.core.common.businessentities.VmPoolMap ( org.ovirt.engine.core.dao.VmPoolDaoTest.FREE_VM_ID , org.ovirt.engine.core.dao.VmPoolDaoTest.EXISTING_VM_POOL_ID ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "description" , description ) . 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 ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc glusterSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withOptionalParameter ( "snapDescription" , description ) . 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 ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
public static 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 ) ; }

Target:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.ConvertVmCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }

Target:
protected java.lang.String getVmIsBeingImportedMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.ConvertVmCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }
Source:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addNetworks ( java.util.Collections.singletonList ( unlabeledNetwork ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addNetworks ( java.util.Collections.singletonList ( unlabeledNetwork ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter parameter = new org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter ( ) ; parameter.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameter.setName ( "IP" ) ; parameter.setValue ( "192.168.122.2" ) ; parameter.setVmInterfaceId ( FixturesTool.VM_NETWORK_INTERFACE ) ; org.junit.Assert.assertNull ( dao.get ( parameter.getId ( ) ) ) ; dao.save ( parameter ) ; org.junit.Assert.assertEquals ( parameter , dao.get ( parameter.getId ( ) ) ) ; }

Target:
protected int getEntitiesTotalCount ( ) { return org.ovirt.engine.core.dao.FixturesTool.NUMBER_OF_VM_NETWORK_FILTER_PARAMETERS ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void run ( ) { try { org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Start event notification service iteration" ) ; processEvents ( ) ; deleteObsoleteHistoryData ( ) ; org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Finish event notification service iteration" ) ; } catch ( java.lang.Throwable e ) { if ( ! ( java.lang.Thread.interrupted ( ) ) ) { org.ovirt.engine.core.notifier.NotificationService.log.error ( java.lang.String.format ( "Failed to run the service: [%s]" , e.getMessage ( ) ) , e ) ; } } }

Target:
private void markOldEventsAsProcessed ( ) { org.ovirt.engine.core.notifier.NotificationService.log.debug ( "Processing old events" ) ; final int updatedEvents = eventsManager.markOldEventsAsProcessed ( prop.getInteger ( NotificationProperties.DAYS_TO_SEND_ON_STARTUP ) ) ; if ( updatedEvents > 0 ) { org.ovirt.engine.core.notifier.NotificationService.log.debug ( ( updatedEvents + " old records were marked as processed in the \"audit_log\" table." ) ) ; } }
Source:
private void addManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid managementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; allDcNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }

Target:
private void addNonManagementNetworksToPool ( int numberOfNetworks ) { addNetworksToPool ( numberOfNetworks , false ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.String > aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.StringConverter ( ) ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public static org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > [ ] data ( ) { return new org.ovirt.engine.core.bll.CommandBase < ? > [ ] { new org.ovirt.engine.core.bll.CreateSnapshotCommand ( new org.ovirt.engine.core.common.action.ImagesActionsParametersBase ( ) ) , new org.ovirt.engine.core.bll.AddImageFromScratchCommand ( new org.ovirt.engine.core.common.action.AddImageFromScratchParameters ( ) ) } ; }

Target:
public static org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > [ ] data ( ) { return new org.ovirt.engine.core.bll.CommandBase < ? > [ ] { new org.ovirt.engine.core.bll.CreateSnapshotCommand ( new org.ovirt.engine.core.common.action.ImagesActionsParametersBase ( ) ) , new org.ovirt.engine.core.bll.AddImageFromScratchCommand ( new org.ovirt.engine.core.common.action.AddImageFromScratchParameters ( ) ) , new org.ovirt.engine.core.bll.CreateImageTemplateCommand ( new org.ovirt.engine.core.common.action.CreateImageTemplateParameters ( ) ) } ; }
Source:
protected void initPriority ( int priority ) { priorityUtil.initPriority ( priority ) ; }

Target:
protected void initPriority ( int priority ) { priorityUtil.initPriority ( priority , new org.ovirt.engine.ui.uicommonweb.models.vms.PriorityUtil.PriorityUpdatingCallbacks ( ) { @ java.lang.Override public void beforeUpdates ( ) { if ( ( getInstanceTypeManager ( ) ) != null ) { getInstanceTypeManager ( ) . deactivate ( ) ; } } @ java.lang.Override public void afterUpdates ( ) { if ( ( getInstanceTypeManager ( ) ) != null ) { getInstanceTypeManager ( ) . activate ( ) ; } } } ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getQuotaIdForDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) ) != null ) ) { return org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) . getQuotaId ( ) ; } return diskImage.getQuotaId ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaIdForDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) ) != null ) ) { return org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getDiskInfoDestinationMap ( ) . get ( diskImage.getId ( ) ) . getQuotaId ( ) ; } return diskImage.getQuotaId ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertNotNull ( model.getDomain ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( model.getDomain ( ) ) ; verifyLinks ( model ) ; }
Source:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { org.junit.Assert.assertNotNull ( model.getCluster ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage_domain_static domain ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "storage" , domain.getstorage ( ) ) . addValue ( "storage_name" , domain.getstorage_name ( ) ) . addValue ( "storage_type" , domain.getstorage_type ( ) ) . addValue ( "storage_domain_type" , domain.getstorage_domain_type ( ) ) . addValue ( "storage_domain_format_type" , domain.getStorageFormat ( ) ) . addValue ( "last_time_used_as_master" , domain.getLastTimeUsedAsMaster ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "storage" , domain.getstorage ( ) ) . addValue ( "storage_name" , domain.getstorage_name ( ) ) . addValue ( "storage_type" , domain.getstorage_type ( ) ) . addValue ( "storage_domain_type" , domain.getstorage_domain_type ( ) ) . addValue ( "storage_domain_format_type" , domain.getStorageFormat ( ) ) . addValue ( "last_time_used_as_master" , domain.getLastTimeUsedAsMaster ( ) ) ; }
Source:
public void dataCenterVersionMatches ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; org.junit.Assert.assertThat ( validator.dataCenterVersionMismatch ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void dataCenterVersionMatches ( ) { org.mockito.Mockito.when ( cluster.getStoragePoolId ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.StoragePool.class ) ; org.mockito.Mockito.when ( dataCenterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( dataCenter ) ; org.hamcrest.MatcherAssert.assertThat ( validator.dataCenterVersionMismatch ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testFindSingleNotAppropriateDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.eval ( mockNetwork ) ) . thenReturn ( false ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertNull ( actual ) ; }

Target:
public void testFindSingleNotAppropriateDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.test ( mockNetwork ) ) . thenReturn ( false ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertNull ( actual ) ; }