auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; if ( ( getEntity ( ) ) == null ) { return ; } setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( getEntity ( ) . getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; if ( ( getEntity ( ) ) == null ) { return ; } setAsyncResult ( null ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
private java.lang.String getNetworkId ( java.lang.String networkName ) { if ( networkName != null ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } } return null ; }

Target:
private java.lang.String getNetworkId ( java.lang.String networkName ) { if ( networkName != null ) { org.ovirt.engine.core.compat.Guid clusterId = getClusterId ( ) ; org.ovirt.engine.core.common.businessentities.network.Network n = getClusterNetwork ( clusterId , null , networkName ) ; if ( n != null ) { return n.getId ( ) . toString ( ) ; } } return null ; }
Source:
public void testGetPagPhrase ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "wrongPageType" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , "wrongPageSyntax" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 20 ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; mcr.mockConfigValue ( ConfigValues.DBPagingType , "Range" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , " WHERE RowNum BETWEEN %1$s AND %2$s" ) ; org.junit.Assert.assertNotEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }

Target:
public void testGetPagPhrase ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "wrongPageType" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , "wrongPageSyntax" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; mcr.mockConfigValue ( ConfigValues.DBPagingType , "Range" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , " WHERE RowNum BETWEEN %1$s AND %2$s" ) ; org.junit.Assert.assertNotEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }
Source:
public static void GetStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVMFromDAO ( org.ovirt.engine.core.compat.Guid requestedUser ) { org.ovirt.engine.core.common.businessentities.VM expectedVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.dao.VmDAO vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForUserWithGroupsAndUserRoles ( requestedUser ) ) . thenReturn ( java.util.Collections.singletonList ( expectedVM ) ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDAO ( ) ) . thenReturn ( vmDaoMock ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.bll.VmHandler.class ) ; org.powermock.api.mockito.PowerMockito.doNothing ( ) . when ( org.ovirt.engine.core.bll.VmHandler.class ) ; org.ovirt.engine.core.bll.VmHandler.UpdateVmGuestAgentVersion ( expectedVM ) ; return expectedVM ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVMFromDAO ( org.ovirt.engine.core.compat.Guid requestedUser ) { org.ovirt.engine.core.common.businessentities.VM expectedVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.dao.VmDAO vmDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmDAO.class ) ; org.mockito.Mockito.when ( vmDaoMock.getAllForUserWithGroupsAndUserRoles ( requestedUser ) ) . thenReturn ( java.util.Collections.singletonList ( expectedVM ) ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDAO ( ) ) . thenReturn ( vmDaoMock ) ; return expectedVM ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getGlusterHook ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String glusterCommand , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage stage , java.lang.String hookName ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook = getCallsHandler ( ) . executeRead ( "GetGlusterHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoImpl.glusterHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "gluster_command" , glusterCommand ) . addValue ( "stage" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( stage ) ) . addValue ( "name" , hookName ) . addValue ( "includeContent" , false ) ) ; return glusterHook ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity getGlusterHook ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String glusterCommand , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookStage stage , java.lang.String hookName ) { return getCallsHandler ( ) . executeRead ( "GetGlusterHook" , org.ovirt.engine.core.dao.gluster.GlusterHooksDaoImpl.glusterHookRowMapper , getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , clusterId ) . addValue ( "gluster_command" , glusterCommand ) . addValue ( "stage" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( stage ) ) . addValue ( "name" , hookName ) . addValue ( "includeContent" , false ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain sp ) { setEnumTitle ( sp.getstatus ( ) ) ; switch ( sp.getstatus ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Uninitialized : return getApplicationResources ( ) . unconfiguredImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain sp ) { setEnumTitle ( sp.getStatus ( ) ) ; switch ( sp.getStatus ( ) ) { case Unattached : return getApplicationResources ( ) . tornChainImage ( ) ; case Active : return getApplicationResources ( ) . upImage ( ) ; case InActive : return getApplicationResources ( ) . downImage ( ) ; case Uninitialized : return getApplicationResources ( ) . unconfiguredImage ( ) ; case Locked : return getApplicationResources ( ) . lockImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vds.getId ( ) ) ; logable.addCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }

Target:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ; logable.addCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }
Source:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.storage_domains domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }

Target:
protected boolean isValidExportDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getForStoragePool ( org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.GetVmsFromExportDomainQuery.getParameters ( ) . getStoragePoolId ( ) ) ; if ( ( domain != null ) && ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return true ; } return false ; }
Source:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.storage_pool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }

Target:
private void mockStoragePoolDAO ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { org.ovirt.engine.core.compat.Guid storagePoolId = getQueryParameters ( ) . getStoragePoolId ( ) ; if ( pool != null ) { pool.setId ( storagePoolId ) ; } org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; org.mockito.Mockito.when ( storagePoolDAOMock.get ( storagePoolId , getUser ( ) . getUserId ( ) , getQueryParameters ( ) . isFiltered ( ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAOMock ) ; }
Source:
public void removeFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFunctions.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFunctions.size ( ) ) ; i ++ ) { if ( usedFunctions.get ( i ) . getFirst ( ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFunctions.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void removeFunction ( org.ovirt.engine.core.common.scheduling.PolicyUnit policyUnit ) { unusedFunctions.add ( policyUnit ) ; for ( int i = 0 ; i < ( usedFunctions.size ( ) ) ; i ++ ) { if ( usedFunctions.get ( i ) . getFirst ( ) . getId ( ) . equals ( policyUnit.getId ( ) ) ) { usedFunctions.remove ( i ) ; break ; } } refreshCustomProperties ( policyUnit , false ) ; getFunctionsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public void addCustomValueDoesNotHandleNullKeys ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }

Target:
public void addCustomValueDoesNotHandleNullKeys ( ) { final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; }
Source:
private void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }

Target:
protected final void endVmTemplateRelatedOps ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setVmDevices ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; incrementDbGeneration ( ) ; org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplateId ( ) ) ; } else { org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveOrCopyTemplateCommand::EndMoveOrCopyCommand: VmTemplate is null, not performing full EndAction" ) ; } }
Source:
private boolean containsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.LOCALFS ) ) { return true ; } } return false ; }

Target:
private boolean containsLocalStorage ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : getSelectedItems ( ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.StorageType.LOCALFS ) ) { return true ; } } return false ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GetGlusterHookContent , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( server.getId ( ) , hook.getGlusterCommand ( ) , hook.getStage ( ) , hook.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( hook , returnValue ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GetGlusterHookContent , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( server.getId ( ) , hook.getGlusterCommand ( ) , hook.getStage ( ) , hook.getName ( ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( hook , returnValue ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; setImagesToModel ( model , images ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < java.lang.String > images = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; setImagesToModel ( model , images ) ; }
Source:
protected java.util.Map activateApi ( org.codehaus.jackson.JsonNode params ) { java.util.Map data = api.list ( ) ; java.util.List < java.lang.String > justVmIdList = new java.util.ArrayList ( ) ; for ( java.util.Map < java.lang.String , java.lang.String > vmItem : ( ( java.util.List < java.util.Map > ) ( data.get ( "vmList" ) ) ) ) { justVmIdList.add ( vmItem.get ( "vmId" ) ) ; } data.put ( "vmList" , justVmIdList ) ; return data ; }

Target:
protected java.util.Map activateApi ( org.codehaus.jackson.JsonNode params ) { return api.list ( ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { V widget = item.getSecond ( ) ; getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }
Source:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; org.mockito.Mockito.when ( mock.getFromCache ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }

Target:
private org.ovirt.engine.core.dao.VdsGroupDAO mockVdsGroup ( ) { org.ovirt.engine.core.dao.VdsGroupDAO mock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; org.ovirt.engine.core.common.businessentities.VDSGroup value = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; value.setEmulatedMachine ( "pc-1.0" ) ; org.mockito.Mockito.when ( mock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( value ) ; return mock ; }
Source:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > sdl ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains a : sdl ) { if ( ( ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getstatus ( ) ) != null ) ) && ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }

Target:
public static boolean IsAnyStorageDomainIsMatserAndActive ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > sdl ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : sdl ) { if ( ( ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) && ( ( a.getstatus ( ) ) != null ) ) && ( ( a.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return true ; } } return false ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( array [ 1 ] ) ) ; behavior.postUpdateItemsAvailability ( storageModelItem , ( returnValue == null ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( array [ 1 ] ) ) ; behavior.postUpdateItemsAvailability ( storageModelItem , ( returnValue == null ) ) ; }
Source:
public boolean isDiskExist ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { try { com.woorea.openstack.cinder.model.Volume volume = proxy.getVolumeById ( id.toString ( ) ) ; return volume != null ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } } ) ; }

Target:
public boolean isDiskExist ( final org.ovirt.engine.core.compat.Guid id ) { return execute ( ( ) -> { try { com.woorea.openstack.cinder.model.Volume volume = proxy.getVolumeById ( id.toString ( ) ) ; return volume != null ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException ex ) { if ( ( ex.getStatus ( ) ) == ( org.apache.commons.httpclient.HttpStatus.SC_NOT_FOUND ) ) { return false ; } throw ex ; } } ) ; }
Source:
public void setUp ( ) { params = generateParameters ( ) ; command = org.mockito.Mockito.spy ( generateCommand ( ) ) ; role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setId ( params.getRoleId ( ) ) ; org.mockito.Mockito.doReturn ( roleDaoMock ) . when ( command ) . getRoleDao ( ) ; org.mockito.Mockito.when ( roleDaoMock.get ( params.getRoleId ( ) ) ) . thenReturn ( role ) ; org.mockito.Mockito.doReturn ( roleGroupMapDaoMock ) . when ( command ) . getRoleGroupMapDao ( ) ; }

Target:
public void setUp ( ) { role = new org.ovirt.engine.core.common.businessentities.Role ( ) ; role.setId ( params.getRoleId ( ) ) ; org.mockito.Mockito.doReturn ( roleDaoMock ) . when ( command ) . getRoleDao ( ) ; org.mockito.Mockito.when ( roleDaoMock.get ( params.getRoleId ( ) ) ) . thenReturn ( role ) ; org.mockito.Mockito.doReturn ( roleGroupMapDaoMock ) . when ( command ) . getRoleGroupMapDao ( ) ; }
Source:
private static void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
private void interfaceHasSiblingVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; return ! ( siblingVlanInterfaces.isEmpty ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllSiblingVlanInterfaces , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
private void mockGetForDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid ) ) . thenReturn ( vmsMap ) ; }

Target:
private void mockGetForDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid , true ) ) . thenReturn ( vmsMap ) ; }
Source:
public static boolean supportedInConfig ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.ArchitectureType arch ) { java.util.Map < java.lang.String , java.lang.String > archOptions = org.ovirt.engine.core.common.config.Config.< java.util.Map > getValue ( feature , version.getValue ( ) ) ; return java.lang.Boolean.parseBoolean ( archOptions.getOrDefault ( arch.name ( ) , archOptions.get ( arch.getFamily ( ) . name ( ) ) ) ) ; }

Target:
public static boolean supportedInConfig ( org.ovirt.engine.core.common.config.ConfigValues feature , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.ArchitectureType arch ) { java.util.Map < java.lang.String , java.lang.String > archOptions = org.ovirt.engine.core.common.config.Config.< java.util.Map > getValue ( feature , version.getValue ( ) ) ; java.lang.String value = archOptions.get ( arch.name ( ) ) ; if ( value == null ) { value = archOptions.get ( arch.getFamily ( ) . name ( ) ) ; } return java.lang.Boolean.parseBoolean ( value ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initTemplate ( ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initCdImage ( ) ; getPoolModelBehaviorInitializedEvent ( ) . raise ( this , EventArgs.Empty ) ; }
Source:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , false ) ; }

Target:
public void runMultipleActions ( final java.util.List < org.ovirt.engine.core.common.action.VdcActionType > actionTypes , final java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , final java.util.List < org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback > callbacks , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback failureCallback , final java.lang.Object state ) { runMultipleActions ( actionTypes , parameters , callbacks , failureCallback , state , true ) ; }
Source:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }
Source:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( host.getMemory ( ) , java.lang.Long.valueOf ( 4194304000L ) ) ; }

Target:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host.getMemory ( ) ) ; assertEquals ( java.lang.Long.valueOf ( 4194304000L ) , host.getMemory ( ) ) ; }
Source:
public void storageDomainName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStorageName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStorageDomain ( s ) ; final java.lang.String n = b.getStorageDomainName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void storageDomainName ( ) { final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStorageName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setStorageDomain ( s ) ; final java.lang.String n = b.getStorageDomainName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
public java.lang.Object answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { expectedDisk.getSnapshots ( ) . addAll ( snapshots ) ; expectedVM.getDiskMap ( ) . put ( expectedDisk.getinternal_drive_mapping ( ) , expectedDisk ) ; expectedVM.getDiskList ( ) . add ( expectedDisk ) ; return null ; }

Target:
public java.lang.Object answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { expectedDisk.getSnapshots ( ) . addAll ( snapshots ) ; expectedVM.getDiskMap ( ) . put ( expectedDisk.getId ( ) , expectedDisk ) ; expectedVM.getDiskList ( ) . add ( expectedDisk ) ; 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.uicommonweb.models.SystemTreeItemModel lastSelectedItem = modelProvider.getSelectionModel ( ) . getSelectedObject ( ) ; modelProvider.getSelectionModel ( ) . setSelected ( lastSelectedItem , false ) ; expandTree ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.ITEM_LEVEL ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { expandTree ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.ITEM_LEVEL ) ; }
Source:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.vds_spm_id_map > vds_spm_id_mapList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsSpmIdMapDao ( ) . getAll ( org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getVds ( ) . getStoragePoolId ( ) ) ; if ( ( vds_spm_id_mapList.size ( ) ) >= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumberOfHostsInStoragePool ) ) ) { buildFaultResult ( ) ; return ; } insertSpmIdToDb ( vds_spm_id_mapList ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.vds_spm_id_map > vds_spm_id_mapList = org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getVdsSpmIdMapDao ( ) . getAll ( org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getVds ( ) . getStoragePoolId ( ) ) ; if ( ( vds_spm_id_mapList.size ( ) ) >= ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxNumberOfHostsInStoragePool ) ) ) { buildFaultResult ( ) ; return ; } insertSpmIdToDb ( vds_spm_id_mapList ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.setSucceeded ( true ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid removeImage ( java.lang.String taskKey , org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { org.ovirt.engine.core.compat.Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder ( taskKey ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = removeImage ( parameters ) ; if ( vdsRetValue.getSucceeded ( ) ) { org.ovirt.engine.core.compat.Guid guid = enclosingCommand.createTask ( taskId , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid ) ; return guid ; } return ( vdsRetValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ? org.ovirt.engine.core.compat.Guid.Empty : null ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue ) { return enclosingCommand.createTask ( taskId , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; }
Source:
public java.lang.String add ( org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.Network networkForCreate = createNewNetworkEntity ( network ) ; try { org.ovirt.engine.core.common.businessentities.network.Network createdNetwork = getClient ( ) . networks ( ) . create ( networkForCreate ) . execute ( ) ; return createdNetwork.getId ( ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , e ) ; } }

Target:
public java.lang.String add ( org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.Network networkForCreate = createNewNetworkEntity ( network ) ; org.ovirt.engine.core.common.businessentities.network.Network createdNetwork = execute ( getClient ( ) . networks ( ) . create ( networkForCreate ) ) ; return createdNetwork.getId ( ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.ProceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; ProceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }
Source:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }

Target:
protected void updateModelDataCenterFromVds ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }
Source:
private org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties mapAdditionalProperties ( java.sql.ResultSet rs , org.ovirt.engine.core.common.businessentities.Provider < ? > entity ) throws java.sql.SQLException { switch ( entity.getType ( ) ) { case OPENSTACK_NETWORK : org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = new org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ( ) ; properties.setTenantName ( rs.getString ( "tenant_name" ) ) ; properties.setPluginType ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkPluginType.valueOf ( rs.getString ( "plugin_type" ) ) ) ; return properties ; default : return null ; } }

Target:
private org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties mapAdditionalProperties ( java.sql.ResultSet rs , org.ovirt.engine.core.common.businessentities.Provider < ? > entity ) throws java.sql.SQLException { switch ( entity.getType ( ) ) { case OPENSTACK_NETWORK : org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = new org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ( ) ; properties.setTenantName ( rs.getString ( "tenant_name" ) ) ; properties.setPluginType ( rs.getString ( "plugin_type" ) ) ; return properties ; default : return null ; } }
Source:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetNextRunGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetNextRunGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; org.ovirt.engine.api.model.Vm response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
private void removeRequestFromTracking ( org.codehaus.jackson.JsonNode id ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { this . queue.remove ( id ) ; org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = this . map.remove ( id ) ; java.util.List < org.codehaus.jackson.JsonNode > nodes = this . hostToId.get ( tracking.getClient ( ) . getClientId ( ) ) ; nodes.remove ( id ) ; } }

Target:
private void removeRequestFromTracking ( org.codehaus.jackson.JsonNode id ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { this . queue.remove ( id ) ; org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking = this . map.remove ( id ) ; java.util.List < org.codehaus.jackson.JsonNode > nodes = this . hostToId.get ( tracking.getClient ( ) . getClientId ( ) ) ; if ( nodes != null ) { nodes.remove ( id ) ; } } }
Source:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }

Target:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }