auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setItems ( model.value ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.Collections.sort ( storageDomains , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; setStorageDomains ( storageDomains ) ; setDisks ( value ) ; }
Source:
public void testClusterSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setVdsGroupSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }

Target:
public void testClusterSpiceProxy ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setClusterSpiceProxy ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapperTest.CLUSTER_SPICE_PROXY , model.getDisplay ( ) . getProxy ( ) ) ; }
Source:
public void onPowerringUp ( ) { decreasePendingVm ( vmStaticDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }

Target:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } snapshotDao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( snapshotDao.getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { org.ovirt.engine.core.bll.RunVmCommand.removeMemoryDisks ( memory ) ; } }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public final void AddField ( java.lang.Enum < ? > status , java.lang.String fieldName ) { java.util.Set < java.lang.String > values = dictionary.get ( status ) ; if ( values == null ) { values = new java.util.HashSet < java.lang.String > ( ) ; dictionary.put ( status , values ) ; } values.add ( fieldName ) ; }

Target:
public final < T extends java.lang.Enum < T > > void AddField ( T status , java.lang.String fieldName ) { java.util.Set < java.lang.String > values = dictionary.get ( status ) ; if ( values == null ) { values = new java.util.HashSet < java.lang.String > ( ) ; dictionary.put ( status , values ) ; } values.add ( fieldName ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > object ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( object.getClusterNames ( ) ) ; return ( object.getCluster ( ) . getSelectedItem ( ) ) != null ? object.getCluster ( ) . getSelectedItem ( ) . getName ( ) : constants.empty ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > object ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( object.getClusterNames ( ) ) ; return ( object.getCluster ( ) . getSelectedItem ( ) ) != null ? object.getCluster ( ) . getSelectedItem ( ) . getName ( ) : org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.RegisterEntityPopupView.constants.empty ( ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllStorageServerConnections , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpStorageConnections ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAllStorageServerConnections , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpStorageConnections ( ) , failure ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Calling SsoCallbackServlet with queryString '{}'" , request.getQueryString ( ) ) ; java.lang.String event = request.getParameter ( "event" ) ; java.lang.String accessToken = request.getParameter ( "token" ) ; switch ( event ) { case "logout" : handleLogout ( accessToken , response ) ; break ; default : response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.error ( "Unsupported event '{}'" , event ) ; break ; } }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { org.ovirt.engine.core.services.SsoCallbackServlet.log.debug ( "Calling SsoCallbackServlet with queryString '{}'" , request.getQueryString ( ) ) ; java.lang.String event = request.getParameter ( "event" ) ; java.lang.String accessToken = request.getParameter ( "token" ) ; switch ( event ) { case "auditLog" : handleAuditLog ( request , response ) ; break ; case "logout" : handleLogout ( accessToken , response ) ; break ; default : response.setStatus ( java.net.HttpURLConnection.HTTP_INTERNAL_ERROR ) ; org.ovirt.engine.core.services.SsoCallbackServlet.log.error ( "Unsupported event '{}'" , event ) ; break ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs changedArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsDiskHotPlugAvailable" . equals ( changedArgs.propertyName ) ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( plugButtonDefinition ) ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( unPlugButtonDefinition ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsDiskHotPlugAvailable" . equals ( args.propertyName ) ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( plugButtonDefinition ) ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( unPlugButtonDefinition ) ; } }
Source:
private void handleException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase e , java.lang.String reason ) { setVdsRuntimeError ( e ) ; final java.lang.String msg = java.lang.String.format ( "Failed to poll host %s - %s." , org.ovirt.engine.core.vdsbroker.vdsbroker.PollVDSCommand.getParameters ( ) . getVdsId ( ) , reason ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PollVDSCommand.log.debug ( msg , e ) ; }

Target:
private void handleException ( java.lang.RuntimeException e , java.lang.String reason ) { org.ovirt.engine.core.vdsbroker.vdsbroker.PollVDSCommand.setVdsRuntimeError ( e ) ; final java.lang.String msg = java.lang.String.format ( "Failed to poll host %s - %s." , org.ovirt.engine.core.vdsbroker.vdsbroker.PollVDSCommand.getParameters ( ) . getVdsId ( ) , reason ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PollVDSCommand.log.debug ( msg , e ) ; }
Source:
private void processVm ( ) { if ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { decreasePendingVms ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getId ( ) ) ; } }

Target:
private org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters createMigrateVDSCommandParameters ( ) { java.lang.String srcVdsHost = org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getHostName ( ) ; java.lang.String dstVdsHost = java.lang.String.format ( "%1$s:%2$s" , getDestinationVds ( ) . getHostName ( ) , getDestinationVds ( ) . getPort ( ) ) ; return new org.ovirt.engine.core.common.vdscommands.MigrateVDSCommandParameters ( org.ovirt.engine.core.bll.MigrateVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVmId ( ) , srcVdsHost , vdsDestinationId , dstVdsHost , org.ovirt.engine.core.common.businessentities.MigrationMethod.ONLINE , isTunnelMigrationUsed ( ) , getMigrationNetworkIp ( ) , org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getVdsGroupCompatibilityVersion ( ) , getMaximumMigrationDowntime ( ) ) ; }
Source:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) || ( ( storageDomain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) ; return isEditable ; }

Target:
protected boolean isDomainInEditState ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean isEditable = ( storageDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) || ( ( storageDomain.getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) ) ; return isEditable ; }
Source:
public void testGetLunsThatBreakDiscardFunctionalityDiscardZeroesTheDataBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardZeroesTheDataSupport = createLunWithDiscardFunctionality ( 1024L , false ) ; assertGetLunsThatBreakDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , lunThatBreaksDiscardZeroesTheDataSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardZeroesTheDataSupport ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityDiscardZeroesTheDataBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardZeroesTheDataSupport = createLunWithDiscardFunctionality ( 1024L , false ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , lunThatBreaksDiscardZeroesTheDataSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardZeroesTheDataSupport ) ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getBroker ( ) . fenceSpmStorage ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getPrevId ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getPrevLVER ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getBroker ( ) . fenceSpmStorage ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getPrevId ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.getParameters ( ) . getPrevLVER ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.FenceSpmStorageVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = getImportChainConfirmationModel ( ( ( java.lang.String ) ( result ) ) ) ; sourceListModel.setConfirmWindow ( confirmationModel ) ; } else { stopProgress ( ) ; setTestResultValue ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase res = result.getReturnValue ( ) ; setTestResultValue ( res ) ; stopProgress ( ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "" , query ) ; java.util.List < org.ovirt.engine.api.model.Permission > perms = setUpPermissions ( ) ; setUpEntityQueryExpectations ( queryType , queryParams.getClass ( ) , new java.lang.String [ ] { queryParameterName } , new java.lang.Object [ ] { GUIDS [ 1 ] } , perms , failure ) ; }
Source:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }

Target:
private void prepareVmToPassCanDoAction ( ) { vmStatic.setName ( "vm1" ) ; vmStatic.setMemSizeMb ( 256 ) ; vmStatic.setSingleQxlPci ( false ) ; mockVmDaoGetVm ( ) ; mockSameNameQuery ( false ) ; mockValidateCustomProperties ( ) ; mockValidatePciAndIdeLimit ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; mockGraphicsDevice ( ) ; }
Source:
private void initConditions ( ) { org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( groupDao ) ; org.mockito.Mockito.when ( groupDao.get ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.when ( dbFacade.getInterfaceDao ( ) ) . thenReturn ( interfaceDao ) ; org.mockito.Mockito.when ( interfaceDao.getAllInterfacesForVds ( ( ( org.ovirt.engine.core.compat.Guid ) ( org.mockito.Matchers.any ( ) ) ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; }

Target:
private void initConditions ( ) { org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( groupDao ) ; org.mockito.Mockito.when ( groupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( cluster ) ; org.mockito.Mockito.when ( dbFacade.getInterfaceDao ( ) ) . thenReturn ( interfaceDao ) ; org.mockito.Mockito.when ( interfaceDao.getAllInterfacesForVds ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; }
Source:
public void testRemoveLocalStorage ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.LOCALFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveStorageDomain , org.ovirt.engine.core.common.action.RemoveStorageDomainParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveLocalStorage ( ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.LOCALFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveStorageDomain , org.ovirt.engine.core.common.action.RemoveStorageDomainParameters.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
protected void onInitAllDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } } }

Target:
protected void onInitAllDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { allDisks.add ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel.diskToModel ( disk ) ) ; } } }
Source:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = ( ( org.ovirt.engine.core.common.scheduling.ClusterPolicy ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicy.getId ( ) , clusterPolicy ) ) ; } setWindow ( null ) ; getSearchCommand ( ) . execute ( ) ; }

Target:
public void onRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.scheduling.ClusterPolicy clusterPolicy = ( ( org.ovirt.engine.core.common.scheduling.ClusterPolicy ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveClusterPolicy , new org.ovirt.engine.core.common.scheduling.parameters.ClusterPolicyCRUDParameters ( clusterPolicy.getId ( ) , clusterPolicy ) ) ; } setWindow ( null ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceByNetworkName ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( java.util.Objects.equals ( i.getNetworkName ( ) , name ) ) { return i ; } } return null ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface findInterfaceByNetworkName ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items , final java.lang.String name ) { return org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( items , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return java.util.Objects.equals ( i.getNetworkName ( ) , name ) ; } } ) ; }
Source:
public void validateFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.assertFailsWithValidateMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void validateFailsIfHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }
Source:
public void testUpdate ( ) { existingUser.setFirstName ( "changedname" ) ; existingUser.setLastName ( "changedsurname" ) ; dao.update ( existingUser ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser result = dao.get ( existingUser.getId ( ) ) ; org.junit.Assert.assertEquals ( existingUser , result ) ; }

Target:
public void testUpdate ( ) { existingUser.setFirstName ( "changedname" ) ; existingUser.setLastName ( "changedsurname" ) ; dao.update ( existingUser ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser result = dao.get ( existingUser.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( existingUser , result ) ; }
Source:
private java.lang.String GetOptionType ( java.lang.String key ) { java.lang.String result = "" ; if ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( key ) ) ) && ( org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionTypes.containsKey ( key ) ) ) { result = org.ovirt.engine.core.utils.pm.VdsFencingOptions.fencingOptionTypes.get ( key ) ; } return result ; }

Target:
private java.lang.String GetOptionType ( java.lang.String key ) { java.lang.String result = "" ; if ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( key ) ) ) && ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.containsKey ( key ) ) ) { result = org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.get ( key ) ; } return result ; }
Source:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static boolean isNumOfMonitorsLegal ( org.ovirt.engine.core.common.businessentities.DisplayType displayType , int numOfMonitors , java.util.List < java.lang.String > reasons ) { boolean legal = true ; if ( displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.vnc ) ) { legal = numOfMonitors <= 1 ; } else { legal = numOfMonitors <= ( org.ovirt.engine.core.bll.VmHandler.getMaxNumberOfMonitors ( ) ) ; } if ( ! legal ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_NUM_OF_MONITORS.toString ( ) ) ; } return legal ; }

Target:
public static boolean isGraphicsAndDisplaySupported ( int osId , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( osId , clusterVersion , graphics , displayType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }
Source:
public static void isSoundcardEnabled ( 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 < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , 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.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.storage.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DiscoverSendTargets , new org.ovirt.engine.core.bll.storage.DiscoverSendTargetsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getConnection ( ) ) ) . getReturnValue ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DiscoverSendTargets , new org.ovirt.engine.core.common.vdscommands.DiscoverSendTargetsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getConnection ( ) ) ) . getReturnValue ( ) ) ; }
Source:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateDestDomainsSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.mockito.Mockito.doReturn ( ActionType.LiveMigrateDisk ) . when ( command ) . getActionType ( ) ; }

Target:
private void initSpyCommand ( ) { org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateDestDomainsSpaceRequirements ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . validateQuota ( ) ; org.mockito.Mockito.doReturn ( ActionType.LiveMigrateDisk ) . when ( command ) . getActionType ( ) ; }
Source:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.setWidget ( contentWidget ) ; contentWidget.asWidget ( ) . setWidth ( "100%" ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { contentWidgetElement.setId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } updateLabelElementId ( getContentWidgetElement ( ) . getId ( ) ) ; }

Target:
protected void initWidget ( com.google.gwt.user.client.ui.Widget wrapperWidget ) { super . initWidget ( wrapperWidget ) ; contentWidgetContainer.setWidget ( contentWidget ) ; label.addStyleName ( OvirtCss.LABEL_ENABLED ) ; com.google.gwt.dom.client.Element contentWidgetElement = getContentWidgetElement ( ) ; if ( ( ( contentWidgetElement.getId ( ) ) == null ) || ( contentWidgetElement.getId ( ) . isEmpty ( ) ) ) { setElementId ( com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; } }
Source:
public void testNetworkExists ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator networkAttachmentValidatorSpy = org.mockito.Mockito.spy ( createNetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ) ) ; org.mockito.Mockito.doReturn ( networkValidatorMock ) . when ( networkAttachmentValidatorSpy ) . getNetworkValidator ( ) ; org.mockito.Mockito.when ( networkValidatorMock.networkIsSet ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.junit.Assert.assertThat ( "ValidationResult is not correctly propagated" , networkAttachmentValidatorSpy.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( "network" ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testIsValidNonIpv6Host ( ) { final org.ovirt.engine.ui.uicommonweb.UriAuthority underTest = new org.ovirt.engine.ui.uicommonweb.UriAuthority ( ( ( ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.NON_IPV6_ADDRESS ) + ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.COLON ) ) + ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.PORT ) ) ) ; org.junit.Assert.assertThat ( underTest.isValid ( ) , org.hamcrest.Matchers.is ( true ) ) ; org.junit.Assert.assertThat ( underTest.getHost ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.NON_IPV6_ADDRESS ) ) ; org.junit.Assert.assertThat ( underTest.getPort ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.PORT ) ) ; }

Target:
public void testIsValidNonIpv6Host ( ) { final org.ovirt.engine.ui.uicommonweb.UriAuthority underTest = new org.ovirt.engine.ui.uicommonweb.UriAuthority ( ( ( ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.NON_IPV6_ADDRESS ) + ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.COLON ) ) + ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.PORT ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.isValid ( ) , org.hamcrest.Matchers.is ( true ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.getHost ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.NON_IPV6_ADDRESS ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.getPort ( ) , org.hamcrest.Matchers.is ( org.ovirt.engine.ui.uicommonweb.UriAuthorityTest.PORT ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) , getEffectiveCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean validateSoundDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isSoundDeviceExists ( getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isSoundDeviceEnabled ( getVm ( ) . getStaticData ( ) . getOsId ( ) , getEffectiveCompatibilityVersion ( ) ) ) ) { addValidationMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failValidation ( EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }
Source:
public static void GetDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( java.util.Map.Entry < java.lang.String , java.lang.String > ) ( source ) ) . getKey ( ) ; } return "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefualtTimeZone , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; before.setDescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByName ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
public void testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( ( volumes != null ) ) ; org.junit.Assert.assertTrue ( ( ( volumes.size ( ) ) == 2 ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; }

Target:
public void testGetByClusterId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertEquals ( 2 , volumes.size ( ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingReplVol ) ) ; }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
private void setupConsole ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item = modelProvider.getModel ( ) . getSelectedItem ( ) ; getView ( ) . setEditConsoleEnabled ( isEditConsoleEnabled ( item ) ) ; if ( ! ( item.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { getView ( ) . setConsoleWarningMessage ( item.getVmConsoles ( ) . cannotConnectReason ( ) ) ; } else { getView ( ) . setConsoleProtocol ( determineProtocolMessage ( item.getVmConsoles ( ) ) ) ; } }

Target:
private void setupConsole ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item = modelProvider.getModel ( ) . getSelectedItem ( ) ; getView ( ) . setConsoleConnectLinkEnabled ( canConnectToConsole ( item ) ) ; getView ( ) . setEditConsoleEnabled ( isEditConsoleEnabled ( item ) ) ; if ( ! ( item.getVmConsoles ( ) . canConnectToConsole ( ) ) ) { getView ( ) . setConsoleWarningMessage ( item.getVmConsoles ( ) . cannotConnectReason ( ) ) ; } else { getView ( ) . setConsoleProtocol ( determineProtocolMessage ( item.getVmConsoles ( ) ) ) ; } }
Source:
public org.ovirt.engine.api.model.Hook getHook ( org.ovirt.engine.api.model.Hooks hooks ) { for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { if ( hook.getId ( ) . equals ( guid ) ) { return hook ; } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Hook getHook ( org.ovirt.engine.api.model.Hooks hooks ) { java.lang.String hookId = guid.toString ( ) ; for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { if ( hook.getId ( ) . equals ( hookId ) ) { return hook ; } } return notFound ( ) ; }
Source:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
private void InitMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaximalVmMemSize32OS ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }

Target:
private void initMaximalVmMemSize32OS ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaximalVmMemSize32OS ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel vmModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; vmModel.set_MaxMemSize32 ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; } } , getHash ( ) ) ) ; }
Source:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( false ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }

Target:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmNicFilterParameter , org.ovirt.engine.core.common.action.VmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.NetworkFilterParameter parameter = resource.update ( getParameter ( ) ) ; assertNotNull ( parameter ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmNicFilterParameter , org.ovirt.engine.core.common.action.VmNicFilterParameterParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParameterResourceTest.VM_ID } , true , true ) ) ; org.ovirt.engine.api.model.NetworkFilterParameter parameter = resource.update ( getParameter ( ) ) ; org.junit.Assert.assertNotNull ( parameter ) ; }