auphong2707/dl4se-code-review-dataset huggingface dataset:
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.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getTemplateNicList ( 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.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; final org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setSupportedClusterLevels ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.TEST_VERSION ) ; host.setDynamicData ( vdsDynamic ) ; bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( mockNetworkExclusivenessValidatorResolver.resolveNetworkExclusivenessValidator ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.TEST_SUPPORTED_VERSIONS ) ) . thenReturn ( mockNetworkExclusivenessValidator ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > repoList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.RepoImage > ) ( source ) ) ; java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : repoList ) { fileNameList.add ( repoImage.getRepoImageId ( ) ) ; } java.util.Collections.sort ( fileNameList , java.lang.String.CASE_INSENSITIVE_ORDER ) ; return fileNameList ; } return new java.util.ArrayList < java.lang.String > ( ) ; }
Source:
public java.lang.String getServerKeyFingerprint ( java.lang.String server , long timeout ) throws java.lang.Exception { java.lang.String fingerprint = null ; _openSession ( server , timeout , timeout ) ; java.security.PublicKey serverKey = this . client.getServerKey ( ) ; if ( serverKey != null ) { fingerprint = org.ovirt.engine.core.engineencryptutils.OpenSSHUtils.getKeyFingerprintString ( serverKey ) ; } return fingerprint ; }

Target:
public java.lang.String getServerKeyFingerprint ( java.lang.String server , long timeout ) throws java.lang.Exception { java.lang.String fingerprint = null ; _openSession ( server , timeout , timeout ) ; java.security.PublicKey serverKey = this . client.getHostKey ( ) ; if ( serverKey != null ) { fingerprint = org.ovirt.engine.core.engineencryptutils.OpenSSHUtils.getKeyFingerprintString ( serverKey ) ; } return fingerprint ; }
Source:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.EntityModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel ( vm , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }

Target:
public static org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel createInstance ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vmNicList , org.ovirt.engine.ui.uicommonweb.models.IModel sourceModel ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel instance = new org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel ( vm , dcId , clusterCompatibilityVersion , vmNicList , sourceModel ) ; instance.init ( ) ; return instance ; }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , false ) ; }

Target:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , false ) ; }
Source:
public static boolean parseBoolean ( java.lang.String value ) { if ( "true" . equalsIgnoreCase ( value ) ) { return true ; } if ( "false" . equalsIgnoreCase ( value ) ) { return false ; } throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( "Value \"" + value ) + "\" isn\'t a valid boolean, it should be \"true\" or \"false\"" ) ) ; }

Target:
public static boolean parseBoolean ( java.lang.String value ) { if ( ( "true" . equalsIgnoreCase ( value ) ) || ( "1" . equals ( value ) ) ) { return true ; } if ( ( "false" . equalsIgnoreCase ( value ) ) || ( "0" . equals ( value ) ) ) { return false ; } throw new org.ovirt.engine.api.utils.InvalidValueException ( ( ( "Value \"" + value ) + "\" isn\'t a valid boolean, it should be \"true\" , \"false\", \"0\" or \"1\"" ) ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }

Target:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }
Source:
private void loadIconsToDatabase ( ) { final java.util.HashMap < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = org.ovirt.engine.core.bll.IconLoader.ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }

Target:
private void loadIconsToDatabase ( ) { final java.util.HashMap < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = org.ovirt.engine.core.bll.IconLoader.ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageGroupId , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setId ( diskImageGroupId ) ; diskImage.getImage ( ) . setId ( diskImageId ) ; diskImage.setStoragePoolId ( storagePoolId ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( srcStorageId ) ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage initDiskImage ( org.ovirt.engine.core.compat.Guid diskImageGroupId , org.ovirt.engine.core.compat.Guid diskImageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setId ( diskImageGroupId ) ; diskImage.getImage ( ) . setId ( diskImageId ) ; diskImage.setStoragePoolId ( storagePoolId ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( srcStorageId ) ) ) ; org.mockito.Mockito.when ( diskImageDao.getAncestor ( diskImageId ) ) . thenReturn ( diskImage ) ; org.mockito.Mockito.when ( diskImageDao.get ( diskImageId ) ) . thenReturn ( diskImage ) ; return diskImage ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { setEnumTitle ( snapshot.getStatus ( ) ) ; switch ( snapshot.getStatus ( ) ) { case OK : return getCommonResources ( ) . snapshotImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case IN_PREVIEW : return getCommonResources ( ) . snapshotImage ( ) ; default : return getCommonResources ( ) . snapshotImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { setEnumTitle ( snapshot.getStatus ( ) ) ; switch ( snapshot.getStatus ( ) ) { case OK : return org.ovirt.engine.ui.common.widget.table.column.SnapshotStatusColumn.resources.snapshotImage ( ) ; case LOCKED : return org.ovirt.engine.ui.common.widget.table.column.SnapshotStatusColumn.resources.waitImage ( ) ; case IN_PREVIEW : return org.ovirt.engine.ui.common.widget.table.column.SnapshotStatusColumn.resources.snapshotImage ( ) ; default : return org.ovirt.engine.ui.common.widget.table.column.SnapshotStatusColumn.resources.snapshotImage ( ) ; } }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.Guid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getStoragePoolId ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }

Target:
private boolean isDiskValidForStorage ( org.ovirt.engine.core.common.businessentities.DiskImage disk , org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( disk.isShareable ( ) ) && ( ( storage.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) { return false ; } return true ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) { if ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Up ) ) { list.add ( a ) ; } } model.setDataCenter ( model , list ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initCdImage ( ) ; }
Source:
private void initSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }

Target:
private void initSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultSpmPriority ( new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { defaultSpmPriority = returnValue ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }
Source:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ; if ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getPreviousStatus ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) ; }

Target:
private boolean canVdsBeReached ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ; if ( ( ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) || ( vdsStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Kdumping ) ) ) { vdsStatus = org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getPreviousStatus ( ) ; } return ( vdsStatus != ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) && ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getWatchdogByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.Empty ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false , false ) ; }

Target:
public void testImport ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , false , false ) ; }
Source:
public static void initDiskHotpluggableInterfacesMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.diskHotpluggableInterfacesMap = ( ( java.util.Map < org.ovirt.engine.core.common.utils.Pair < java.lang.Integer , org.ovirt.engine.core.compat.Version > , java.util.Set < java.lang.String > > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDiskHotpluggableInterfacesMap ) , callback ) ; }

Target:
public void initDefaultOSes ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { defaultOSes = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetDefaultOSes ) , callback ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
private void UpdateHasSelectedTags ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > selectedTags = ( ( getTagList ( ) . getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > Cast ( getTagList ( ) . getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ; setHasSelectedTags ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( selectedTags.size ( ) ) > 0 ) ) ) ; }

Target:
private void UpdateHasSelectedTags ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > selectedTags = ( ( getTagList ( ) . getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > cast ( getTagList ( ) . getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( ) ; setHasSelectedTags ( ( ( ( getSelectedItem ( ) ) != null ) && ( ( selectedTags.size ( ) ) > 0 ) ) ) ; }
Source:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsToClone ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( ! ( validateName ( ( ( template.getName ( ) ) + suffix ) , template , entityModel ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsToClone ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportTemplateData ) ( object ) ) . getTemplate ( ) ; if ( ! ( validateName ( ( ( template.getName ( ) ) + suffix ) , entityModel , getClonedAppendedNameValidators ( null ) ) ) ) { return false ; } } return true ; }
Source:
public boolean domainIsValidDestination ( java.util.List < java.lang.String > messages ) { if ( ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { messages.add ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL.toString ( ) ) ; return false ; } return true ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult domainIsValidDestination ( ) { if ( ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( getImagesActionType ( ) , p ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getImagesParameters ( ) ) { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getBackend ( ) . endAction ( getImagesActionType ( ) , p , org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
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 ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void testValidDedicatedHost ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( group.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }

Target:
public void testValidDedicatedHost ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( group.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }
Source:
protected abstract void setClientTokenProvider ( com.woorea.openstack.quantum.Quantum client ) ;

Target:
protected void setClientTokenProvider ( com.woorea.openstack.quantum.Quantum client ) { java.lang.String tenantName = provider.getAdditionalProperties ( ) . getTenantName ( ) ; com.woorea.openstack.keystone.utils.KeystoneTokenProvider keystoneTokenProvider = new com.woorea.openstack.keystone.utils.KeystoneTokenProvider ( provider.getAuthUrl ( ) , provider.getUsername ( ) , provider.getPassword ( ) ) ; client.setTokenProvider ( keystoneTokenProvider.getProviderByTenant ( tenantName ) ) ; }
Source:
public boolean runForSingleConnectionInHost ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid storagePoolId , int type ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; org.ovirt.engine.core.compat.Guid vdsId = ( ( pool.getspm_vds_id ( ) ) != null ) ? pool.getspm_vds_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; if ( ! ( vdsId.equals ( Guid.Empty ) ) ) { returnValue = runConnectionStorageToDomain ( storageDomain , vdsId , type ) ; } return returnValue ; }

Target:
public boolean disconnectStorageFromDomainByVdsId ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid vdsId ) { return runConnectionStorageToDomain ( storageDomain , vdsId , VdcActionType.DisconnectStorageServerConnection.getValue ( ) ) ; }
Source:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return runVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return runVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.CreateStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.CreateStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; org.junit.Assert.assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; }

Target:
public void testChangeToExistingName ( ) { prepareVmToPassValidate ( ) ; mockSameNameQuery ( true ) ; org.junit.Assert.assertFalse ( "validate should have failed with vm name already in use." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ; }
Source:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.Storage > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( ( ( NAMES.length ) * 2 ) , collection.size ( ) ) ; for ( int i = 0 ; i < ( ( NAMES.length ) * 2 ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < org.ovirt.engine.api.model.HostStorage > collection ) throws java.lang.Exception { assertNotNull ( collection ) ; assertEquals ( ( ( NAMES.length ) * 2 ) , collection.size ( ) ) ; for ( int i = 0 ; i < ( ( NAMES.length ) * 2 ) ; i ++ ) { verifyModel ( collection.get ( i ) , ( i % ( NAMES.length ) ) ) ; } }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qRetVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) : null ; }