auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean registerLibvirtSecretsImpl ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; return returnValue.getSucceeded ( ) ; }

Target:
private boolean registerLibvirtSecretsImpl ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets , boolean clearUnusedSecrets ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = backend.getResourceManager ( ) . runVdsCommand ( VDSCommandType.RegisterLibvirtSecrets , new org.ovirt.engine.core.common.vdscommands.RegisterLibvirtSecretsVDSParameters ( vds.getId ( ) , libvirtSecrets , clearUnusedSecrets ) ) ; return returnValue.getSucceeded ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc heartBeat ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.ping" ) . 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 copyData ( java.util.Map src , java.util.Map dst , boolean collapse ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.copyData" ) . withParameter ( "srcImage" , src ) . withParameter ( "dstImage" , dst ) . withParameter ( "collapse" , collapse ) . 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 testExecuteCommand ( ) { setVolume ( volumeWithRemoveBricksTask ) ; mockBackend ( true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . endStepJobCommitted ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_COMMIT , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void testExecuteCommand ( ) { setVolume ( volumeWithRemoveBricksTask ) ; mockBackend ( true , null ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . endStepJobCommitted ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 1 ) ) . releaseVolumeLock ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_COMMIT , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmNotHavingDeviceSnapshotsAttachedToOtherVms ( boolean onlyPlugged ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = getDbFacade ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) ; org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( vmDisks , true , false , true ) ) . diskImagesSnapshotsNotAttachedToOtherVms ( onlyPlugged ) ; if ( result != ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ) { return result ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmNotHavingDeviceSnapshotsAttachedToOtherVms ( boolean onlyPlugged ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > vmDisks = getDbFacade ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) ; org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( vmDisks , true , false , true ) ) . diskImagesSnapshotsNotAttachedToOtherVms ( onlyPlugged ) ; if ( result != ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ) { return result ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }
Source:
public void getLabelList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllLabels , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setArchitecture ( ArchitectureType.undefined ) ; group.setClusterPolicyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; group.setMaxVdsMemoryOverCommit ( 100 ) ; return group ; }
Source:
protected void updateStorageDomains ( final org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { }

Target:
protected void updateStorageDomains ( final org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getStorageDomainById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( returnValue ) ) ; diskModel.getStorageDomain ( ) . setSelectedItem ( storageDomain ) ; } } ) , getStorageDomainId ( ) ) ; }
Source:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public 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 ) ; }
Source:
public 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 < > ( ( ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cluster model = new org.ovirt.engine.api.model.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster model = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getLunIdColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getLUN_id ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getLunIdColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( object ) ) . getLun ( ) . getLUNId ( ) : null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void testGetAllForVdsGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForVdsGroup ( existingVds.getVdsGroupId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getVdsGroupId ( ) , vds.getVdsGroupId ( ) ) ; } }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllForCluster ( existingVds.getClusterId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getClusterId ( ) , vds.getClusterId ( ) ) ; } }
Source:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . translateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( backend.getVdsErrorsTranslator ( ) . translateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSParametersBase createVDSParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.DestroyImageVDSCommandParameters ( org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getImageList ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . isPostZero ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . isForce ( ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSParametersBase createVDSParameters ( ) { return org.ovirt.engine.core.bll.storage.PostZeroHandler.fixParametersWithPostZero ( new org.ovirt.engine.core.common.vdscommands.DestroyImageVDSCommandParameters ( org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . getImageList ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . isPostZero ( ) , org.ovirt.engine.core.bll.DestroyImageCommand.getParameters ( ) . isForce ( ) ) ) ; }
Source:
public static void beforeClass ( ) throws java.io.UnsupportedEncodingException { org.ovirt.engine.core.notifier.utils.NotificationProperties.release ( ) ; org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "conf/notifier-prop-test.conf" ) . getPath ( ) , "UTF-8" ) , "" ) ; org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop = org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ; org.junit.Assert.assertNotNull ( org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop ) ; }

Target:
public static void beforeClass ( ) throws java.io.UnsupportedEncodingException { org.ovirt.engine.core.notifier.utils.NotificationProperties.release ( ) ; org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "conf/notifier-prop-test.conf" ) . getPath ( ) , "UTF-8" ) , "" ) ; org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop = org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop ) ; }
Source:
protected void setupExportModel ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model ) { super . setupExportModel ( model ) ; model.getCollapseSnapshots ( ) . setIsAvailable ( false ) ; }

Target:
protected void setupExportModel ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model ) { super . setupExportModel ( model ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . exportTemplateTitle ( ) ) ; model.setHelpTag ( HelpTag.export_template ) ; model.setHashName ( "export_template" ) ; model.getCollapseSnapshots ( ) . setIsAvailable ( false ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotDeleteAll" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDeleteAll ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotDeleteAll" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { java.lang.String value = "" ; if ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; java.util.ArrayList < java.lang.String > quotaNamesArr = diskImage.getQuotaNames ( ) ; if ( quotaNamesArr != null ) { value = org.ovirt.engine.core.compat.StringHelper.join ( ", " , quotaNamesArr.toArray ( ) ) ; } } return value ; }
Source:
public static void GetDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , params , aQuery ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void setUp ( ) { setXmlResponse ( "vms" , 200 , "<vms/>" ) ; setXmlResponse ( "vms/123" , 200 , "<vm id=\"123\"><name>testvm</name></vm>" ) ; startServer ( ) ; connection = testConnection ( ) ; vmsService = connection.systemService ( ) . vmsService ( ) ; }

Target:
public void setUp ( ) { setXmlResponse ( "vms" , 200 , "<vms/>" ) ; setXmlResponse ( "vms/123" , 200 , "<vm id=\"123\"><name>testvm</name></vm>" ) ; setXmlResponse ( "vms/456" , 404 , "" ) ; startServer ( ) ; connection = testConnection ( ) ; vmsService = connection.systemService ( ) . vmsService ( ) ; }
Source:
public void testSaveMemoryPciPassthroughFailure ( ) { cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotsForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ; }

Target:
public void testSaveMemoryPciPassthroughFailure ( ) { cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ; }
Source:
protected void executeVDSCommand ( ) { vmManager.lock ( ) ; try { executeVmCommand ( ) ; updateVmDataChangedTime ( ) ; } finally { vmManager.unlock ( ) ; } }

Target:
protected void executeVDSCommand ( ) { vmManager = resourceManager.getVmManager ( org.ovirt.engine.core.vdsbroker.ManagingVmCommand.getParameters ( ) . getVmId ( ) ) ; vmManager.lock ( ) ; try { executeVmCommand ( ) ; vmManager.updateVmDataChangedTime ( ) ; } finally { vmManager.unlock ( ) ; } }
Source:
public static void GetDataCenterListByName ( 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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void IsSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.ProcessOvfUpdateForStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.ProcessOvfUpdateForStoragePoolParameters ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; parameters.setUpdateStorage ( false ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalActionWithTasksContext ( VdcActionType.ProcessOvfUpdateForStorageDomain , createProcessOvfUpdateForDomainParams ( ) , null ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalActionWithTasksContext ( VdcActionType.ProcessOvfUpdateForStorageDomain , createProcessOvfUpdateForDomainParams ( ) , null ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDAO ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }

Target:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createShareableCowDisk ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setvolume_format ( VolumeFormat.COW ) ; disk.setShareable ( true ) ; return disk ; }

Target:
public void nullifiedSnapshotOnUpdateDiskToShareable ( ) { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.RAW ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = createDiskImage ( ) ; oldDisk.setvm_snapshot_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( oldDisk ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( ( ( oldDisk.getvm_snapshot_id ( ) ) == null ) ) ; }
Source:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.VdsGroups.name ( ) . toLowerCase ( ) , getVdsGroupName ( ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) == null ? "" : org.ovirt.engine.core.bll.ImportVmCommand.getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.VdsGroups.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroupName ( ) ) ; } return jobProperties ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; setActionReturnValue ( watchdogDevice.getId ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; setActionReturnValue ( watchdogDevice.getId ( ) . getDeviceId ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storageDomainList.size ( ) ) != 0 ) { model.getStorageTypeList ( ) . setChangeProhibitionReason ( "Cannot change Repository type with Storage Domains attached to it" ) ; model.getStorageTypeList ( ) . setIsChangable ( false ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomainList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storageDomainList.size ( ) ) != 0 ) { model.getStorageTypeList ( ) . setChangeProhibitionReason ( constants.cannotChangeRepositoryTypeWithSDAttached ( ) ) ; model.getStorageTypeList ( ) . setIsChangable ( false ) ; } }
Source:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void 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.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
public static boolean isNumOfMonitorsLegal ( org.ovirt.engine.core.common.businessentities.GraphicsType graphicsType , int numOfMonitors , java.util.List < java.lang.String > reasons ) { boolean legal = false ; if ( graphicsType == ( org.ovirt.engine.core.common.businessentities.GraphicsType.VNC ) ) { legal = numOfMonitors <= 1 ; } else if ( graphicsType == ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ) { legal = numOfMonitors <= ( org.ovirt.engine.core.bll.VmHandler.getMaxNumberOfMonitors ( ) ) ; } if ( ! legal ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS.toString ( ) ) ; } return legal ; }

Target:
public static boolean isNumOfMonitorsLegal ( java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes , int numOfMonitors , java.util.List < java.lang.String > reasons ) { boolean legal = false ; if ( graphicsTypes.contains ( GraphicsType.VNC ) ) { legal = numOfMonitors <= 1 ; } else if ( graphicsTypes.contains ( GraphicsType.SPICE ) ) { legal = numOfMonitors <= ( org.ovirt.engine.core.bll.VmHandler.getMaxNumberOfMonitors ( ) ) ; } if ( ! legal ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS.toString ( ) ) ; } return legal ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; cretaeVirtIODisk ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.< java.lang.String > emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( osRepository.getDiskHotpluggableInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.< java.lang.String > emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
public void testChangeValueAfterAdd ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.addTag ( tag ) ; tag.settag_name ( "tag2" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.getTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( "tag1" , tagFromDirector.gettag_name ( ) ) ; }

Target:
public void testChangeValueAfterAdd ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; tagsDirector.addTag ( tag ) ; tag.setTagName ( "tag2" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.getTagById ( tag.getTagId ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( "tag1" , tagFromDirector.getTagName ( ) ) ; }