auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand < org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }

Target:
private void createCommand ( ) { org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase params = new org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase ( ) ; params.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; params.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.ActivateStorageDomainCommand ( params ) ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails getVolumeAdvancedDetails ( org.ovirt.engine.core.common.businessentities.VDS upServer , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = runVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( upServer.getId ( ) , clusterId , volumeName , null , false ) ) ; return result.getSucceeded ( ) ? ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result.getReturnValue ( ) ) ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails getVolumeAdvancedDetails ( org.ovirt.engine.core.common.businessentities.VDS upServer , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue result = runVdsCommand ( VDSCommandType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeAdvancedDetailsVDSParameters ( upServer.getId ( ) , clusterId , volumeName , null , false , true ) ) ; return result.getSucceeded ( ) ? ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails ) ( result.getReturnValue ( ) ) ) : null ; }
Source:
private java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStatsFromVDSReturnValue ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats ) { if ( ! ( fileStats.getSucceeded ( ) ) ) { return null ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > result = ( ( java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ) ( fileStats.getReturnValue ( ) ) ) ; return result ; }

Target:
private java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > fileStatsFromVDSReturnValue ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue fileStats ) { if ( ( fileStats == null ) || ( ! ( fileStats.getSucceeded ( ) ) ) ) { return null ; } @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > result = ( ( java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ) ( fileStats.getReturnValue ( ) ) ) ; return result ; }
Source:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; }
Source:
private void addNetwork ( ) { if ( ! ( networkMap.containsKey ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText ) ) ) { networkMap.put ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText , new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList < java.lang.String > ( networkMap.keySet ( ) ) ) ; } getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText ) ; }

Target:
private void addNetwork ( ) { if ( ! ( networkMap.containsKey ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText ) ) ) { networkMap.put ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText , new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ) ; getNetworkList ( ) . setItems ( new java.util.ArrayList ( networkMap.keySet ( ) ) ) ; } getNetworkList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInitModel.newNetworkText ) ; }
Source:
private boolean isRequiresDescription ( java.lang.reflect.Method m ) { if ( m.isAnnotationPresent ( org.ovirt.engine.api.resource.RsdlIgnore.class ) ) { return false ; } boolean pathRelevant = ! ( ( m.isAnnotationPresent ( javax.ws.rs.Path.class ) ) && ( m.getAnnotation ( javax.ws.rs.Path.class ) . value ( ) . contains ( ":" ) ) ) ; boolean returnValueRelevant = ! ( m.getReturnType ( ) . equals ( org.ovirt.engine.api.resource.CreationResource.class ) ) ; return pathRelevant && returnValueRelevant ; }

Target:
private boolean isRequiresDescription ( java.lang.reflect.Method m ) { boolean pathRelevant = ! ( ( m.isAnnotationPresent ( javax.ws.rs.Path.class ) ) && ( m.getAnnotation ( javax.ws.rs.Path.class ) . value ( ) . contains ( ":" ) ) ) ; boolean returnValueRelevant = ! ( m.getReturnType ( ) . equals ( org.ovirt.engine.api.resource.CreationResource.class ) ) ; return pathRelevant && returnValueRelevant ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDAO ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; existing_net_name = "engine" ; new_net = new org.ovirt.engine.core.common.businessentities.network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getNetworkDAO ( ) ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; datacenter = new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ; existing_net_name = "engine" ; new_net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; new_net.setname ( "newnet1" ) ; new_net.setdescription ( "New network" ) ; new_net.setstorage_pool_id ( datacenter ) ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( result ) ) ; if ( ( vmList.size ( ) ) > 0 ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; } } }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( result ) ) ; if ( ( vmList.size ( ) ) > 0 ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; } } }
Source:
protected void RemoveVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDAO ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDAO ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void RemoveVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDAO ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDAO ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.StorageType expectedStorageType , java.lang.String mockDevtype ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; xlun.add ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }

Target:
private static void testParseLunFromXmlRpcForDevtypeField ( org.ovirt.engine.core.common.businessentities.StorageType expectedStorageType , java.lang.String mockDevtype ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; xlun.put ( GetDeviceListVDSCommand.DEVTYPE_FIELD , mockDevtype ) ; org.ovirt.engine.core.common.businessentities.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ; org.junit.Assert.assertEquals ( expectedStorageType , lun.getLunType ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { org.ovirt.engine.core.bll.storage.ovfstore.OvfHelper ovfHelper = new org.ovirt.engine.core.bll.storage.ovfstore.OvfHelper ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.gluster.GlusterVolumeCommandBase.getGlusterVolume ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID ) ; return false ; } setVdsGroupId ( org.ovirt.engine.core.bll.gluster.GlusterVolumeCommandBase.getGlusterVolume ( ) . getClusterId ( ) ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } return true ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDSGroup getVdsGroup ( ) { if ( ( org.ovirt.engine.core.bll.gluster.GlusterVolumeCommandBase.getGlusterVolume ( ) ) != null ) { setVdsGroupId ( org.ovirt.engine.core.bll.gluster.GlusterVolumeCommandBase.getGlusterVolume ( ) . getClusterId ( ) ) ; } return super . getVdsGroup ( ) ; }
Source:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getStoragePoolId ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) . getStatus ( ) , getEntity ( ) . getStoragePoolId ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn removeVmLease ( java.lang.String leaseUUID , java.lang.String sdUUID ) { java.util.HashMap < java.lang.String , java.lang.Object > leaseDict = new java.util.HashMap < > ( ) ; leaseDict.put ( "lease_id" , leaseUUID ) ; leaseDict.put ( "sd_id" , sdUUID ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Lease.delete" ) . withParameter ( "lease" , leaseDict ) . 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.VmLeaseTaskInfoReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.VmLeaseTaskInfoReturn removeVmLease ( java.lang.String leaseUUID , java.lang.String sdUUID ) { java.util.Map < java.lang.String , java.lang.Object > leaseDict = new java.util.HashMap < > ( ) ; leaseDict.put ( "lease_id" , leaseUUID ) ; leaseDict.put ( "sd_id" , sdUUID ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Lease.delete" ) . withParameter ( "lease" , leaseDict ) . 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.VmLeaseTaskInfoReturn ( response ) ; }
Source:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
protected boolean isQuotaDependant ( ) { boolean result ; if ( ( getActionType ( ) . getQuotaDependency ( ) ) == ( VdcActionType.QuotaDependency.NONE ) ) result = false ; else if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) result = true ; else if ( getActionType ( ) . isQuotaDependentAsInternalCommand ( ) ) result = true ; else result = false ; return result ; }

Target:
protected boolean isQuotaDependant ( ) { if ( ( getActionType ( ) . getQuotaDependency ( ) ) == ( VdcActionType.QuotaDependency.NONE ) ) { return false ; } if ( ! ( org.ovirt.engine.core.bll.CommandBase.isInternalExecution ( ) ) ) { return true ; } return getActionType ( ) . isQuotaDependentAsInternalCommand ( ) ; }
Source:
public void testStart ( ) throws java.lang.Exception { setUpWindowsGetEntityExpectations ( 1 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RunVmOnce , org.ovirt.engine.core.common.action.RunVmOnceParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testStart ( ) throws java.lang.Exception { setUpWindowsGetEntityExpectations ( 2 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RunVmOnce , org.ovirt.engine.core.common.action.RunVmOnceParams.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.start ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
protected org.ovirt.engine.api.model.HostStorage postPopulate ( org.ovirt.engine.api.model.HostStorage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) . value ( ) ) ; from.setVolumeGroup ( new org.ovirt.engine.api.model.VolumeGroup ( ) ) ; from.getVolumeGroup ( ) . setId ( from.getId ( ) ) ; return from ; }

Target:
protected org.ovirt.engine.api.model.HostStorage postPopulate ( org.ovirt.engine.api.model.HostStorage from ) { from.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.StorageType.class ) ) ; from.setVolumeGroup ( new org.ovirt.engine.api.model.VolumeGroup ( ) ) ; from.getVolumeGroup ( ) . setId ( from.getId ( ) ) ; return from ; }
Source:
public void fetchPublicKey ( ) { org.ovirt.engine.ui.frontend.AsyncQuery aQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; aQuery.setModel ( this ) ; aQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getHostPublicKey ( aQuery ) ; }

Target:
public void fetchPublicKey ( ) { org.ovirt.engine.ui.frontend.AsyncQuery aQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; aQuery.setModel ( this ) ; aQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getHostPublicKey ( aQuery ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { if ( ( getDisk ( ) ) == null ) { return null ; } switch ( getDisk ( ) . getVmEntityType ( ) ) { case VM : return createSharedLocksForVmDisk ( ) ; case TEMPLATE : return createSharedLocksForTemplateDisk ( ) ; default : log.warnFormat ( "No shared locks are taken while removing disk of entity: {0}" , getDisk ( ) . getVmEntityType ( ) ) ; return null ; } }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getSharedLocks ( ) { if ( ( ( getDisk ( ) ) == null ) || ( ( getDisk ( ) . getVmEntityType ( ) ) == null ) ) { return null ; } switch ( getDisk ( ) . getVmEntityType ( ) ) { case VM : return createSharedLocksForVmDisk ( ) ; case TEMPLATE : return createSharedLocksForTemplateDisk ( ) ; default : log.warnFormat ( "No shared locks are taken while removing disk of entity: {0}" , getDisk ( ) . getVmEntityType ( ) ) ; return null ; } }
Source:
public void setAttached ( boolean attached ) { attachedSeparatedImage.setResource ( ( attached ? org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.resources.joinedIcon ( ) : org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.resources.separatedIcon ( ) ) ) ; tooltip.setText ( ( attached ? org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.constants.attachedToInstanceType ( ) : org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.constants.detachedFromInstanceType ( ) ) ) ; tooltip.reconfigure ( ) ; }

Target:
public void setAttached ( boolean attached ) { attachedSeparatedImage.setResource ( ( attached ? org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.resources.joinedIcon ( ) : org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.resources.separatedIcon ( ) ) ) ; tooltip.setText ( ( attached ? org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.constants.attachedToInstanceType ( ) : org.ovirt.engine.ui.common.widget.editor.generic.BaseEntityModelDetachableWidget.constants.detachedFromInstanceType ( ) ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getNetworks ( ) { org.ovirt.engine.core.compat.NGuid dataCenterId = org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getDataCenterId ( ) ; if ( ( dataCenterId != null ) && ( ! ( dataCenterId.getValue ( ) . equals ( Guid.Empty ) ) ) ) { return org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . getAllForDataCenter ( dataCenterId.getValue ( ) ) ; } else { return org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . getAll ( ) ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getNetworks ( ) { return org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getDataCenterId ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , final int sizeRequired , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; initializeVmDaoMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; initializeVmDaoMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }
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.getInstance ( ) . getEntityGuid ( entity ) . equals ( objectGuid ) ) { return "" ; } java.lang.String ownerName = ( ( java.lang.String ) ( arg [ 2 ] ) ) ; return ownerName ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc getStorageDomainsList ( java.lang.String sdUUID , int domainType , int poolType , java.lang.String path ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageDomainsList ( sdUUID , domainType , poolType , path ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( 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.vdsbroker.StorageDomainListReturnForXmlRpc getStorageDomainsList ( java.lang.String sdUUID , int domainType , java.lang.String poolType , java.lang.String path ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getStorageDomainsList ( sdUUID , domainType , poolType , path ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static java.lang.String removeBrackets ( java.lang.String txt ) { if ( ( ( ( txt != null ) && ( ( txt.length ( ) ) >= 1 ) ) && ( txt.startsWith ( "[" ) ) ) && ( txt.endsWith ( "]" ) ) ) { return txt.substring ( 1 , ( ( txt.length ( ) ) - 2 ) ) ; } return txt ; }

Target:
public static java.lang.String removeBrackets ( java.lang.String txt ) { if ( ( ( ( txt != null ) && ( ( txt.length ( ) ) >= 1 ) ) && ( txt.startsWith ( "[" ) ) ) && ( txt.endsWith ( "]" ) ) ) { return txt.substring ( 1 , ( ( txt.length ( ) ) - 1 ) ) ; } return txt ; }
Source:
public void exception ( ) throws java.lang.Throwable { if ( ( throwable ) != null ) { throw throwable ; } org.junit.Assert.assertTrue ( ( ( expect.size ( ) ) == 0 ) ) ; org.junit.Assert.assertTrue ( ( ( send.size ( ) ) == 0 ) ) ; }

Target:
public void exception ( ) throws java.lang.Throwable { if ( ( throwable ) != null ) { throw throwable ; } org.junit.Assert.assertEquals ( 0 , expect.size ( ) ) ; org.junit.Assert.assertEquals ( 0 , send.size ( ) ) ; }
Source:
public static void addLink ( java.lang.String url , org.ovirt.engine.api.model.BaseResource resource , java.lang.String rel , org.ovirt.engine.api.model.ParametersSet params ) { org.ovirt.engine.api.model.Link link = new org.ovirt.engine.api.model.Link ( ) ; link.setRel ( ( rel + ( org.ovirt.engine.api.common.util.LinkHelper.SEARCH_RELATION ) ) ) ; link.setHref ( org.ovirt.engine.api.common.util.LinkHelper.combine ( ( ( org.ovirt.engine.api.common.util.LinkHelper.combine ( url , rel ) ) + ( org.ovirt.engine.api.common.util.LinkHelper.SEARCH_TEMPLATE ) ) , params ) ) ; resource.getLinks ( ) . add ( link ) ; }

Target:
public static void addLink ( java.lang.String url , org.ovirt.engine.api.model.BaseResource resource , java.lang.String rel , org.ovirt.engine.api.model.ParametersSet params ) { org.ovirt.engine.api.model.Link link = new org.ovirt.engine.api.model.Link ( ) ; link.setRel ( ( rel + ( org.ovirt.engine.api.common.util.LinkHelper.SEARCH_RELATION ) ) ) ; link.setHref ( ( ( org.ovirt.engine.api.common.util.LinkHelper.combine ( org.ovirt.engine.api.common.util.LinkHelper.combine ( url , rel ) , params ) ) + ( org.ovirt.engine.api.common.util.LinkHelper.SEARCH_TEMPLATE ) ) ) ; resource.getLinks ( ) . add ( link ) ; }
Source:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { boolean availableCpuShares = ( getModel ( ) . getCompatibilityVersion ( ) . compareTo ( Version.v3_3 ) ) >= 0 ; getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( availableCpuShares ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( availableCpuShares ) ; } }

Target:
protected void updateCpuSharesAvailability ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { getModel ( ) . getCpuSharesAmountSelection ( ) . setIsAvailable ( true ) ; getModel ( ) . getCpuSharesAmount ( ) . setIsAvailable ( true ) ; } }
Source:
public void onSucceeded ( ) { syncDbRecords ( true ) ; endSuccessfully ( ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Successfully merged snapshot '{}' images '{}'..'{}'" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }

Target:
public void onSucceeded ( ) { syncDbRecords ( true ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Successfully merged snapshot '{}' images '{}'..'{}'" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , false ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static java.lang.String createCorrelationId ( java.lang.String actionDescription ) { actionDescription = actionDescription.replace ( ' ' , '_' ) ; java.util.Random rand = new java.util.Random ( ) ; java.lang.String hashStr = ( ( rand.nextInt ( 9000000 ) ) + 9999999 ) + "" ; java.lang.String correlationId = ( ( ( org.ovirt.engine.ui.uicommonweb.models.events.TaskListModel.WEBADMIN ) + hashStr ) + "_" ) + actionDescription ; return correlationId ; }

Target:
public static java.lang.String createCorrelationId ( java.lang.String actionDescription ) { actionDescription = actionDescription.replace ( ' ' , '_' ) ; java.util.Random rand = new java.util.Random ( ) ; java.lang.String hashStr = ( ( rand.nextInt ( 9000000 ) ) + 9999999 ) + "" ; return ( ( ( org.ovirt.engine.ui.uicommonweb.models.events.TaskListModel.WEBADMIN ) + hashStr ) + "_" ) + actionDescription ; }
Source:
private void setDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; super . setItems ( disks ) ; }

Target:
private void setDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( value != null ) ? new java.util.ArrayList ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; super . setItems ( disks ) ; }
Source:
protected void createNumOfDesktopEditors ( ) { incraseNumOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.IntegerEntityModelTextBoxOnlyEditor ( ) ; numOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxEditor ( new org.ovirt.engine.ui.common.widget.editor.generic.ToStringEntityModelRenderer < java.lang.Integer > ( ) , new com.google.gwt.text.shared.Parser < java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { return incraseNumOfVmsEditor.asEditor ( ) . getValue ( ) ; } } ) ; }

Target:
protected void createNumOfDesktopEditors ( ) { incraseNumOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.IntegerEntityModelTextBoxOnlyEditor ( ) ; numOfVmsEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxEditor < java.lang.Integer > ( new org.ovirt.engine.ui.common.widget.editor.generic.ToStringEntityModelRenderer < java.lang.Integer > ( ) , new com.google.gwt.text.shared.Parser < java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer parse ( java.lang.CharSequence text ) throws java.text.ParseException { return incraseNumOfVmsEditor.asEditor ( ) . getValue ( ) ; } } ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( super . equals ( obj ) ) ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LunDisk other = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( obj ) ) ; return ( java.util.Objects.equals ( lun , other.lun ) ) && ( java.util.Objects.equals ( usingScsiReservation , other.usingScsiReservation ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.LunDisk other = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( obj ) ) ; return ( ( super . equals ( obj ) ) && ( java.util.Objects.equals ( lun , other.lun ) ) ) && ( java.util.Objects.equals ( usingScsiReservation , other.usingScsiReservation ) ) ; }
Source:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.network net ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.getItem ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > assertNeworkWasSent ( org.ovirt.engine.core.common.businessentities.Network net ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct networksStruct = networksCaptor.getValue ( ) ; java.util.Map < java.lang.String , java.lang.String > networkStruct = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( networksStruct.getItem ( net.getName ( ) ) ) ) ; org.junit.Assert.assertNotNull ( ( ( "Network " + ( net.getName ( ) ) ) + " should've been sent but wasn't." ) , networkStruct ) ; return networkStruct ; }
Source:
protected void proposeDiscover ( ) { boolean proposeDiscover = ( ! ( getProposeDiscoverTargets ( ) ) ) && ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.count ( getItems ( ) ) ) == 0 ) ) ; setProposeDiscoverTargets ( proposeDiscover ) ; }

Target:
protected void proposeDiscover ( ) { setProposeDiscoverTargets ( ( ( ( getItems ( ) ) == null ) || ( ( org.ovirt.engine.ui.uicommonweb.Linq.count ( getItems ( ) ) ) == 0 ) ) ) ; }
Source:
public void testEmptyFilter ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message0" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; org.junit.Assert.assertTrue ( snmp.getEvents ( ) . isEmpty ( ) ) ; org.junit.Assert.assertTrue ( snmp.getNames ( ) . isEmpty ( ) ) ; }

Target:
public void testEmptyFilter ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message0" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; org.junit.Assert.assertTrue ( snmp.getEvents ( ) . isEmpty ( ) ) ; }
Source:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; mockVmNetworks ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( storageDomainStaticDAO ) . when ( command ) . getStorageDomainStaticDao ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsOnDiskDomainCheckWhenStorageGuidInParamsMismatches ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( storageId ) ; mockVmWithDisk ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public void testGetUserByName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserNameAndDomain , org.ovirt.engine.core.common.queries.GetDbUserByUserNameAndDomainQueryParameters.class , new java.lang.String [ ] { "UserName" , "DomainName" } , new java.lang.Object [ ] { "admin" , "internal" } , getEntity ( 0 ) ) ; control.replay ( ) ; verifyModel ( resource.getUserByNameAndDomain ( "admin" , "internal" ) , 0 ) ; }

Target:
public void testGetUserByName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetDbUserByUserNameAndDomain , org.ovirt.engine.core.common.queries.GetDbUserByUserNameAndDomainQueryParameters.class , new java.lang.String [ ] { "UserName" , "DomainName" } , new java.lang.Object [ ] { "admin" , "internal" } , getEntity ( 0 ) ) ; verifyModel ( resource.getUserByNameAndDomain ( "admin" , "internal" ) , 0 ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getIrsProxy ( ) . getImagesList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.proceedProxyReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > tempRetValue = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( result.getImageList ( ) . length ) ; for ( java.lang.String id : result.getImageList ( ) ) { tempRetValue.add ( new org.ovirt.engine.core.compat.Guid ( id ) ) ; } setReturnValue ( tempRetValue ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getIrsProxy ( ) . getImagesList ( org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.irsbroker.GetImagesListVDSCommand.proceedProxyReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > tempRetValue = new java.util.ArrayList ( result.getImageList ( ) . length ) ; for ( java.lang.String id : result.getImageList ( ) ) { tempRetValue.add ( new org.ovirt.engine.core.compat.Guid ( id ) ) ; } setReturnValue ( tempRetValue ) ; }