auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public void onResult ( java.lang.Double result ) { this . resultValue = result ; this . resultType = JsFunction.RESULT_TYPE_NUMBER ; }

Target:
public boolean invokeAsNumber ( com.google.gwt.core.client.JsArray < ? > args , org.ovirt.engine.ui.webadmin.plugin.jsni.JsFunction.ErrorHandler errorHandler ) { clearResultInformation ( ) ; return function.invoke ( args , JsFunction.RESULT_TYPE_NUMBER , ( java.lang.Double result ) -> { this . resultValue = result ; this . resultType = JsFunction.RESULT_TYPE_NUMBER ; } , errorHandler ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM setUpVm ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.api.restapi.resource.VM vm = control.createMock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.easymock.EasyMock.expect ( vm.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM setUpVm ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ; org.mockito.Mockito.when ( vmStatic.getId ( ) ) . thenReturn ( id ) ; org.ovirt.engine.api.restapi.resource.VM vm = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ; org.mockito.Mockito.when ( vm.getId ( ) ) . thenReturn ( id ) ; org.mockito.Mockito.when ( vm.getStaticData ( ) ) . thenReturn ( vmStatic ) ; return vm ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.system.ClientStorageKeyPrefix.class ) . to ( org.ovirt.engine.ui.webadmin.gin.SystemModule.CLIENT_STORAGE_KEY_PREFIX ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages.class ) ; }
Source:
public void testCheckGroupsCanBeAttachedAdminIssues ( ) { getRole ( ) . setType ( RoleType.USER ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.Assert.assertTrue ( "validate should fail" , getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) ) ; org.junit.Assert.assertEquals ( "wrong messages" , EngineMessage.CANNOT_ADD_ACTION_GROUPS_TO_ROLE_TYPE.toString ( ) , messages.get ( 0 ) ) ; }

Target:
public void testCheckGroupsCanBeAttachedAdminIssues ( ) { getRole ( ) . setType ( RoleType.USER ) ; org.ovirt.engine.core.common.businessentities.RoleGroupMap map = new org.ovirt.engine.core.common.businessentities.RoleGroupMap ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_STORAGE_POOL , getParams ( ) . getRoleId ( ) ) ; mockGetAllForRole ( java.util.Collections.singletonList ( map ) ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( 1 ) ; org.junit.jupiter.api.Assertions.assertTrue ( getCommand ( ) . checkIfGroupsCanBeAttached ( messages ) , "validate should fail" ) ; org.junit.jupiter.api.Assertions.assertEquals ( EngineMessage.CANNOT_ADD_ACTION_GROUPS_TO_ROLE_TYPE.toString ( ) , messages.get ( 0 ) , "wrong messages" ) ; }
Source:
protected void updateDataCenterVersion ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = 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.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenterVersion ( storagePool.getcompatibility_version ( ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDataCenterById ( query , getEntity ( ) . getStoragePoolId ( ) ) ; }

Target:
protected void updateExtendImageSizeSupported ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery query = 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.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setExtendImageSizeSupported ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isCommandCompatible ( query , VdcActionType.ExtendImageSize , vm.getVdsGroupCompatibilityVersion ( ) , dataCenterVersion ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public static void GetPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters ( poolId ) , 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.storage_pool > ( ) ; } 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 testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { PARENT_ID , GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( source.getConfirmWindow ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel ) { return importClonePopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportCommand ( ) ) ) { return registerEntityPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator storageConnectionValidator = createStorageConnectionValidator ( ) ; if ( ( ( ! ( validate ( storageConnectionValidator.isConnectionExists ( ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isISCSIConnectionAndDomain ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) { return false ; } if ( storageConnectionValidator.isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator storageConnectionValidator = createStorageConnectionValidator ( ) ; if ( ( ( ! ( validate ( storageConnectionValidator.isConnectionExists ( ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isISCSIConnectionAndDomain ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) { return false ; } if ( storageConnectionValidator.isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.bll.storage.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; } return true ; }
Source:
public void testGet ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsInterface.getStatistics ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface result = dao.get ( newVdsInterface.getId ( ) ) ; org.junit.Assert.assertEquals ( newVdsInterface , result ) ; }

Target:
public void testGet ( ) { newVdsInterface.setVdsId ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.VDS_ID ) ; dao.saveInterfaceForVds ( newVdsInterface ) ; dao.saveStatisticsForVds ( newVdsInterface.getStatistics ( ) ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface result = dao.get ( newVdsInterface.getId ( ) ) ; org.junit.Assert.assertEquals ( newVdsInterface , result ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( getEntityList ( ) ) ; org.ovirt.engine.api.model.NetworkLabel model = resource.get ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , final org.ovirt.engine.core.common.businessentities.VMStatus status , final org.ovirt.engine.core.common.businessentities.VmExitStatus exitStaus , final java.lang.String exitMessage ) { vm.setStatus ( status ) ; vm.setExitStatus ( exitStaus ) ; vm.setExitMessage ( exitMessage ) ; boolean isVmStatusDown = org.ovirt.engine.core.common.businessentities.VM.isStatusDown ( status ) ; if ( isVmStatusDown || ( status == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmStatusDown ) { vm.setRunOnVds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }

Target:
public void InternalSetVmStatus ( org.ovirt.engine.core.common.businessentities.VM vm , final org.ovirt.engine.core.common.businessentities.VMStatus status , final org.ovirt.engine.core.common.businessentities.VmExitStatus exitStaus , final java.lang.String exitMessage ) { vm.setStatus ( status ) ; vm.setExitStatus ( exitStaus ) ; vm.setExitMessage ( exitMessage ) ; boolean isVmNotRunning = status.isNotRunning ( ) ; if ( isVmNotRunning || ( status == ( org.ovirt.engine.core.common.businessentities.VMStatus.Unknown ) ) ) { resetVmAttributes ( vm ) ; if ( isVmNotRunning ) { vm.setRunOnVds ( null ) ; vm.setVmPauseStatus ( VmPauseStatus.NONE ) ; } } }
Source:
public static org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.restapi.resource.BackendResource resource , java.lang.String providerId ) { org.ovirt.engine.core.compat.Guid storageDomainId = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = resource.runQuery ( QueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { java.lang.String storageId = storageDomain.getStorage ( ) ; if ( providerId.equals ( storageId ) ) { storageDomainId = storageDomain.getId ( ) ; break ; } } return storageDomainId ; }

Target:
public static org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.api.restapi.resource.BackendResource resource , java.lang.String providerId ) { org.ovirt.engine.core.compat.Guid storageDomainId = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = resource.runQuery ( QueryType.GetAllStorageDomains , new org.ovirt.engine.core.common.queries.QueryParametersBase ( ) ) . getReturnValue ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { java.lang.String storageId = storageDomain.getStorage ( ) ; if ( providerId.equals ( storageId ) ) { storageDomainId = storageDomain.getId ( ) ; break ; } } return storageDomainId ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageDataCenterListModel model = getModel ( ) ; if ( lastExecutedCommand == ( model.getAttachCommand ( ) ) ) { if ( model.getAttachMultiple ( ) ) { return multiPopupProvider.get ( ) ; } else { return singlePopupProvider.get ( ) ; } } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void testUpdateVolumeStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.STOPPED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertFalse ( snapshot.equals ( existingSnapshot ) ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.STOPPED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }

Target:
public void testUpdateSnapshotStatus ( ) { dao.updateSnapshotStatus ( existingSnapshot.getSnapshotId ( ) , GlusterSnapshotStatus.STOPPED ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = dao.getById ( existingSnapshot.getSnapshotId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.junit.Assert.assertFalse ( snapshot.equals ( existingSnapshot ) ) ; existingSnapshot.setStatus ( GlusterSnapshotStatus.STOPPED ) ; org.junit.Assert.assertEquals ( existingSnapshot , snapshot ) ; }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter attachNetworkToVdsGroupParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AttachNetworkToClusterInternal , attachNetworkToVdsGroupParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter attachNetworkToClusterParameter = getParameters ( ) ; final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AttachNetworkToClusterInternal , attachNetworkToClusterParameter ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { attachLabeledNetwork ( ) ; } else { propagateFailure ( returnValue ) ; } }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { domainsInPool = new java.util.LinkedList ( domainsInPool ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.StorageDomain > iterator = domainsInPool.iterator ( ) ; while ( iterator.hasNext ( ) ) { if ( ! ( getPredicate ( disksList ) . eval ( iterator.next ( ) ) ) ) { iterator.remove ( ) ; } } return domainsInPool ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { domainsInPool = new java.util.LinkedList ( domainsInPool ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.StorageDomain > iterator = domainsInPool.iterator ( ) ; while ( iterator.hasNext ( ) ) { if ( ! ( getPredicate ( memoryDisks ) . eval ( iterator.next ( ) ) ) ) { iterator.remove ( ) ; } } return domainsInPool ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; existingVds = dao.get ( org.ovirt.engine.core.dao.VdsStaticDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStaticVds.setSSHKeyFingerprint ( "b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; existingVds = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newStaticVds.setSSHKeyFingerprint ( "b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31" ) ; newStaticVds.setPmSecondaryOptionsMap ( new org.ovirt.engine.core.common.queries.ValueObjectMap ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( asyncTaskCreationInfo , parentCommand , description , entityType , entityIds ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , java.lang.String description , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entitiesMap ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { return createTaskImpl ( taskId , asyncTaskCreationInfo , parentCommand , description , entitiesMap ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during CreateTask for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
public java.lang.Integer getMemSharedPercent ( ) { java.lang.Long shared = mVdsStatistics.getmem_shared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( ( shared * 100 ) / physical ) ) ; }

Target:
public java.lang.Integer getMemSharedPercent ( ) { java.lang.Long shared = mVdsStatistics.getMemShared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( ( shared * 100 ) / physical ) ) ; }
Source:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private static void initIscsiBondSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_ISCSI_BOND_HOST_RESTART_WARNING , AuditLogSeverity.WARNING ) ; }

Target:
private static void initIscsiBondSeverities ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_SUCCESS , AuditLogSeverity.NORMAL ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_REMOVE_FAILED , AuditLogSeverity.ERROR ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.USER_ISCSI_BOND_HOST_RESTART_WARNING , AuditLogSeverity.WARNING ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_ADD_SUCCESS_WITH_WARNING , AuditLogSeverity.WARNING ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.severities.put ( AuditLogType.ISCSI_BOND_EDIT_SUCCESS_WITH_WARNING , AuditLogSeverity.WARNING ) ; }
Source:
public void PostUpdateTimeZone ( ) { java.lang.String oldTimeZoneKey = ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( getModel ( ) . getTimeZone ( ) . getSelectedItem ( ) ) ) . getKey ( ) ; getModel ( ) . getTimeZone ( ) . setItems ( cachedTimeZones ) ; if ( oldTimeZoneKey != null ) { getModel ( ) . getTimeZone ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( cachedTimeZones , new org.ovirt.engine.ui.uicommonweb.Linq.TimeZonePredicate ( oldTimeZoneKey ) ) ) ; } else { getModel ( ) . getTimeZone ( ) . setSelectedItem ( null ) ; } }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; cachedTimeZones.set ( index , ( ( java.util.HashMap < java.lang.String , java.lang.String > ) ( returnValue ) ) . entrySet ( ) ) ; behavior.PostUpdateTimeZone ( ) ; }
Source:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.PersistentSetupNetworks , createPersistentSetupNetworksParameters ( ) , org.ovirt.engine.core.bll.network.host.LabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { addCustomValue ( "NicName" , getNic ( ) . getName ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalAction ( VdcActionType.HostSetupNetworks , createHostSetupNetworksParameters ( ) , org.ovirt.engine.core.bll.network.host.LabelNicCommand.cloneContextAndDetachFromParent ( ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionPause ( masterVolumeName , slaveHost , slaveVolumeName , force ) ) ; } 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 glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , userName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getByVdsmTaskId ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public java.util.List < org.ovirt.engine.core.compat.Guid > getChildCommandIds ( org.ovirt.engine.core.compat.Guid cmdId ) { initChildHierarchy ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > childIds = java.util.Collections.EMPTY_LIST ; if ( childHierarchy.containsKey ( cmdId ) ) { childIds = childHierarchy.get ( cmdId ) ; } return childIds ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectVdsNetworkDataVDSCommandParameters ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void testGetDbFieldName ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "$CN" , "$CN" , comp.getDbFieldName ( "NAME" ) ) ; org.junit.Assert.assertNull ( "name" , comp.getDbFieldType ( "name" ) ) ; org.junit.Assert.assertNull ( "22" , comp.getDbFieldType ( "22" ) ) ; }

Target:
public void testGetDbFieldName ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( "$CN" , comp.getDbFieldName ( "NAME" ) , "$CN" ) ; org.junit.jupiter.api.Assertions.assertNull ( comp.getDbFieldType ( "name" ) , "name" ) ; org.junit.jupiter.api.Assertions.assertNull ( comp.getDbFieldType ( "22" ) , "22" ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
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 void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void EndWithFailure ( ) { SetIsVmRunningStateless ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . EndWithFailure ( ) ; } }

Target:
protected void EndWithFailure ( ) { SetIsVmRunningStateless ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . EndWithFailure ( ) ; } }
Source:
protected void initHeader ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , constants.aliasTemplate ( ) ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , constants.disksTemplate ( ) , "110px" ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , constants.actualSizeTemplate ( ) , "110px" ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , constants.creationDateTemplate ( ) , "170px" ) ; }

Target:
protected void initHeader ( ) { table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaTemplateView.constants.aliasTemplate ( ) ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaTemplateView.constants.disksTemplate ( ) , "110px" ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaTemplateView.constants.actualSizeTemplate ( ) , "110px" ) ; table.addColumn ( new org.ovirt.engine.ui.common.widget.table.column.EmptyColumn ( ) , org.ovirt.engine.ui.webadmin.section.main.view.tab.quota.SubTabQuotaTemplateView.constants.creationDateTemplate ( ) , "170px" ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeFloppy ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeFloppy" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "status" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc changeFloppy ( java.lang.String vmId , java.lang.String imageLocation ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.changeFloppy" ) . withParameter ( "vmID" , vmId ) . withParameter ( "driveSpec" , imageLocation ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }