auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void successfulFenceWithDifferentProxyRetry ( ) { mockProxyHost ( true ) ; mockFenceFailure ( true ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.Start , agent ) ; org.junit.Assert.assertTrue ( result.getSucceeded ( ) ) ; org.mockito.Mockito.verify ( proxyLocator ) . findProxyHost ( true , org.ovirt.engine.core.bll.FenceExecutorTest.PROXY_HOST_ID ) ; }

Target:
public void successfulFenceWithDifferentProxyRetry ( ) { mockProxyHost ( true ) ; mockFenceFailure ( true ) ; org.ovirt.engine.core.common.businessentities.FenceAgent agent = createAgent ( ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.fence ( FenceActionType.START , agent ) ; org.junit.Assert.assertTrue ( result.getSucceeded ( ) ) ; org.mockito.Mockito.verify ( proxyLocator ) . findProxyHost ( true , org.ovirt.engine.core.bll.FenceExecutorTest.PROXY_HOST_ID ) ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnappableVmDisks ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void testGetForceTrue ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RefreshHostCapabilities , org.ovirt.engine.core.common.action.VdsActionParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , null , false ) ; testGetWithForce ( true , uriInfo , true ) ; }

Target:
public void testGetForceTrue ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RefreshHost , org.ovirt.engine.core.common.action.VdsActionParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , null , false ) ; testGetWithForce ( true , uriInfo , true ) ; }
Source:
public java.lang.Void runInTransaction ( ) { map.setstatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { map.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; if ( ( getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } return null ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; return domainPoolMap ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { setStorageDomain ( null ) ; setStoragePool ( null ) ; if ( canDoAction ( ) ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap domainPoolMap = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getStoragePool ( ) . setstatus ( StoragePoolStatus.Problematic ) ; executeReconstruct ( ) ; } return new org.ovirt.engine.core.common.eventqueue.EventResult ( reconstructOpSucceeded , org.ovirt.engine.core.common.eventqueue.EventType.RECONSTRUCT ) ; }
Source:
private boolean isRunningConfigurationNeeded ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . isNextRunConfigurationExists ( ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValidForVmDevices ( getVmId ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) ) ) ) ; }

Target:
private boolean isRunningConfigurationNeeded ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . isNextRunConfigurationExists ( ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) , isHotSetEnabled ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValidForVmDevices ( getVmId ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) ) ) ) ; }
Source:
public void makeSortable ( ) { makeSortable ( new java.util.Comparator < T > ( ) { @ java.lang.Override public int compare ( T o1 , T o2 ) { boolean value1 = ( ( getValue ( o1 ) ) == null ) ? false : getValue ( o1 ) ; boolean value2 = ( ( getValue ( o2 ) ) == null ) ? false : getValue ( o2 ) ; if ( value1 == value2 ) { return 0 ; } else { return value1 ? 1 : - 1 ; } } } ) ; }

Target:
public void makeSortable ( ) { makeSortable ( java.util.Comparator.comparing ( ( t ) -> ! ( ( org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn.getValue ( t ) ) == null ? false : org.ovirt.engine.ui.common.widget.table.column.AbstractCheckboxColumn.getValue ( t ) ) ) ) ; }
Source:
public final void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { onBrowserEvent ( context , parent , value , null , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { com.google.gwt.safehtml.shared.SafeHtml tooltip = getTooltip ( value ) ; if ( tooltip == null ) { tooltip = getTooltip ( value , parent ) ; } org.ovirt.engine.ui.common.utils.ElementTooltipUtils.handleCellEvent ( event , parent , tooltip ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
protected boolean checkTemplateImages ( java.util.List < java.lang.String > reasons ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.AddVmPoolWithVms ) ) { return true ; } for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : destStorages.values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) , storage.getId ( ) , reasons , false , false , true , true , storageToDisksMap.get ( storage.getId ( ) ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean checkTemplateImages ( java.util.List < java.lang.String > reasons ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.AddVmPoolWithVms ) ) { return true ; } for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : destStorages.values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.isVmTemplateImagesReady ( vmDisksSource , storage.getId ( ) , reasons , false , false , true , true , storageToDisksMap.get ( storage.getId ( ) ) ) ) ) { return false ; } } return true ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; java.lang.String id = reader.readString ( ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryGroup ( directoryName , id , name ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup instantiate ( com.google.gwt.user.client.rpc.SerializationStreamReader reader ) throws com.google.gwt.user.client.rpc.SerializationException { java.lang.String directoryName = reader.readString ( ) ; java.lang.String namespace = reader.readString ( ) ; java.lang.String id = reader.readString ( ) ; java.lang.String name = reader.readString ( ) ; return new org.ovirt.engine.core.aaa.DirectoryGroup ( directoryName , namespace , id , name ) ; }
Source:
private void filterVmsFromMonitoringCycle ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : runningVms.keySet ( ) ) { if ( ! ( vmManagers.containsKey ( vmId ) ) ) { runningVms.remove ( vmId ) ; vmDict.remove ( vmId ) ; org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.infoFormat ( "skipping vm {0} from this monitoring cycle" , vmId ) ; } } }

Target:
private void filterVmsFromMonitoringCycle ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : runningVms.keySet ( ) ) { if ( ! ( vmManagers.containsKey ( vmId ) ) ) { runningVms.remove ( vmId ) ; vmDict.remove ( vmId ) ; org.ovirt.engine.core.vdsbroker.VmsMonitoring.log.debug ( ( "skipping VM '{}' from this monitoring cycle -" + " the VM is locked by its VmManager " ) , vmId ) ; } } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; boolean inputFieldsEnabled = ( ( java.lang.Boolean ) ( entity.getEntity ( ) ) ) ; getView ( ) . postModelEnabled ( inputFieldsEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propertyName ) ) { getView ( ) . setMessageLabel ( model.getMessage ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.ExecuteAction ( ) ; } default : { return org.ovirt.engine.core.bll.Backend.NotAutorizedError ( ) ; } } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; } default : { return org.ovirt.engine.core.bll.Backend.NotAutorizedError ( ) ; } } }
Source:
private void findNegotiatingProfiles ( ) { if ( ( profiles ) == null ) { synchronized ( this ) { if ( ( profiles ) == null ) { profiles = new java.util.ArrayList < org.ovirt.engine.core.aaa.AuthenticationProfile > ( 1 ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ) { if ( profile != null ) { org.ovirt.engine.core.aaa.Authenticator authenticator = profile.getAuthenticator ( ) ; if ( authenticator instanceof org.ovirt.engine.core.aaa.NegotiatingAuthenticator ) { profiles.add ( 0 , profile ) ; } } } } } } }

Target:
private void findNegotiatingProfiles ( ) { if ( ( profiles ) == null ) { synchronized ( this ) { if ( ( profiles ) == null ) { profiles = new java.util.ArrayList < org.ovirt.engine.core.aaa.AuthenticationProfile > ( 1 ) ; for ( org.ovirt.engine.core.aaa.AuthenticationProfile profile : org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfiles ( ) ) { if ( profile != null ) { org.ovirt.engine.core.aaa.Authenticator authenticator = profile.getAuthenticator ( ) ; if ( authenticator.isNegotiationAuth ( ) ) { profiles.add ( 0 , profile ) ; } } } } } } }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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 ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , volume.getTransportTypes ( ) . getTransportTypes ( ) ) ; } if ( volume.isSetAccessProtocols ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol.class , volume.getAccessProtocols ( ) . getAccessProtocols ( ) ) ; } }

Target:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnumValues ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , volume.getTransportTypes ( ) . getTransportTypes ( ) ) ; } if ( volume.isSetAccessProtocols ( ) ) { validateEnumValues ( org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol.class , volume.getAccessProtocols ( ) . getAccessProtocols ( ) ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getUpdateCommand ( ) ) ) { update ( ) ; } else if ( command == ( getLoginAllCommand ( ) ) ) { loginAll ( ) ; } else if ( command == ( getDiscoverTargetsCommand ( ) ) ) { discoverTargets ( ) ; } }

Target:
protected void login ( ) { loginAll ( ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingStorageConnection ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetStorageServerConnectionById , org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase.class , new java.lang.String [ ] { "ServerConnectionId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondStorageConnectionResourceTest.STORAGE_CONNECTION_ID.toString ( ) } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.StorageConnection model = resource.get ( ) ; assertEquals ( GUIDS [ 0 ] . toString ( ) , model.getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public org.ovirt.engine.api.model.RSDL build ( ) { try { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; org.ovirt.engine.api.restapi.rsdl.RsdlBuilder.LOG.error ( "RSDL generation failure." , e ) ; } return rsdl ; }

Target:
public org.ovirt.engine.api.model.RSDL build ( ) { try { rsdl = construct ( ) ; rsdl.setRel ( getRel ( ) ) ; rsdl.setHref ( getHref ( ) ) ; rsdl.setDescription ( getDescription ( ) ) ; rsdl.setSchema ( getSchema ( ) ) ; rsdl.setApi ( getEntryPoint ( ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; org.ovirt.engine.api.restapi.rsdl.RsdlBuilder.LOG.error ( "RSDL generation failure." , e ) ; } return rsdl ; }
Source:
private static org.ovirt.engine.core.common.businessentities.RepoFileMetaData getNewIsoRepoFile ( ) { org.ovirt.engine.core.common.businessentities.RepoFileMetaData newRepoFileMap = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; newRepoFileMap.setFileType ( ImageFileType.ISO ) ; newRepoFileMap.setRepoFileName ( "isoDomain.iso" ) ; newRepoFileMap.setLastRefreshed ( java.lang.System.currentTimeMillis ( ) ) ; newRepoFileMap.setSize ( 0 ) ; newRepoFileMap.setDateCreated ( null ) ; newRepoFileMap.setRepoDomainId ( FixturesTool.STORAGE_DOAMIN_NFS_ISO ) ; return newRepoFileMap ; }

Target:
private static org.ovirt.engine.core.common.businessentities.RepoFileMetaData getNewIsoRepoFile ( ) { org.ovirt.engine.core.common.businessentities.RepoFileMetaData newRepoFileMap = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; newRepoFileMap.setFileType ( ImageFileType.ISO ) ; newRepoFileMap.setRepoImageId ( "isoDomain.iso" ) ; newRepoFileMap.setLastRefreshed ( java.lang.System.currentTimeMillis ( ) ) ; newRepoFileMap.setSize ( 0 ) ; newRepoFileMap.setDateCreated ( null ) ; newRepoFileMap.setRepoDomainId ( FixturesTool.STORAGE_DOAMIN_NFS_ISO ) ; return newRepoFileMap ; }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryPrincipals ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipals ( extension , namespace , inputMap ) ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryPrincipalRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.PRINCIPAL ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populatePrincipalRecords ( extension , namespace , inputMap ) ; }
Source:
private void UpdateVolumeFormat ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned : ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getstorage_type ( ) ; setVolumeFormat ( org.ovirt.engine.ui.uicommonweb.DataProvider.GetDiskVolumeFormat ( volumeType , storageType ) ) ; }

Target:
private void VolumeType_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( ( getVolumeType ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Unassigned : ( ( org.ovirt.engine.core.common.businessentities.VolumeType ) ( getVolumeType ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.StorageType storageType = ( ( getStorageDomain ( ) . getSelectedItem ( ) ) == null ) ? org.ovirt.engine.core.common.businessentities.StorageType.UNKNOWN : ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) . getstorage_type ( ) ; updateVolumeFormat ( volumeType , storageType ) ; updateShareable ( volumeType , storageType ) ; }
Source:
public < T > T getValue ( org.ovirt.engine.core.common.config.ConfigValues name , java.lang.String version ) { java.util.Map < java.lang.String , T > values = getValuesForAllVersions ( name ) ; if ( ( values != null ) && ( values.containsKey ( version ) ) ) { return values.get ( version ) ; } throw new java.lang.IllegalArgumentException ( ( ( ( name.toString ( ) ) + " has no value for version: " ) + version ) ) ; }

Target:
public boolean valueExists ( org.ovirt.engine.core.common.config.ConfigValues configValue , java.lang.String version ) { java.util.Map < java.lang.String , java.lang.Object > values = getValuesForAllVersions ( configValue ) ; return ( values != null ) && ( values.containsKey ( version ) ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Event add ( org.ovirt.engine.sdk.decorators.Event event ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , event , org.ovirt.engine.sdk.entities.Event.class , org.ovirt.engine.sdk.decorators.Event.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Event add ( org.ovirt.engine.sdk.decorators.Event event ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , event , org.ovirt.engine.sdk.entities.Event.class , org.ovirt.engine.sdk.decorators.Event.class , headers ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > createDiskValidDomainsMap ( org.ovirt.engine.core.common.businessentities.DiskImage ... diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > toReturn = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { toReturn.put ( diskImage.getId ( ) , java.util.Collections.singleton ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; } return toReturn ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > createDiskValidDomainsMap ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ... diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Set < org.ovirt.engine.core.compat.Guid > > toReturn = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImages ) { toReturn.put ( diskImage.getId ( ) , java.util.Collections.singleton ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; } return toReturn ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; return performCreate ( VdcActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.OpenstackVolumeAuthenticationKey authenticationKey ) { validateParameters ( authenticationKey , "uuid" , "value" , "usageType" ) ; return performCreate ( ActionType.AddLibvirtSecret , new org.ovirt.engine.core.common.action.LibvirtSecretParameters ( map ( addProvider ( authenticationKey ) ) ) , new org.ovirt.engine.api.restapi.resource.openstack.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLibvirtSecretById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testGetRootDSEFirstSeverUnreachable ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; urls.add ( new java.net.URI ( org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.BAD_URL ) ) ; urls.add ( new java.net.URI ( "ldap://ldap1.example.com:389" ) ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; try { org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , urls.get ( 0 ) ) ) ; } catch ( java.lang.Exception e ) { return ; } org.junit.Assert.fail ( "Get rootDSE task passed with no timeout. Investigate why the task completed instead of throwing TimeoutException" ) ; }

Target:
public void testGetRootDSEFirstSeverUnreachable ( ) throws java.lang.Exception { java.util.List < java.net.URI > urls = new java.util.ArrayList < java.net.URI > ( ) ; urls.add ( new java.net.URI ( org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.BAD_URL ) ) ; urls.add ( new java.net.URI ( "ldap://ldap1.example.com:389" ) ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcher dirSearcher = mockDirectorySearcher ( urls ) ; org.ovirt.engine.core.bll.adbroker.DirectorySearcherTest.execute ( new org.ovirt.engine.core.bll.adbroker.GetRootDSETask ( dirSearcher , "mydomain" , urls.get ( 0 ) ) ) ; }
Source:
public org.ovirt.engine.core.common.job.Job getJob ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; } return job ; }

Target:
public org.ovirt.engine.core.common.job.Job getJob ( final org.ovirt.engine.core.compat.Guid jobId ) { return org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.job.Job > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; } } ) ; }
Source:
private void mockClusterDao ( ) { org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.mockito.Mockito.when ( clusterDao.get ( clusterId ) ) . thenReturn ( cluster ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
private static void assertDiskDescriptionMap ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { org.junit.Assert.assertEquals ( "Should be map of disk alias and disk description" , java.lang.String.format ( ( "{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}" ) , disk.getDiskAlias ( ) , org.apache.commons.lang.StringUtils.defaultString ( disk.getDiskDescription ( ) ) ) , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.getJsonDiskDescription ( disk ) ) ; }

Target:
private void assertDiskDescriptionMap ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { org.junit.Assert.assertEquals ( "Should be map of disk alias and disk description" , java.lang.String.format ( ( "{\"DiskAlias\":\"%s\"," + "\"DiskDescription\":\"%s\"}" ) , disk.getDiskAlias ( ) , org.apache.commons.lang.StringUtils.defaultString ( disk.getDiskDescription ( ) ) ) , metadataDiskDescriptionHandler.getJsonDiskDescription ( disk ) ) ; }
Source:
public org.ovirt.engine.api.model.VMs list ( ) { if ( isFiltered ( ) ) return mapCollection ( getBackendCollection ( VdcQueryType.GetUserVmsByUserIdAndGroups , new org.ovirt.engine.core.common.queries.GetUserVmsByUserIdAndGroupsParameters ( getCurrent ( ) . get ( org.ovirt.engine.core.common.users.VdcUser.class ) . getUserId ( ) ) ) ) ; else return mapCollection ( getBackendCollection ( SearchType.VM ) ) ; }

Target:
public org.ovirt.engine.api.model.VMs list ( ) { if ( isFiltered ( ) ) return mapCollection ( getBackendCollection ( VdcQueryType.GetAllVms , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; else return mapCollection ( getBackendCollection ( SearchType.VM ) ) ; }
Source:
protected void executeCommand ( ) { boolean removedStatelessSnapshot = detachUsers ( ) ; if ( ! removedStatelessSnapshot ) { removeVmStatelessImages ( ) ; } org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuotaByVmId ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; removeStatelessVmUnmanagedDevices ( ) ; applyNextRunConfiguration ( ) ; }

Target:
protected void executeCommand ( ) { boolean removedStatelessSnapshot = detachUsers ( ) ; if ( ! removedStatelessSnapshot ) { removeVmStatelessImages ( ) ; } org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuotaByVmId ( org.ovirt.engine.core.bll.ProcessDownVmCommand.getVmId ( ) ) ; removeStatelessVmUnmanagedDevices ( ) ; boolean vmHasDirectPassthroughDevices = releaseUsedHostDevices ( ) ; org.ovirt.engine.core.compat.Guid hostId = cleanupVfs ( ) ; refreshHostIfNeeded ( ( hostId == null ? vmHasDirectPassthroughDevices ? org.ovirt.engine.core.bll.ProcessDownVmCommand.getVm ( ) . getDedicatedVmForVds ( ) : null : hostId ) ) ; applyNextRunConfiguration ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { 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.BackendClusterNetworkResourceTest.NETWORK_ID } , null , null ) ; 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 ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private int getResourceType ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , java.lang.String resource ) { if ( ( ( node.SelectSingleNode ( resource , _xmlNS ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ) ) ) { return java.lang.Integer.valueOf ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ; } return - 1 ; }

Target:
private int getResourceType ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , java.lang.String resource ) { if ( ( ( node.SelectSingleNode ( resource , _xmlNS ) ) != null ) && ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ) ) ) { return java.lang.Integer.parseInt ( node.SelectSingleNode ( resource , _xmlNS ) . innerText ) ; } return - 1 ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
org.ovirt.engine.core.common.businessentities.VM getCachedVm ( ) { if ( ( cachedVm ) == null ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . getOptions ( ) . getVmId ( ) ) ; params.setFiltered ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . isFiltered ( ) ) ; params.setSessionId ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . getSessionId ( ) ) ; cachedVm = org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmByVmId , params ) . getReturnValue ( ) ; } return cachedVm ; }

Target:
org.ovirt.engine.core.common.businessentities.VM getCachedVm ( ) { if ( ( cachedVm ) == null ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . getOptions ( ) . getVmId ( ) ) ; params.setFiltered ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . isFiltered ( ) ) ; params.setSessionId ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery.getParameters ( ) . getSessionId ( ) ) ; cachedVm = backend.runInternalQuery ( VdcQueryType.GetVmByVmId , params ) . getReturnValue ( ) ; } return cachedVm ; }
Source:
private void assertVmInOutput ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < java.util.List < java.lang.String > > > returnValue , org.ovirt.engine.core.compat.Guid vmId , org.hamcrest.Matcher violationsMatcher ) { org.junit.Assert.assertThat ( returnValue , org.hamcrest.Matchers.hasKey ( vmId ) ) ; final java.util.List < java.util.List < java.lang.String > > vmViolations = returnValue.get ( vmId ) ; org.junit.Assert.assertThat ( vmViolations , violationsMatcher ) ; }

Target:
private void assertVmInOutput ( java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < java.util.List < java.lang.String > > > returnValue , org.ovirt.engine.core.compat.Guid vmId , org.hamcrest.Matcher violationsMatcher ) { org.hamcrest.MatcherAssert.assertThat ( returnValue , org.hamcrest.Matchers.hasKey ( vmId ) ) ; final java.util.List < java.util.List < java.lang.String > > vmViolations = returnValue.get ( vmId ) ; org.hamcrest.MatcherAssert.assertThat ( vmViolations , violationsMatcher ) ; }
Source:
private void testAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertTrue ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult.isValid ( ) ) ; } else { org.junit.Assert.assertFalse ( ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type allowed succeeded, version: " + version ) , attachDomainResult.isValid ( ) ) ; assertFailingMessage ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type failed with the wrong message" , attachDomainResult , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } }

Target:
private void assertAddingMixedTypes ( org.ovirt.engine.core.compat.Version version , boolean addingMixedTypesShouldSucceed ) { storagePool.setCompatibilityVersion ( version ) ; org.ovirt.engine.core.bll.ValidationResult attachDomainResult = validator.validateDomainCanBeAttachedToPool ( ) ; if ( addingMixedTypesShouldSucceed ) { org.junit.Assert.assertTrue ( ( "Attaching an ISCSI domain to a pool with NFS domain with with mixed type allowed failed, version: " + version ) , attachDomainResult.isValid ( ) ) ; } else { org.junit.Assert.assertFalse ( ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type allowed succeeded, version: " + version ) , attachDomainResult.isValid ( ) ) ; assertFailingMessage ( "Attaching an ISCSI domain to a pool with NFS domain with no mixed type failed with the wrong message" , attachDomainResult , EngineMessage.ACTION_TYPE_FAILED_MIXED_STORAGE_TYPES_NOT_ALLOWED ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.Bookmark mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Bookmark entity = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; entity.setbookmark_id ( new org.ovirt.engine.core.compat.Guid ( rs.getString ( "bookmark_id" ) ) ) ; entity.setbookmark_name ( rs.getString ( "bookmark_name" ) ) ; entity.setbookmark_value ( rs.getString ( "bookmark_value" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.Bookmark mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Bookmark entity = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; entity.setbookmark_id ( getGuid ( rs , "bookmark_id" ) ) ; entity.setbookmark_name ( rs.getString ( "bookmark_name" ) ) ; entity.setbookmark_value ( rs.getString ( "bookmark_value" ) ) ; return entity ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else { } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } else { } return retval ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Permissions user ) { switch ( user.getRoleType ( ) ) { case ADMIN : return getCommonResources ( ) . adminImage ( ) ; case USER : return getCommonResources ( ) . userImage ( ) ; default : return getCommonResources ( ) . userImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Permission user ) { switch ( user.getRoleType ( ) ) { case ADMIN : return getCommonResources ( ) . adminImage ( ) ; case USER : return getCommonResources ( ) . userImage ( ) ; default : return getCommonResources ( ) . userImage ( ) ; } }
Source:
protected boolean disconnectStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { try { return org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( storageDomain.getStorageType ( ) ) . disconnectStorageFromDomainByVdsId ( storageDomain , getVdsId ( ) ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Exception while disconnecting a storage domain" , e ) ; return false ; } }

Target:
protected boolean disconnectStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { try { return org.ovirt.engine.core.bll.storage.connection.StorageHelperDirector.getInstance ( ) . getItem ( storageDomain.getStorageType ( ) ) . disconnectStorageFromDomainByVdsId ( storageDomain , getVdsId ( ) ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Exception while disconnecting a storage domain" , e ) ; return false ; } }