auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . 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 ( "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 ) ; }
Source:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }

Target:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.asEditor ( ) . flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }
Source:
protected boolean checkExistingStorageDomain ( ) { if ( ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > domainFromIrs = executeHSMGetStorageDomainInfo ( new org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getVdsId ( ) , org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ) ; if ( domainFromIrs == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } return concreteCheckExistingStorageDomain ( domainFromIrs ) ; }

Target:
protected boolean checkExistingStorageDomain ( ) { if ( ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomainStaticDao ( ) . get ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ) != null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > domainFromIrs = executeHSMGetStorageDomainInfo ( new org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters ( org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getVdsId ( ) , org.ovirt.engine.core.bll.storage.domain.AddExistingFileStorageDomainCommand.getStorageDomain ( ) . getId ( ) ) ) ; if ( domainFromIrs == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } return concreteCheckExistingStorageDomain ( domainFromIrs ) ; }
Source:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertEquals ( result , dummyPolicy ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }

Target:
public void testSave ( ) { dao.save ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( result , dummyPolicy ) ; dao.remove ( dummyPolicy.getId ( ) ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.QUERY , org.ovirt.engine.api.restapi.resource.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
public void validateFailureOnCopyingLunDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ) ; command.getParameters ( ) . setOperation ( ImageOperation.Copy ) ; command.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }

Target:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private void readCdItem ( org.ovirt.engine.core.compat.backendcompat.XmlNode node ) { readVmDevice ( node , _vm.getStaticData ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.lang.Boolean.TRUE ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.compat.backendcompat.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setName ( node.SelectSingleNode ( OvfProperties.VMD_NAME , _xmlNS ) . innerText ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( ( "%s, storagePoolId=%s, storagePoolName=%s, masterDomainId=%s, " + "domainsIdList=%s, masterVersion=%s" ) , super . toString ( ) , getStoragePoolId ( ) , getStoragePoolName ( ) , getMasterDomainId ( ) , getDomainsIdList ( ) , getMasterVersion ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "storagePoolId" , getStoragePoolId ( ) ) . append ( "storagePoolName" , getStoragePoolName ( ) ) . append ( "masterDomainId" , getMasterDomainId ( ) ) . append ( "domainsIdList" , getDomainsIdList ( ) ) . append ( "masterVersion" , getMasterVersion ( ) ) ; }
Source:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; response.addCookie ( cookie ) ; }

Target:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }
Source:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }

Target:
public void testAddExistingBlockDomainWhenVgInfoReturnsEmptyLunList ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; org.junit.Assert.assertFalse ( "Could not connect to Storage Domain" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to empty Lun list returned from VGInfo " , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_PROBLEM_WITH_CANDIDATE_INFO.toString ( ) ) ) ; }
Source:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getAttachedTagsToVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( id.toString ( ) ) , aQuery ) ; }
Source:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setStatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setStatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getStorageId ( ) , existingStoragePoolIsoMap.getStoragePoolId ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { return org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.profileAndNetworkSelected ( ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( data ) ) . getName ( ) , ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( data ) ) . getNetworkName ( ) ) . asString ( ) ; }

Target:
public java.lang.String getReplacementStringNullSafe ( java.lang.Object data ) { org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( data ) ) ; return profile == VnicProfileView.EMPTY ? org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.emptyProfile ( ) . asString ( ) : org.ovirt.engine.ui.common.widget.profile.ProfileEditor.messages.profileAndNetworkSelected ( profile.getName ( ) , profile.getNetworkName ( ) ) . asString ( ) ; }
Source:
public void remove ( org.ovirt.engine.core.compat.Guid id ) { org.hibernate.Session session = getSession ( ) ; org.hibernate.Transaction transaction = session.beginTransaction ( ) ; org.hibernate.Query query = session.createQuery ( "delete from tags_user_group_map tugm where tugm.groupId = :group_id" ) ; query.setParameter ( "group_id" , id ) ; query.executeUpdate ( ) ; org.ovirt.engine.core.common.businessentities.ad_groups instance = get ( id ) ; if ( instance != null ) { session.delete ( instance ) ; } transaction.commit ( ) ; }

Target:
public void remove ( org.ovirt.engine.core.compat.Guid id ) { org.hibernate.Session session = getSession ( ) ; org.hibernate.Transaction transaction = session.beginTransaction ( ) ; org.hibernate.Query query = session.createQuery ( "delete from tags_user_group_map tugm where tugm.groupId = :group_id" ) ; query.setParameter ( "group_id" , id ) ; query.executeUpdate ( ) ; org.ovirt.engine.core.common.businessentities.LdapGroup instance = get ( id ) ; if ( instance != null ) { session.delete ( instance ) ; } transaction.commit ( ) ; }
Source:
protected void initDetailModels ( ) { super . initDetailModels ( ) ; org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; setDetailModels ( list ) ; }

Target:
private void setDetailList ( final org.ovirt.engine.ui.uicommonweb.models.pools.PoolGeneralModel poolGeneralModel , final org.ovirt.engine.ui.uicommonweb.models.pools.PoolVmListModel poolVmListModel , final org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel < org.ovirt.engine.ui.uicommonweb.models.pools.PoolListModel > permissionListModel ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; list.add ( poolGeneralModel ) ; list.add ( poolVmListModel ) ; list.add ( permissionListModel ) ; setDetailModels ( list ) ; }
Source:
public void testGetDisplayLocales ( ) { java.util.List < java.lang.String > displayLocales = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getDisplayedLocales ( allLocales , displayLocales , new java.util.ArrayList < > ( ) ) ; org.junit.Assert.assertNotNull ( "Result should not be null" , locales ) ; org.junit.Assert.assertEquals ( "There should be 8 locales" , 8 , locales.size ( ) ) ; }

Target:
public void testGetDisplayLocales ( ) { java.util.List < java.lang.String > displayLocales = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getDisplayedLocales ( allLocales , displayLocales , new java.util.ArrayList < > ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( locales , "Result should not be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 8 , locales.size ( ) , "There should be 8 locales" ) ; }
Source:
private static boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > irsImages ) { boolean returnValue = true ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.DiskImage fromIrs = org.ovirt.engine.core.bll.ImagesHandler.isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { returnValue = false ; break ; } irsImages.add ( fromIrs ) ; } return returnValue ; }

Target:
private static boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > irsImages ) { boolean returnValue = true ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIrs = org.ovirt.engine.core.bll.ImagesHandler.isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { returnValue = false ; break ; } irsImages.add ( fromIrs ) ; } return returnValue ; }
Source:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.Guid guid = new org.ovirt.engine.core.compat.Guid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }

Target:
public java.lang.String generateId ( org.ovirt.engine.api.model.Version v ) { org.ovirt.engine.core.compat.Guid guid = asGuid ( ( ( ( v.getMajor ( ) ) + "." ) + ( v.getMinor ( ) ) ) . getBytes ( ) , true ) ; return guid.toString ( ) ; }
Source:
public void executeSave ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getSelectedDc ( ) . getId ( ) , getNetwork ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; postSaveAction ( null , ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) ) ; } } , null ) ; }

Target:
public void executeSave ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateNetwork , new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( getSelectedDc ( ) . getId ( ) , getNetwork ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; postSaveAction ( null , ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) ) ; } } , null ) ; }
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 ( ) , isBalloonEnabled ( ) , false ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getInstanceTypeId ( ) ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }

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 ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . keySet ( ) , false ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getInstanceTypeId ( ) ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }
Source:
public static java.lang.String getParameter ( javax.servlet.http.HttpServletRequest request , java.lang.String paramName ) throws java.io.UnsupportedEncodingException { java.lang.String value = request.getParameter ( paramName ) ; return value == null ? null : java.net.URLDecoder.decode ( new java.lang.String ( value.getBytes ( "iso-8859-1" ) ) , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; }

Target:
public static java.lang.String getParameter ( javax.servlet.http.HttpServletRequest request , java.lang.String paramName ) throws java.io.UnsupportedEncodingException { java.lang.String value = request.getParameter ( paramName ) ; return value == null ? null : org.ovirt.engine.core.sso.utils.SSOUtils.decode ( new java.lang.String ( value.getBytes ( "iso-8859-1" ) ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemovePermission , org.ovirt.engine.core.common.action.PermissionsOperationsParameters.class , new java.lang.String [ ] { "Permission.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getHostJobs ( jobType , jobIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } }

Target:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , manager.getVdsName ( ) ) ; } } }
Source:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
protected void initLabelModels ( ) { java.util.Collections.sort ( originalLabels , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > > items = new java.util.LinkedList < > ( ) ; for ( java.lang.String label : originalLabels ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; labelModel.setItems ( suggestedLabels ) ; labelModel.setSelectedItem ( label ) ; items.add ( labelModel ) ; } setItems ( items ) ; }

Target:
protected void initLabelModels ( ) { java.util.Collections.sort ( originalLabels , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; java.util.LinkedList < org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > > items = new java.util.LinkedList < > ( ) ; for ( java.lang.String label : originalLabels ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; labelModel.setItems ( suggestedLabels ) ; labelModel.setSelectedItem ( label ) ; items.add ( labelModel ) ; } setItems ( items ) ; suggestedLabelsCache = new java.util.TreeSet < > ( suggestedLabels ) ; }
Source:
public void testValidateDefaultFlagIsNotChangedWhenFlagChanged ( ) { final org.ovirt.engine.core.common.businessentities.MacPool macPool1 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; final org.ovirt.engine.core.common.businessentities.MacPool macPool2 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; macPool2.setDefaultPool ( ( ! ( macPool1.isDefaultPool ( ) ) ) ) ; org.junit.Assert.assertThat ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( macPool1 , macPool2 ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED ) ) ; }

Target:
public void testValidateDefaultFlagIsNotChangedWhenFlagChanged ( ) { final org.ovirt.engine.core.common.businessentities.MacPool macPool1 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; final org.ovirt.engine.core.common.businessentities.MacPool macPool2 = new org.ovirt.engine.core.common.businessentities.MacPool ( ) ; macPool2.setDefaultPool ( ( ! ( macPool1.isDefaultPool ( ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( macPool1 , macPool2 ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_CHANGING_DEFAULT_MAC_POOL_IS_NOT_SUPPORTED ) ) ; }
Source:
protected boolean canDoAction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( domainsMap ) ) ) { return false ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; } return canDoActionAfterCloneVm ( domainsMap ) ; }

Target:
protected boolean canDoAction ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > domainsMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; if ( ! ( canDoActionBeforeCloneVm ( domainsMap ) ) ) { return false ; } if ( getParameters ( ) . isImportAsNewEntity ( ) ) { initImportClonedVm ( ) ; if ( ( getVm ( ) . getInterfaces ( ) . size ( ) ) > ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getAvailableMacsCount ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES ) ; return false ; } } return canDoActionAfterCloneVm ( domainsMap ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( remoteUserName , geoRepPubKeys ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( userName , geoRepPubKeys ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageGuidSet ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > destImageDomains = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { destImageDomains.add ( diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return destImageDomains ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getStorageGuidSet ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > destImageDomains = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { destImageDomains.add ( diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return destImageDomains ; }
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 ( ) ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }
Source:
protected void performLogout ( ) { getLoginModel ( ) . resetAfterLogout ( ) ; user.onUserLogout ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.clearCache ( ) ; org.ovirt.engine.ui.common.uicommon.model.CleanupModelEvent.fire ( eventBus ) ; }

Target:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; query.setHandleFailure ( true ) ; query.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { Window.Location.reload ( ) ; } } ; frontend.logoffAsync ( frontend.getLoggedInUser ( ) , query ) ; }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.common.businessentities.storage.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }
Source:
protected void setUpGetClusterExpectations ( int times ) { while ( ( times -- ) > 0 ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setStoragePoolId ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , cluster , null ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.Cluster setUpClusterExpectations ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.Cluster group = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( group.getId ( ) ) . thenReturn ( id ) ; org.mockito.Mockito.when ( group.getStoragePoolId ( ) ) . thenReturn ( GUIDS [ 2 ] ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClusterByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { id } , group ) ; return group ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . ProceedProxyReturnValue ( ) ; InitializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . ProceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
public void testGetFile ( ) throws java.lang.Exception { java.io.File file = writeConf ( "file=file" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; junit.framework.Assert.assertEquals ( new java.io.File ( "file" ) , config.getFile ( "file" ) ) ; }

Target:
public void testGetFile ( ) throws java.lang.Exception { java.io.File file = writeConf ( "file=file" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( new java.io.File ( "file" ) , config.getFile ( "file" ) ) ; }
Source:
public void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getiso_path ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getiso_path ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
public void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }
Source:
public void validateFailureOnMovingLunDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.LunDisk ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_NOT_SUPPORTED_DISK_STORAGE_TYPE ) ; }

Target:
public void validateEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getBroker ( ) . refreshStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterStorageDomainId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.getParameters ( ) . getMasterVersion ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.RefreshStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
private void addCollectionAction ( java.lang.String rel , java.lang.String [ ] periods , int i , java.lang.String period , org.ovirt.engine.sdk.codegen.holders.ResourceHolder resourceHolder , org.ovirt.engine.sdk.entities.DetailedLink detailedLink ) { java.lang.String methodName = getActionMethodName ( period , periods [ ( i - 3 ) ] ) ; if ( ! ( resourceHolder.hasMethod ( period ) ) ) { java.lang.String docParams = org.ovirt.engine.sdk.codegen.documentation.DocsGen.generateBodyParams ( detailedLink ) ; resourceHolder.addMethod ( period , this . resourceActionMethodTemplate.getTemplate ( methodName , rel , docParams , detailedLink ) ) ; } }

Target:
private void addResource ( org.ovirt.engine.sdk.codegen.utils.Tree < org.ovirt.engine.sdk.codegen.rsdl.Location > entityTree ) { java.lang.String className = org.ovirt.engine.sdk.codegen.rsdl.BrokerRules.getBrokerType ( entityTree ) ; java.lang.String classCode = new org.ovirt.engine.sdk.codegen.templates.ResourceTemplate ( ) . evaluate ( entityTree ) ; code.put ( className , classCode ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getRestModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getRestModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void OnForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.Validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; Cancel ( ) ; }

Target:
public void cancel ( ) { cancelConfirmation ( ) ; setGuideContext ( null ) ; setWindow ( null ) ; updateActionAvailability ( ) ; }
Source:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 4 ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; mockDisksList ( 2 ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForMerge ( org.mockito.Matchers.anyList ( ) , org.mockito.Matchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }