auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( true , vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext ) ; } }

Target:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( true , vmId ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmForNonShareableDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { if ( ! ( disk.isShareable ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.RemoveImageCommand.getVmDAO ( ) . getVmsListForDisk ( disk.getId ( ) , false ) ; if ( ! ( vms.isEmpty ( ) ) ) { return vms.get ( 0 ) ; } } return null ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; host1.setHostName ( "host1" ) ; host2.setHostName ( "host2" ) ; existingHost1.setHostName ( "existingHost1" ) ; existingHost2.setHostName ( "existingHost2" ) ; org.ovirt.engine.core.common.businessentities.Provider hostProvider = new org.ovirt.engine.core.common.businessentities.Provider ( ) ; hostProvider.setUsername ( "admin" ) ; hostProvider.setPassword ( "password" ) ; hostProvider.setUrl ( "http://provider.com" ) ; hostProvider.setType ( ProviderType.FOREMAN ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; host1.setHostName ( "host1" ) ; host2.setHostName ( "host2" ) ; existingHost1.setHostName ( "existingHost1" ) ; existingHost2.setHostName ( "existingHost2" ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getvds_name ( ) ) ; } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getName ( ) ) ; } }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains storage : storageDomains ) { if ( storage.getstorage_pool_id ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getStoragePoolId ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }
Source:
private void initComparators ( ) { java.util.List < java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > comparators = java.util.Arrays.asList ( java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain2 ) ) , java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain3 ) ) . reversed ( ) ) ; org.mockito.Mockito.doReturn ( comparators ) . when ( memoryStorageHandler ) . getStorageDomainComparators ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
private void initComparators ( ) { java.util.List < java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > > comparators = java.util.Arrays.asList ( java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain2 ) ) , java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.StorageDomain sd ) -> sd.equals ( validStorageDomain3 ) ) . reversed ( ) ) ; org.mockito.Mockito.doReturn ( comparators ) . when ( memoryStorageHandler ) . getStorageDomainComparators ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
private void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
protected void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
public void setAcceptableValues ( java.util.Collection < java.util.List < T > > newValues ) { super . setValue ( newValues.iterator ( ) . next ( ) , false ) ; super . setAcceptableValues ( newValues ) ; itemIndex.clear ( ) ; for ( java.util.List < T > value : newValues ) { addToItems ( value ) ; itemIndex.add ( value.get ( 0 ) ) ; } }

Target:
public void setAcceptableValues ( java.util.Collection < java.util.List < T > > newValues ) { if ( ( newValues == null ) || ( newValues.isEmpty ( ) ) ) { return ; } super . setValue ( newValues.iterator ( ) . next ( ) , false ) ; super . setAcceptableValues ( newValues ) ; itemIndex.clear ( ) ; for ( java.util.List < T > value : newValues ) { addToItems ( value ) ; itemIndex.add ( value.get ( 0 ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; org.ovirt.engine.core.compat.NGuid guid = new org.ovirt.engine.core.compat.NGuid ( domain.getBytes ( ) , true ) ; ds.setId ( guid.toString ( ) ) ; dsl.add ( ds ) ; } return dsl ; }

Target:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; org.ovirt.engine.core.compat.Guid guid = new org.ovirt.engine.core.compat.Guid ( domain.getBytes ( ) , true ) ; ds.setId ( guid.toString ( ) ) ; dsl.add ( ds ) ; } return dsl ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( lastExecutedCommand.getName ( ) . equals ( "OnSave" ) ) { return forceCreateConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.disks.DiskListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
private static org.ovirt.engine.core.common.job.Job getJob ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = command.getParameters ( ) ; org.ovirt.engine.core.common.job.Job job ; if ( ( params.getJobId ( ) ) != null ) { job = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . get ( ( ( org.ovirt.engine.core.compat.Guid ) ( params.getJobId ( ) ) ) ) ; } else { job = org.ovirt.engine.core.bll.job.ExecutionHandler.createJob ( actionType , command ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . saveJob ( job ) ; } return job ; }

Target:
private static org.ovirt.engine.core.common.job.Job getJob ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionParametersBase params = command.getParameters ( ) ; org.ovirt.engine.core.common.job.Job job ; if ( ( params.getJobId ( ) ) != null ) { job = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getJobDao ( ) . get ( params.getJobId ( ) ) ; } else { job = org.ovirt.engine.core.bll.job.ExecutionHandler.createJob ( actionType , command ) ; org.ovirt.engine.core.bll.job.JobRepositoryFactory.getJobRepository ( ) . saveJob ( job ) ; } return job ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.system.ClientStorageKeyPrefix.class ) . to ( org.ovirt.engine.ui.userportal.gin.SystemModule.CLIENT_STORAGE_KEY_PREFIX ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.system.ClientStorageKeyPrefix.class ) . to ( org.ovirt.engine.ui.userportal.gin.SystemModule.CLIENT_STORAGE_KEY_PREFIX ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String state = org.ovirt.engine.core.aaa.SsoUtils.createUniqueStateInSessionIfNotExists ( request ) ; java.lang.String scope = java.lang.String.format ( "ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( authSequencePriorityPropertyName ) ) ; request.getSession ( true ) . setAttribute ( "app_url" , request.getParameter ( "app_url" ) ) ; java.lang.String redirectUri = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , postActionUrl ) ; response.sendRedirect ( new org.ovirt.engine.core.uutils.net.URLBuilder ( org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineSsoUrl ( request ) , "/oauth/authorize" ) . addParameter ( "client_id" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_CLIENT_ID" ) ) . addParameter ( "response_type" , "code" ) . addParameter ( "engine_url" , org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineUrl ( request ) ) . addParameter ( "redirect_uri" , redirectUri ) . addParameter ( "scope" , scope ) . addParameter ( "state" , state ) . build ( ) ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String scope = java.lang.String.format ( "ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( authSequencePriorityPropertyName ) ) ; request.getSession ( true ) . setAttribute ( "app_url" , request.getParameter ( "app_url" ) ) ; java.lang.String redirectUri = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , postActionUrl ) ; response.sendRedirect ( new org.ovirt.engine.core.uutils.net.URLBuilder ( org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineSsoUrl ( request ) , "/oauth/authorize" ) . addParameter ( "client_id" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_CLIENT_ID" ) ) . addParameter ( "response_type" , "code" ) . addParameter ( "engine_url" , org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineUrl ( request ) ) . addParameter ( "redirect_uri" , redirectUri ) . addParameter ( "scope" , scope ) . build ( ) ) ; }
Source:
public static void GetClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( clusterId ) , aQuery ) ; }

Target:
public static void GetClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
void localize ( ) { selectHostAutomaticallyEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupSelectHostAutomaticallyLabel ( ) ) ; selectDestinationHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupSelectDestinationHostLabel ( ) ) ; hostsListEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupHostsListLabel ( ) ) ; clustersEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.hostClusterVmPopup ( ) ) ; message1.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateNoAvailableHost ( ) ) ; }

Target:
void localize ( ) { message1.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateNoAvailableHost ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains getStorageDomainById ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { if ( storageDomainsMap.containsKey ( storageDomainId ) ) { return storageDomainsMap.get ( storageDomainId ) ; } org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = getStorageDomainDao ( ) . getForStoragePool ( storageDomainId , storagePoolId ) ; storageDomainsMap.put ( storageDomainId , storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain getStorageDomainById ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId ) { if ( storageDomainsMap.containsKey ( storageDomainId ) ) { return storageDomainsMap.get ( storageDomainId ) ; } org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getStorageDomainDao ( ) . getForStoragePool ( storageDomainId , storagePoolId ) ; storageDomainsMap.put ( storageDomainId , storageDomain ) ; return storageDomain ; }
Source:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = dbFacade.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( vdsGroup ) ; java.lang.String name = vdsGroup.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID , VdcObjectType.VdsGroups ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = dbFacade.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( vdsGroup ) ; java.lang.String name = vdsGroup.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID , VdcObjectType.VdsGroups ) ) ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQueryTest.EXISTING_VM_NAME ) ; snapshotVmConfigurationHelper = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.SnapshotVmConfigurationHelper ( ) ) ; org.mockito.Mockito.when ( getQuery ( ) . getSnapshotVmConfigurationHelper ( ) ) . thenReturn ( snapshotVmConfigurationHelper ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsManager snapshotsManager = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.snapshots.SnapshotsManager.class ) ; org.mockito.Mockito.when ( snapshotVmConfigurationHelper.getSnapshotManager ( ) ) . thenReturn ( snapshotsManager ) ; setUpDaoMocks ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; existingSnapshot = createSnapshot ( existingSnapshotId ) ; existingSnapshot.setVmConfiguration ( org.ovirt.engine.core.bll.GetVmConfigurationBySnapshotQueryTest.EXISTING_VM_NAME ) ; setUpDaoMocks ( ) ; }
Source:
private void mockStoragePoolDao ( ) { org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setId ( spId ) ; sp.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( spId ) ) . thenReturn ( sp ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( spyCommand ) . getStoragePoolDao ( ) ; }

Target:
private void mockStoragePoolDao ( ) { org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setId ( spId ) ; sp.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDao.get ( spId ) ) . thenReturn ( sp ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { if ( ( items ) != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel : ( ( java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > ) ( items ) ) ) { itemModel.clearReferences ( ) ; } } ItemsChanging ( value , items ) ; items = value ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
public void testCompareFetchGlobalQuotaForSpecificAndForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterGlobalList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterSpecificList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertEquals ( true , quotaClusterGlobalList.equals ( quotaClusterSpecificList ) ) ; }

Target:
public void testCompareFetchGlobalQuotaForSpecificAndForGlobalCluster ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterGlobalList = dao.getQuotaClusterByClusterGuid ( null , FixturesTool.QUOTA_GENERAL ) ; java.util.List < org.ovirt.engine.core.common.businessentities.QuotaCluster > quotaClusterSpecificList = dao.getQuotaClusterByClusterGuid ( FixturesTool.CLUSTER_RHEL6_ISCSI , FixturesTool.QUOTA_GENERAL ) ; org.junit.Assert.assertEquals ( quotaClusterGlobalList , quotaClusterSpecificList ) ; }
Source:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }
Source:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = mockScheduler ( ) ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }

Target:
public void testCheckAddEditValidations ( ) { org.ovirt.engine.core.compat.Guid clusterPolicyId = new org.ovirt.engine.core.compat.Guid ( "e754440b-76a6-4099-8235-4565ab4b5521" ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = new org.ovirt.engine.core.common.scheduling.ClusterPolicy ( ) ; clusterPolicy.setId ( clusterPolicyId ) ; org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand command = new org.ovirt.engine.core.bll.scheduling.commands.ClusterPolicyCRUDCommand ( new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicyId , clusterPolicy ) , null ) { @ java.lang.Override protected void executeCommand ( ) { } } ; command.schedulingManager = mockScheduler ( ) ; org.junit.Assert.assertTrue ( command.checkAddEditValidations ( ) ) ; }
Source:
public void shouldNotElectInactiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Inactive , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertNull ( cmd.electNewMaster ( false , true , false ) ) ; }

Target:
public void shouldNotElectInactiveHostedEngineDomain ( ) { prepareStorageDomainForElection ( StorageDomainStatus.Inactive , org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBaseTest.HE_STORAGE_DOMAIN_NAME , true ) ; org.junit.Assert.assertNull ( cmd.electNewMaster ( false , true , false ) ) ; }
Source:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDao ) . when ( cmd ) . getStoragePoolIsoMapDao ( ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }

Target:
public void setUp ( ) { storagePool = cmd.getParameters ( ) . getStoragePool ( ) ; cmd.init ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { assertNotNull ( model ) ; assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) . getState ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { assertNotNull ( model ) ; assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) ) ; verifyLinks ( model ) ; }
Source:
public void testGetWatchDogModels ( ) throws java.lang.Exception { java.util.ArrayList < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.Assert.assertTrue ( ( ( watchDogModels.size ( ) ) == 2 ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.Assert.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }

Target:
public void testGetWatchDogModels ( ) throws java.lang.Exception { java.util.List < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.Assert.assertTrue ( ( ( watchDogModels.size ( ) ) == 2 ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.Assert.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; org.ovirt.engine.api.model.DataCenter model = org.ovirt.engine.api.restapi.resource.BackendDataCentersResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 ) { try { return doGetEntity ( clz , query , queryParams , identifier ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , notFoundAs404 ) ; } }

Target:
public < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.VdcQueryType query , org.ovirt.engine.core.common.queries.VdcQueryParametersBase queryParams , java.lang.String identifier , boolean notFoundAs404 ) { return getEntity ( clz , query , queryParams , identifier , notFoundAs404 , true ) ; }
Source:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addDiskPermissions ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( org.ovirt.engine.core.bll.AddDiskCommand.getCurrentUser ( ) . getId ( ) , PredefinedRoles.DISK_OPERATOR.getId ( ) , disk.getId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; } }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntity ( ) , getEntity ( ) . getStoragePoolId ( ) , cluster.getCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntity ( ) , getEntity ( ) . getStoragePoolId ( ) , cluster.getCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , getSelectedItem ( ) , this ) ; setWindow ( model ) ; }
Source:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.errorFormat ( "Error when attempting to deactivate storage domain {0}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }

Target:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error when attempting to deactivate storage domain {0}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }
Source:
private org.ovirt.engine.ui.common.widget.MenuBar rootMenu ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item ) { org.ovirt.engine.ui.common.widget.MenuBar menuBar = new org.ovirt.engine.ui.common.widget.MenuBar ( true ) ; menuBar.addItem ( ( "Menu for " + ( item.getName ( ) ) ) , ( ( com.google.gwt.user.client.Command ) ( null ) ) ) ; menuBar.addSeparator ( ) ; return menuBar ; }

Target:
private org.ovirt.engine.ui.common.widget.MenuBar rootMenu ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item ) { org.ovirt.engine.ui.common.widget.MenuBar menuBar = new org.ovirt.engine.ui.common.widget.MenuBar ( true ) ; return menuBar ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterClustersWithoutArchitecture ( clusters ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , null ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . filterClustersWithoutArchitecture ( clusters ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , null ) ; }