auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.dao.SnapshotDao getSnapshotDao ( ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) ; }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getdescription ( ) , disk.getlast_modified_date ( ) , disk.getappList ( ) ) ) ; } }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . 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.StatusOnlyReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterWebhookDelete ( java.lang.String url ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterEvent.webhookDelete" ) . withParameter ( "url" , url ) . 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.StatusOnlyReturn ( response ) ; }
Source:
protected void onSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.ensureAsyncSearchStopped ( ) ; } }

Target:
protected void onSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.stopRefresh ( ) ; } }
Source:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.pm.StartVdsCommand ( params ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }

Target:
private void initCommand ( ) { org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( ) ; params.setVdsId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_ID ) ; command = new org.ovirt.engine.core.bll.pm.StartVdsCommand ( params ) ; command.setAuditLogDirector ( auditLogDirector ) ; command = org.mockito.Mockito.spy ( command ) ; org.mockito.Mockito.doReturn ( executor ) . when ( command ) . createHostFenceActionExecutor ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.FencingPolicy.class ) ) ; org.mockito.Mockito.doReturn ( vdsBrokerFrontend ) . when ( command ) . getVdsBroker ( ) ; command.setVdsGroupId ( org.ovirt.engine.core.bll.pm.StartVdsCommandTest.FENCECD_HOST_CLUSTER_ID ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > groups = getJdbcTemplate ( ) . query ( query , org.ovirt.engine.core.dao.VdsGroupDaoImpl.VdsGroupRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.VdsGroupDaoImpl.log.error ( "Can't load host and vm count for cluster. Query is '{}'. Error: {}" , query , e.getMessage ( ) ) ; org.ovirt.engine.core.dao.VdsGroupDaoImpl.log.debug ( "Excpetion" , e ) ; } return groups ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > getAllWithQuery ( java.lang.String query ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > groups = getJdbcTemplate ( ) . query ( query , org.ovirt.engine.core.dao.ClusterDaoImpl.ClusterRowMapper.instance ) ; try { return getHostsAndVmsForClusters ( groups ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dao.ClusterDaoImpl.log.error ( "Can't load host and vm count for cluster. Query is '{}'. Error: {}" , query , e.getMessage ( ) ) ; org.ovirt.engine.core.dao.ClusterDaoImpl.log.debug ( "Excpetion" , e ) ; } return groups ; }
Source:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setFile ( null ) ; try { resource.update ( cdrom ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "update" , "file" ) ; } }

Target:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setFile ( null ) ; try { resource.update ( cdrom ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "update" , "file" ) ; } }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.VmPool entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPoolById , org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters.class , new java.lang.String [ ] { "PoolId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.VmPool entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getDbFacade ( ) . getVmDao ( ) . getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; updateVmInit ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = vmDao.getAllForUserWithGroupsAndUserRoles ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getUserID ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmList ) { updateVmGuestAgentVersion ( vm ) ; if ( org.ovirt.engine.core.bll.GetUserVmsByUserIdAndGroupsQuery.getParameters ( ) . getIncludeDiskData ( ) ) { updateDisksFromDB ( vm ) ; updateVmInit ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; fillImagesBySnapshots ( vm ) ; } } setReturnValue ( vmList ) ; }
Source:
private void setConsoleHelpers ( ) { this . consoleUtils = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) ) ) ; this . consoleManager = ( ( org.ovirt.engine.ui.uicommonweb.ConsoleManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) ) ) ; this . errorPopupManager = ( ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager ) ( org.ovirt.engine.ui.uicommonweb.TypeResolver.getInstance ( ) . resolve ( org.ovirt.engine.ui.uicommonweb.ErrorPopupManager.class ) ) ) ; }

Target:
private void onClone ( ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.CloneVmModel ) ( getWindow ( ) ) ) . onClone ( this , false ) ; }
Source:
public void validateDiskIsLocked ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateVmIsNotDown ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
private void mockIsValidVdsCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.TRUE ) ; org.mockito.Mockito.doReturn ( returnValue ) . when ( command ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.IsValid ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ; }

Target:
private void mockStoragePoolDAO ( ) { org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storage_pool ) ; }
Source:
public static void GetDiskMaxSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }

Target:
public java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , storageDomainDao.get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void 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 canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableCowDisk ( ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; initializeCommand ( parameters ) ; mockVmStatusUp ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT.toString ( ) ) ) ; }

Target:
public void canDoActionFailedShareableDiskVolumeFormatUnsupported ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.setDiskInfo ( createShareableDisk ( VolumeFormat.COW ) ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; initializeCommand ( parameters ) ; mockVmStatusDown ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT.toString ( ) ) ) ; }
Source:
public void prepareMembers ( ) { oldNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , NfsVersion.V4 , 50 , 0 ) ; oldPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.POSIXFS , "nfs" , "timeo=30" ) ; prepareMocks ( ) ; }

Target:
public void isConnWithSameDetailsExistBlockDomains ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( connection1 ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retVal = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CancelMigrate , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getRunOnVds ( ) . getValue ( ) , org.ovirt.engine.core.bll.CancelMigrateVmCommand.getParameters ( ) . getVmId ( ) ) ) ; setSucceeded ( retVal.getSucceeded ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warnFormat ( "VM {0} doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) return snapshot ; } org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "VM '{}' doesn't have active snapshot in export domain" , getVmId ( ) ) ; return null ; }
Source:
private org.ovirt.engine.core.common.action.VdcActionParametersBase setReinitializeSysPrep ( org.ovirt.engine.core.common.action.RunVmOnceParams params ) { org.ovirt.engine.api.model.VM vm = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( guid ) , "VM" ) ; if ( ( vm.getVmOs ( ) . isWindows ( ) ) && ( vm.getIsFirstRun ( ) ) ) { params.setReinitialize ( true ) ; } return params ; }

Target:
private org.ovirt.engine.core.common.action.VdcActionParametersBase setReinitializeSysPrep ( org.ovirt.engine.core.common.action.RunVmOnceParams params ) { org.ovirt.engine.api.model.VM vm = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( guid ) , "VM" ) ; if ( ( vm.getVmOs ( ) . isWindows ( ) ) && ( vm.isFirstRun ( ) ) ) { params.setReinitialize ( true ) ; } return params ; }
Source:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only two attachable disks" , 3 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { actualFloatingDiskIds.add ( disk.getId ( ) ) ; } org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }

Target:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only three attachable disks" , 3 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : disks ) { actualFloatingDiskIds.add ( disk.getId ( ) ) ; } org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) ) . addV2VJobForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( clientAgentType.isIE8OrBelow ( ) ) { Window.Location.reload ( ) ; } frontend.clearLoggedInUser ( ) ; getLoginModel ( ) . resetAfterLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.clearCache ( ) ; connectAutomaticallyManager.resetAlreadyOpened ( ) ; org.ovirt.engine.ui.userportal.system.ApplicationInit.super . onLogout ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { if ( clientAgentType.isIE8OrBelow ( ) ) { Window.Location.reload ( ) ; } frontend.clearLoggedInUser ( ) ; performLogout ( ) ; connectAutomaticallyManager.resetAlreadyOpened ( ) ; }
Source:
protected org.ovirt.engine.core.utils.lock.EngineLock lockVmDiskHotPlugWithWait ( ) { org.ovirt.engine.core.utils.lock.EngineLock vmDiskHotPlugEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; vmDiskHotPlugEngineLock.setExclusiveLocks ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_DISK_HOT_PLUG , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ) ; org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getLockManager ( ) . acquireLockWait ( vmDiskHotPlugEngineLock ) ; return vmDiskHotPlugEngineLock ; }

Target:
protected org.ovirt.engine.core.utils.lock.EngineLock lockVmDiskHotPlugWithWait ( ) { org.ovirt.engine.core.utils.lock.EngineLock vmDiskHotPlugEngineLock = new org.ovirt.engine.core.utils.lock.EngineLock ( ) ; vmDiskHotPlugEngineLock.setExclusiveLocks ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.storage.disk.AbstractDiskVmCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM_DISK_HOT_PLUG , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ) ; lockManager.acquireLockWait ( vmDiskHotPlugEngineLock ) ; return vmDiskHotPlugEngineLock ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_1 ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusUp ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; vm.setVmOs ( 8 ) ; vm.setId ( vmId ) ; vm.setClusterCompatibilityVersion ( Version.v3_1 ) ; vm.setRunOnVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( command ) . getVmDao ( ) ; mockVMDao ( vm ) ; return vm ; }
Source:
private void commonInitialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; updateDatacenters ( ) ; }

Target:
private void commonInitialize ( ) { super . initialize ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand onSaveCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; onSaveCommand.setTitle ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.constants.ok ( ) ) ; onSaveCommand.setIsDefault ( true ) ; getCommands ( ) . add ( onSaveCommand ) ; getCommands ( ) . add ( getCancelCommand ( ) ) ; updateDatacenters ( ) ; }
Source:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = runVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.VdcBLLException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.VdcFault ( e , ( ( org.ovirt.engine.core.common.errors.VdcBLLException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }

Target:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = runVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.EngineException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.VdcFault ( e , ( ( org.ovirt.engine.core.common.errors.EngineException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }
Source:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Collections.singletonList ( slave ) ) . setHost ( host ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( object.getEntity ( ) ) ) . getSize ( ) ; } return null ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.RepoImage ) { return ( ( org.ovirt.engine.core.common.businessentities.RepoImage ) ( object.getEntity ( ) ) ) . getSize ( ) ; } else if ( ( object.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object.getEntity ( ) ) ) . getSizeInGigabytes ( ) ; } return null ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > aQuery , java.lang.String storageDomainName ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( java.lang.String networkName ) { return new org.ovirt.engine.core.common.businessentities.network.Network ( "" , "" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , networkName , "" , "" , 0 , null , false , 0 , true ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network createNetwork ( java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.Network net = new org.ovirt.engine.core.common.businessentities.network.Network ( "" , "" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , networkName , "" , "" , 0 , null , false , 0 , true ) ; net.setCluster ( new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ) ; return net ; }
Source:
protected org.ovirt.engine.core.compat.Guid removeConfImage ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { org.ovirt.engine.core.compat.Guid taskId2 = enclosingCommand.persistAsyncTaskPlaceHolder ( VmCommand.DELETE_SECONDARY_IMAGES_TASK_KEY ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , buildDeleteMemoryConfParams ( guids ) ) ; if ( ! ( vdsRetValue.getSucceeded ( ) ) ) { return null ; } org.ovirt.engine.core.compat.Guid guid2 = enclosingCommand.createTask ( taskId2 , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid2 ) ; return guid2 ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue removeImage ( org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , parameters ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { if ( ( e.getErrorCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ) { return createImageDoesNotExistInDomainReturnValue ( ) ; } throw e ; } }
Source:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }

Target:
protected javax.ws.rs.core.Response doAdd ( org.ovirt.engine.api.model.Snapshot snapshot , boolean block ) { validateParameters ( snapshot , "description" ) ; org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters snapshotParams = new org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters ( parentId , snapshot.getDescription ( ) ) ; if ( snapshot.isSetPersistMemorystate ( ) ) { snapshotParams.setSaveMemory ( snapshot.isPersistMemorystate ( ) ) ; } return performCreate ( VdcActionType.CreateAllSnapshotsFromVm , snapshotParams , new org.ovirt.engine.api.restapi.resource.BackendSnapshotsResource.SnapshotIdResolver ( ) , block ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingVm = createVm ( existingVmId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelperTest.EXISTING_VM_NAME ) ; existingDiskImage = createDiskImage ( existingImageId , existingImageGroupId ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDAOMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingVm = createVm ( existingVmId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelperTest.EXISTING_VM_NAME ) ; existingDiskImage = createDiskImage ( existingImageId , existingImageGroupId ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDaoMocks ( ) ; }
Source:
public void canDoActionThinProvisioningSpaceCheckFailsSize ( ) { final int availableSize = 4 ; final int usedSize = 6 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) { if ( sender == ( getNetworkList ( ) ) ) { networkList_SelectedItemChanged ( ) ; } } else if ( ev.matchesDefinition ( EntityModel.entityChangedEventDefinition ) ) { if ( sender == ( getNetworkSelectedName ( ) ) ) { networkSelectedName_SelectionChanged ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) { if ( sender == ( getNetworkList ( ) ) ) { networkList_SelectedItemChanged ( ) ; } } else if ( ev.matchesDefinition ( EntityModel.entityChangedEventDefinition ) ) { if ( sender == ( getNetworkSelectedName ( ) ) ) { networkSelectedName_SelectionChanged ( ) ; } else if ( sender == ( getPasswordSet ( ) ) ) { passwordSetChanged ( ) ; } } }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . loadJobSteps ( job ) ; } org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.job.Job > jobs = jobDao.getJobsByCorrelationId ( org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getParameters ( ) . getCorrelationId ( ) ) ; for ( org.ovirt.engine.core.common.job.Job job : jobs ) { jobRepository.loadJobSteps ( job ) ; } org.ovirt.engine.core.bll.GetJobsByCorrelationIdQuery.getQueryReturnValue ( ) . setReturnValue ( jobs ) ; }
Source:
private static void AddGroupToUser ( org.ovirt.engine.core.common.businessentities.AdUser user , java.lang.String groupName ) { if ( ! ( user.getGroups ( ) . containsKey ( groupName ) ) ) { org.ovirt.engine.core.common.businessentities.ad_groups group = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . getByName ( groupName ) ; if ( group != null ) { user.getGroups ( ) . put ( groupName , group ) ; } else { user.getGroups ( ) . put ( groupName , new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ) ; } } }

Target:
private static void AddGroupToUser ( org.ovirt.engine.core.common.businessentities.LdapUser user , java.lang.String groupName ) { if ( ! ( user.getGroups ( ) . containsKey ( groupName ) ) ) { org.ovirt.engine.core.common.businessentities.LdapGroup group = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAdGroupDao ( ) . getByName ( groupName ) ; if ( group != null ) { user.getGroups ( ) . put ( groupName , group ) ; } else { user.getGroups ( ) . put ( groupName , new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ) ; } } }