auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static final java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomainById ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > source , final org.ovirt.engine.core.compat.Guid id ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.StorageDomain source ) { return source.getId ( ) . equals ( id ) ; } } ) ; }

Target:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.StorageDomain > findAllStorageDomainsBySharedStatus ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > items , final org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.StorageDomain i ) { return ( i.getStorageDomainSharedStatus ( ) ) == status ; } } ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( getRestModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmTemplate , org.ovirt.engine.core.common.action.UpdateVmTemplateParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( getRestModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void auditLog ( java.util.Map < java.lang.String , java.lang.String > customValues , org.ovirt.engine.core.common.AuditLogType auditLogType ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > customValue : customValues.entrySet ( ) ) { auditLogableBase.addCustomValue ( customValue.getKey ( ) , customValue.getValue ( ) ) ; } getAuditLogDirector ( ) . log ( auditLogableBase , auditLogType ) ; }

Target:
private void auditLog ( java.util.Map < java.lang.String , java.lang.String > customValues , org.ovirt.engine.core.common.AuditLogType auditLogType ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > customValue : customValues.entrySet ( ) ) { auditLogableBase.addCustomValue ( customValue.getKey ( ) , customValue.getValue ( ) ) ; } getAuditLogDirector ( ) . log ( auditLogableBase , auditLogType ) ; }
Source:
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 ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSParametersBase createVDSParameters ( ) { return org.ovirt.engine.core.bll.storage.domain.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:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( org.ovirt.engine.core.compat.Guid guid ) { org.ovirt.engine.core.common.action.IdParameters param = new org.ovirt.engine.core.common.action.IdParameters ( guid ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param , null ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doReturn ( quotaManager ) . when ( command ) . getQuotaManager ( ) ; return command ; }

Target:
public void testExecuteCommand ( ) throws java.lang.Exception { command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; }
Source:
public void testAddUser_3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }

Target:
public void testAddUser3 ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDomainList , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; setUpAddUserExpectations ( ( ( ( "ADUSER@" + ( DOMAIN ) ) + ":: username=" ) + ( NAMES [ 0 ] ) ) ) ; org.ovirt.engine.api.model.User model = new org.ovirt.engine.api.model.User ( ) ; model.setUserName ( ( ( ( NAMES [ 0 ] ) + "@" ) + ( DOMAIN ) ) ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; verifyAddUser ( response ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getDeviceList" ) . withParameter ( "storageType" , storageType ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseType ( java.lang.Object [ ] . class ) . withResponseKey ( "devList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc teardownImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Image.teardown" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "leafVolID" , volumeID ) . 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.irsbroker.StatusReturnForXmlRpc ( response ) ; }
Source:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }

Target:
public boolean validate ( ) { getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getName ( ) . getIsValid ( ) ) && ( getCustomPropertySheet ( ) . validate ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotCreateReturnForXmlRpc ( vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
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 < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public 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:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; setBrickListModel ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickListModel ( ) ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel ( ) ) ; list.add ( getBrickListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeGeneralModel volumeGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel volumeParameterListModel , final org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel < org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel > permissionListModel , final org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel volumeEventListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( volumeGeneralModel ) ; list.add ( volumeParameterListModel ) ; list.add ( getBrickListModel ( ) ) ; list.add ( getGeoRepListModel ( ) ) ; list.add ( permissionListModel ) ; list.add ( volumeEventListModel ) ; setDetailModels ( list ) ; }
Source:
public java.lang.String render ( java.lang.Object [ ] arg ) { java.lang.Object entity = arg [ 0 ] ; org.ovirt.engine.core.compat.Guid objectGuid = ( ( org.ovirt.engine.core.compat.Guid ) ( arg [ 1 ] ) ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetEntityGuid ( entity ) . equals ( objectGuid ) ) { return "" ; } java.lang.String ownerName = ( ( java.lang.String ) ( arg [ 2 ] ) ) ; return ownerName ; }

Target:
public java.lang.String render ( java.lang.Object [ ] arg ) { java.lang.Object entity = arg [ 0 ] ; org.ovirt.engine.core.compat.Guid objectGuid = ( ( org.ovirt.engine.core.compat.Guid ) ( arg [ 1 ] ) ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getEntityGuid ( entity ) . equals ( objectGuid ) ) { return "" ; } java.lang.String ownerName = ( ( java.lang.String ) ( arg [ 2 ] ) ) ; return ownerName ; }
Source:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateDestDomainsSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateQuota ( ) ; org.mockito.Mockito.doReturn ( ActionType.LiveMigrateDisk ) . when ( command ) . getActionType ( ) ; }

Target:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateDestDomainsSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateQuota ( ) ; org.mockito.Mockito.doReturn ( ActionType.LiveMigrateDisk ) . when ( command ) . getActionType ( ) ; }
Source:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { struct.put ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.put ( VdsProperties.Index , "0" ) ; struct.put ( VdsProperties.INTERFACE , VdsProperties.Fdc ) ; struct.put ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.put ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }

Target:
private void buildSmartcardDevice ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map struct = new java.util.HashMap ( ) ; struct.put ( VdsProperties.Type , vmDevice.getType ( ) . getValue ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getType ( ) ) ; addDevice ( struct , vmDevice , null ) ; } }
Source:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) == ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) ) ) ) { org.ovirt.engine.core.compat.Guid quotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; if ( ! ( Guid.Empty.equals ( quotaId ) ) ) { return quotaId ; } } return null ; }

Target:
private org.ovirt.engine.core.compat.Guid getQuotaId ( ) { if ( ( ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) != null ) && ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getDiskStorageType ( ) . isInternal ( ) ) ) { org.ovirt.engine.core.compat.Guid quotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) ) ) . getQuotaId ( ) ; if ( ! ( Guid.Empty.equals ( quotaId ) ) ) { return quotaId ; } } return null ; }
Source:
public void testRemoveIfUnusedWithUnused ( ) { prepareDao ( ) . removeIfUnused ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; final org.ovirt.engine.core.common.businessentities.VmIcon nothing = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( nothing ) ; }

Target:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; dao.removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = dao.get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = dao.get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }
Source:
private boolean balloonEnabled ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { return ( model.getMemoryBalloonDeviceEnabled ( ) . getEntity ( ) ) && ( ( model.getSelectedCluster ( ) . getcompatibility_version ( ) . compareTo ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ) ; }

Target:
private void onConfigureVmsToImport ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel importVmsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; if ( importVmsModel == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmFromExportDomainModel model = importVmsModel.getSpecificImportModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.setWindow ( null ) ; setWindow ( model ) ; }
Source:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { org.junit.Assert.assertEquals ( "There should be only four attachable disks" , 4 , disks.size ( ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID , FixturesTool.FLOATING_CINDER_DISK_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = disks.stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; org.junit.Assert.assertEquals ( "Wrong attachable disks" , expectedFloatingDiskIds , actualFloatingDiskIds ) ; }

Target:
private static void assertFullGetAllAttachableDisksByPoolId ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { org.junit.jupiter.api.Assertions.assertEquals ( 4 , disks.size ( ) , "There should be only four attachable disks" ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > expectedFloatingDiskIds = new java.util.HashSet ( java.util.Arrays.asList ( FixturesTool.FLOATING_DISK_ID , FixturesTool.FLOATING_LUN_ID , FixturesTool.FLOATING_CINDER_DISK_ID ) ) ; java.util.Set < org.ovirt.engine.core.compat.Guid > actualFloatingDiskIds = disks.stream ( ) . map ( BaseDisk :: getId ) . collect ( java.util.stream.Collectors.toSet ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedFloatingDiskIds , actualFloatingDiskIds , "Wrong attachable disks" ) ; }
Source:
public void testGuestAgentStatus ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = dao.get ( vmId ) ; vmDynamic.setGuestAgentStatus ( GuestAgentStatus.UpdateNeeded ) ; dao.update ( vmDynamic ) ; vmDynamic = dao.get ( vmId ) ; org.junit.Assert.assertEquals ( vmDynamic.getGuestAgentStatus ( ) . getValue ( ) , GuestAgentStatus.UpdateNeeded.getValue ( ) ) ; }

Target:
public void testGuestAgentStatus ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_RHEL5_POOL_51 ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = dao.get ( vmId ) ; vmDynamic.setGuestAgentStatus ( GuestAgentStatus.UpdateNeeded ) ; dao.update ( vmDynamic ) ; vmDynamic = dao.get ( vmId ) ; org.junit.Assert.assertEquals ( vmDynamic.getGuestAgentStatus ( ) . getValue ( ) , GuestAgentStatus.UpdateNeeded.getValue ( ) ) ; }
Source:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getsize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }

Target:
public double getDiskSize ( ) { if ( ( diskSize ) == 0 ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : getDiskMap ( ) . values ( ) ) { if ( ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) == ( disk.getDiskStorageType ( ) ) ) { diskSize += ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getSize ( ) ) / ( java.lang.Double.valueOf ( ( ( 1024 * 1024 ) * 1024 ) ) ) ; } } } return diskSize ; }
Source:
public void testUpdateStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics before = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; before.setUsageMemPercent ( 17 ) ; before.setDisksUsage ( "java.util.map { [ ] }" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VmStatistics after = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.EXISTING_VM_ID ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testRemoveStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics before = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.junit.Assert.assertNotNull ( before ) ; dao.remove ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.ovirt.engine.core.common.businessentities.VmStatistics after = dao.get ( FixturesTool.VM_RHEL5_POOL_57 ) ; org.junit.Assert.assertNull ( after ) ; }
Source:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( org.ovirt.engine.core.common.businessentities.VM.isStatusUpOrPaused ( vm.getStatus ( ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }

Target:
public static boolean IsVmRunning ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { return ( vm.isRunningOrPaused ( ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ; } return false ; }
Source:
public static org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageServerConnectionExtensionDao ( ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isConnectionExtensionExists ( org.ovirt.engine.core.compat.Guid connExtId ) { org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension connExt = getDbFacade ( ) . getStorageServerConnectionExtensionDao ( ) . get ( connExtId ) ; if ( connExt == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_EXTENSION_DOES_NOT_EXIST , java.lang.String.format ( "$%1$s %2$s" , "connExtId" , connExtId.toString ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list ) { if ( ( list == null ) || ( ( list.size ( ) ) == 0 ) ) { return new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; } java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > balancePolicyUnits = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : list ) { if ( policyUnit.isBalanceImplemeted ( ) ) { balancePolicyUnits.add ( policyUnit ) ; } } return balancePolicyUnits ; }

Target:
private java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > getBalancePolicyUnits ( java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > list ) { if ( ( list == null ) || ( ( list.size ( ) ) == 0 ) ) { return new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; } java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > balancePolicyUnits = new java.util.ArrayList < org.ovirt.engine.core.common.scheduling.PolicyUnit > ( ) ; for ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit : list ) { if ( ( policyUnit.getPolicyUnitType ( ) ) == ( org.ovirt.engine.core.common.scheduling.PolicyUnitType.LoadBalancing ) ) { balancePolicyUnits.add ( policyUnit ) ; } } return balancePolicyUnits ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , network , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsNone ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( false , true , true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
private static void MovePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool , boolean resetSpmInDB ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; if ( resetSpmInDB ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDAO ( ) . update ( storagePool ) ; } }

Target:
private static void MovePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool , boolean resetSpmInDB ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; if ( resetSpmInDB ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }
Source:
public static void getMaxNumOfVmSockets ( 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getSpiceUsbAutoShare ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getHostPublicKey ( 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.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDataCenterById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected void endWithFailure ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentCommand ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getParentParameters ( ) , org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.cloneContextAndDetachFromParent ( ) ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { removeRedundantVolumesForOrphanedDisks ( ) ; if ( ! ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . isParentHasTasks ( ) ) ) { unlockSnapshot ( org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.getParameters ( ) . getSnapshot ( ) . getId ( ) ) ; super . endSuccessfully ( ) ; } org.ovirt.engine.core.bll.storage.disk.cinder.RestoreAllCinderSnapshotsCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.RepoImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.RepoImage entity = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; entity.setRepoDomainId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "storage_domain_id" ) ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.ImageFileType.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.RepoImage mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.RepoImage entity = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; entity.setRepoDomainId ( getGuidDefaultEmpty ( rs , "storage_domain_id" ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.ImageFileType.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }
Source:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = getNetworkDAO ( ) . getAllForCluster ( vds.getvds_group_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getvds_group_id ( ) , net ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = getNetworkDAO ( ) . getAllForCluster ( vds.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( vds.getVdsGroupId ( ) , net ) ; } return null ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; validateAccessControl ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }
Source:
public void testRemoveQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertNotNull ( quota ) ; dao.remove ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertEquals ( null , dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaVdsGroupByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaStorageByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; }

Target:
public void testRemoveQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertNotNull ( quota ) ; dao.remove ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.junit.Assert.assertEquals ( null , dao.getById ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaClusterByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; org.junit.Assert.assertEquals ( 0 , dao.getQuotaStorageByQuotaGuid ( FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) . size ( ) ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { populateProfiles ( ( ( java.util.List < org.ovirt.engine.core.aaa.ProfileEntry > ) ( result ) ) ) ; getProfile ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { populateNamespaces ( ) ; } } ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { setProfileEntries ( ( ( java.util.List < org.ovirt.engine.core.aaa.ProfileEntry > ) ( result ) ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAAANamespaces ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { namespacesMap = ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( result ) ) ; populateProfiles ( getProfileEntries ( ) ) ; } } ) ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , org.ovirt.engine.core.common.businessentities.VM value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( getTemplate ( ) . id ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( getElementIdPrefix ( ) , getColumnId ( ) , context ) ) ) ; for ( com.google.gwt.cell.client.HasCell < org.ovirt.engine.core.common.businessentities.VM , ? > hasCell : hasCells ) { render ( context , value , sb , hasCell ) ; } sb.appendHtmlConstant ( "</div>" ) ; }

Target:
public void render ( com.google.gwt.cell.client.Cell.Context context , C value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { sb.append ( getTemplate ( ) . id ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( org.ovirt.engine.ui.common.widget.table.cell.StatusCompositeCellWithElementId.getElementIdPrefix ( ) , org.ovirt.engine.ui.common.widget.table.cell.StatusCompositeCellWithElementId.getColumnId ( ) , context ) ) ) ; for ( com.google.gwt.cell.client.HasCell < C , ? > hasCell : hasCells ) { render ( context , value , sb , hasCell ) ; } sb.appendHtmlConstant ( "</div>" ) ; }
Source:
public void clearPoolTimers ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( "clear domain error-timers for pool '{}'." , _storagePoolId ) ; for ( java.lang.String jobId : _timers.values ( ) ) { try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( "failed deleting job '{}'." , jobId ) ; } } }

Target:
public void clearPoolTimers ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.info ( "clear domain error-timers for pool '{}'." , _storagePoolId ) ; for ( java.lang.String jobId : _timers.values ( ) ) { try { getSchedulUtil ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData.log.warn ( "failed deleting job '{}'." , jobId ) ; } } }
Source:
public void doTestRegister ( org.ovirt.engine.api.model.Cluster cluster , boolean importAsNewEntity ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ImportVmFromConfiguration , org.ovirt.engine.core.common.action.ImportVmParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "VdsGroupId" , "ImportAsNewEntity" , "ImagesExistOnTargetStorageDomain" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.VM_ID , GUIDS [ 3 ] , GUIDS [ 1 ] , importAsNewEntity , true } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setCluster ( cluster ) ; action.setClone ( importAsNewEntity ) ; verifyActionResponse ( resource.register ( action ) ) ; }

Target:
public void doTestRegister ( org.ovirt.engine.core.common.businessentities.Cluster cluster , boolean importAsNewEntity ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.ImportVmFromConfiguration , org.ovirt.engine.core.common.action.ImportVmParameters.class , new java.lang.String [ ] { "ContainerId" , "StorageDomainId" , "ClusterId" , "ImportAsNewEntity" , "ImagesExistOnTargetStorageDomain" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.VM_ID , GUIDS [ 3 ] , GUIDS [ 1 ] , importAsNewEntity , true } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setCluster ( cluster ) ; action.setClone ( importAsNewEntity ) ; verifyActionResponse ( resource.register ( action ) ) ; }