auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; org.mockito.Mockito.when ( entity.getDataCenterId ( ) ) . thenReturn ( GUIDS [ 1 ] ) ; return entity ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResourceTest.DATA_CENTER_ID } , getEntityList ( ) , failure ) ; } }
Source:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > queryDirectoryUsers ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { return org.ovirt.engine.core.aaa.DirectoryUtils.mapPrincipalRecords ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) ; }

Target:
private static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > queryDirectoryGroups ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > directoryGroups = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.extensions.ExtMap group : org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , filter , groupsResolving , groupsResolvingRecursive ) ) { directoryGroups.add ( org.ovirt.engine.core.aaa.DirectoryUtils.mapGroupRecordToDirectoryGroup ( org.ovirt.engine.core.aaa.AuthzUtils.getName ( extension ) , group ) ) ; } return directoryGroups ; }
Source:
public void setTestResultImage ( boolean succeeded ) { testResultImage.setResource ( ( succeeded ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImageStyle ( ) ) ; }

Target:
public void setTestResultImage ( java.lang.String errorMessage ) { testResultImage.setResource ( ( errorMessage.isEmpty ( ) ? resources.logNormalImage ( ) : resources.logErrorImage ( ) ) ) ; testResultImage.setStylePrimaryName ( style.testResultImageStyle ( ) ) ; testResultImage.setTitle ( errorMessage ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.TagsVmMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmMap ( ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; entity.setvm_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vm_id" ) ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "tag_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.TagsVmMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.TagsVmMap entity = new org.ovirt.engine.core.common.businessentities.TagsVmMap ( ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "tag_id" ) ) ) ; entity.setvm_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "vm_id" ) ) ) ; entity.setDefaultDisplayType ( ( ( java.lang.Integer ) ( rs.getObject ( "DefaultDisplayType" ) ) ) ) ; entity.settag_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "tag_id" ) ) ) ; return entity ; }
Source:
protected java.util.Date getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getCreationDate ( ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.ImageStatus getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) || ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ? ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getImageStatus ( ) : null ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc glusterVolumeHealInfo ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeHealInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesHealInfoReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; }
Source:
public void testPersistentAuthOtherPreferencesInSameHeader ( ) { org.junit.Assert.assertTrue ( isPersistentAuth ( "persistent-auth, x, y" ) ) ; org.junit.Assert.assertTrue ( isPersistentAuth ( "x, persistent-auth, y" ) ) ; org.junit.Assert.assertTrue ( isPersistentAuth ( "x, y, persistent-auth" ) ) ; }

Target:
public void testPreferWithValue ( ) { org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=false" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=true" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_PERSISTENCE_AUTH , getPrefer ( "persistent-auth=junk" ) ) ; org.junit.Assert.assertEquals ( FiltersHelper.PREFER_NEW_AUTH , getPrefer ( "new-auth=false" ) ) ; org.junit.Assert.assertEquals ( ( ( FiltersHelper.PREFER_PERSISTENCE_AUTH ) | ( FiltersHelper.PREFER_NEW_AUTH ) ) , getPrefer ( "persistent-auth=false, new-auth=false" ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setcompatibility_version ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; group.setArchitecture ( ArchitectureType.undefined ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithNoCpuName ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; group.setName ( "Default" ) ; group.setId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.STORAGE_POOL_ID ) ; group.setArchitecture ( ArchitectureType.undefined ) ; return group ; }
Source:
protected void postGetHost ( java.lang.String hostName ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( "[virt-viewer]" ) ; configBuilder.append ( "\ntype=vnc" ) . append ( "\nhost=" ) . append ( hostName ) . append ( "\nport=" ) . append ( getEntity ( ) . getDisplay ( ) . toString ( ) ) . append ( "\npassword=" ) . append ( otp64 ) . append ( "\ntitle=" ) . append ( getTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
private void setAndInvokeClient ( ) { vncImpl.setVncHost ( getHost ( ) ) ; vncImpl.setVncPort ( getPort ( ) ) ; vncImpl.setTicket ( getOtp64 ( ) ) ; vncImpl.setTitle ( getTitle ( ) ) ; vncImpl.invokeClient ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult diskProfileNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile profile : getDiskProfiles ( ) ) { if ( ( profile.getName ( ) . equals ( getDiskProfile ( ) . getName ( ) ) ) && ( ! ( profile.getId ( ) . equals ( getDiskProfile ( ) . getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult parentEntityNotChanged ( ) { if ( org.apache.commons.lang.ObjectUtils.equals ( getProfile ( ) . getStorageDomainId ( ) , getProfileFromDb ( ) . getStorageDomainId ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_PROFILE ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.FORCE , true , false ) ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , force ) ; boolean detachOnly = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( VdcActionType.RemoveVm , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.FORCE , true , false ) ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , force ) ; boolean detachOnly = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( ActionType.RemoveVm , params ) ; }
Source:
public void SetVmUnknown ( org.ovirt.engine.core.common.businessentities.VM vm ) { RemoveAsyncRunningVm ( vm.getId ( ) ) ; InternalSetVmStatus ( vm , VMStatus.Unknown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; storeVm ( vm ) ; }

Target:
public void SetVmUnknown ( org.ovirt.engine.core.common.businessentities.VM vm ) { RemoveAsyncRunningVm ( vm.getId ( ) ) ; InternalSetVmStatus ( vm , VMStatus.Unknown ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVmId ( vm.getId ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.VM_SET_TO_UNKNOWN_STATUS ) ; storeVm ( vm ) ; }
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private void revertCinderDisks ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { for ( org.ovirt.engine.core.compat.Guid childCmdId : childCmdIds ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase commandParameters = ( ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase ) ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( childCmdId ) . getCommandParameters ( ) ) ) ; org.ovirt.engine.core.compat.Guid destGuid = commandParameters.getDestinationImageId ( ) ; org.ovirt.engine.core.compat.Guid storageDomainId = commandParameters.getStorageDomainId ( ) ; removeCinderDisk ( destGuid , storageDomainId ) ; } }

Target:
private void revertCinderDisks ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { for ( org.ovirt.engine.core.compat.Guid childCmdId : childCmdIds ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase commandParameters = ( ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase ) ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( childCmdId ) . getCommandParameters ( ) ) ) ; org.ovirt.engine.core.compat.Guid destinationImageId = commandParameters.getDestinationImageId ( ) ; org.ovirt.engine.core.compat.Guid storageDomainId = commandParameters.getStorageDomainId ( ) ; removeCinderDisk ( destinationImageId , storageDomainId ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.findStorageDomainForMemory ( getParameters ( ) . getStoragePoolId ( ) , memoryDisksList ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( getNetworkName ( ) ) != null ) && ( ( network ) == null ) ) { network = org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getNetworkDAO ( ) . getByNameAndCluster ( getNetworkName ( ) , org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getVm ( ) . getVdsGroupId ( ) ) ; } return network ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network getNetwork ( ) { if ( ( ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) != null ) && ( ( network ) == null ) ) { network = org.ovirt.engine.core.bll.network.cluster.NetworkHelper.getNetworkByVnicProfileId ( org.ovirt.engine.core.bll.network.vm.ActivateDeactivateVmNicCommand.getParameters ( ) . getNic ( ) . getVnicProfileId ( ) ) ; } return network ; }
Source:
public java.lang.String render ( E object ) { if ( object == null ) { return "N/A" ; } org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.Create ( object.getDeclaringClass ( ) ) ; java.lang.String translation = object.name ( ) ; try { translation = translator.get ( object ) ; } catch ( java.util.MissingResourceException e ) { org.ovirt.engine.ui.common.widget.renderer.EnumRenderer.logger.info ( ( "Missing Enum resource: " + ( e.getLocalizedMessage ( ) ) ) ) ; } return translation ; }

Target:
public java.lang.String render ( E object ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.createAndTranslate ( object ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }
Source:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; junit.framework.Assert.assertTrue ( map.isEmpty ( ) ) ; }

Target:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; org.junit.Assert.assertTrue ( map.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NIC incoming , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , map ( incoming , entity ) ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NIC incoming , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic = map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddVmInterfaceParameters ( parentId , nic , ( incoming.isSetNetwork ( ) ? incoming.getNetwork ( ) . isSetName ( ) ? nic.getNetworkName ( ) : "" : null ) , ( incoming.isSetPortMirroring ( ) ? nic.isPortMirroring ( ) : false ) ) ; }
Source:
public void testExtraVariables ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) , new org.ovirt.engine.core.common.utils.Pair ( "c" , "3" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , "--extra-vars=a=1" , "--extra-vars=b=2" , "--extra-vars=c=3" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }

Target:
public void testExtraVariables ( ) { java.lang.String command = createCommand ( new org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilder ( ) . variables ( new org.ovirt.engine.core.common.utils.Pair ( "a" , "1" ) , new org.ovirt.engine.core.common.utils.Pair ( "b" , "2" ) , new org.ovirt.engine.core.common.utils.Pair ( "c" , "3" ) ) . playbook ( org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK ) ) ; org.junit.Assert.assertEquals ( join ( AnsibleCommandBuilder.ANSIBLE_COMMAND , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_LOG_LEVEL , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.PRIVATE_KEY , "--extra-vars=a=1" , "--extra-vars=b=2" , "--extra-vars=c=3" , org.ovirt.engine.core.common.utils.ansible.AnsibleCommandBuilderTest.ANSIBLE_PLAYBOOK_FULL_PATH ) , command ) ; }
Source:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }

Target:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; injectorRule.bind ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.class , vmDeviceUtils ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; }
Source:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; org.ovirt.engine.core.compat.Guid guid = asGuid ( domain.getBytes ( ) , true ) ; ds.setId ( guid.toString ( ) ) ; dsl.add ( ds ) ; } return dsl ; }

Target:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; ds.setId ( org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.encode ( domain ) ) ; dsl.add ( ds ) ; } return dsl ; }
Source:
public void deleteJobOlderThanDateWithStatus ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; dao.deleteJobOlderThanDateWithStatus ( df.parse ( "2012-10-02 10:00:00" ) , java.util.Arrays.asList ( JobExecutionStatus.FAILED ) ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }

Target:
public void deleteJobOlderThanDateWithStatus ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; dao.deleteJobOlderThanDateWithStatus ( df.parse ( "2012-10-02 10:00:00" ) , java.util.Collections.singletonList ( JobExecutionStatus.FAILED ) ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }
Source:
public org.ovirt.engine.core.bll.CommandBase < ? > createWrappedCommand ( org.ovirt.engine.core.bll.context.CommandContext commandContext , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameter , boolean isInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = ( isInternal ) ? org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameter , ( commandContext != null ? commandContext.clone ( ) . withoutCompensationContext ( ) : null ) ) : org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameter ) ; command.setInternalExecution ( isInternal ) ; return command ; }

Target:
public org.ovirt.engine.core.bll.CommandBase < ? > createWrappedCommand ( org.ovirt.engine.core.bll.context.CommandContext commandContext , org.ovirt.engine.core.common.action.ActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameter , boolean isInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = ( isInternal ) ? org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameter , ( commandContext != null ? commandContext.clone ( ) . withoutCompensationContext ( ) : null ) ) : org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameter ) ; command.setInternalExecution ( isInternal ) ; return command ; }
Source:
public java.util.List < org.ovirt.engine.core.compat.Guid > getAllStorageDomainsByImageGroup ( org.ovirt.engine.core.compat.Guid imageGroupId ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_domainsId_By_imageGroupId" , new org.springframework.jdbc.core.simple.ParameterizedRowMapper < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.core.compat.Guid mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ; } } , getCustomMapSqlParameterSource ( ) . addValue ( "image_group_id" , imageGroupId ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getAllStorageDomainsByImageId ( org.ovirt.engine.core.compat.Guid imageId ) { return getCallsHandler ( ) . executeReadList ( "Getstorage_domains_List_By_ImageId" , org.ovirt.engine.core.dao.StorageDomainDAODbFacadeImpl.StorageDomainRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "image_id" , imageId ) ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
protected void endSuccessfully ( ) { checkTrustedService ( ) ; endImportCommand ( ) ; }
Source:
private void clusterHasVMs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( VDSGroup.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; vmList.add ( vm ) ; org.mockito.Mockito.when ( vmDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }

Target:
private void clusterHasVMs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVdsGroupId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; vmList.add ( vm ) ; org.mockito.Mockito.when ( vmDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vmList ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( snapshotModel , disks , VmModelHelper.WarningType.VM_SNAPSHOT ) ; snapshotModel.getCommands ( ) . add ( getOnSaveCommand ( ) ) ; snapshotModel.getCommands ( ) . add ( getCancelCommand ( ) ) ; snapshotModel.StopProgress ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( snapshotModel , disks , VmModelHelper.WarningType.VM_SNAPSHOT ) ; snapshotModel.getCommands ( ) . add ( getOnSaveCommand ( ) ) ; snapshotModel.getCommands ( ) . add ( getCancelCommand ( ) ) ; snapshotModel.stopProgress ( ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . EndAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }
Source:
protected void UpdateLoginAllAvailability ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; boolean allow = false ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { allow = true ; break ; } } getLoginAllCommand ( ) . setIsExecutionAllowed ( allow ) ; }

Target:
protected void updateLoginAllAvailability ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > items = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel > ) ( getItems ( ) ) ) ; boolean allow = false ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.SanTargetModel item : items ) { if ( ! ( item.getIsLoggedIn ( ) ) ) { allow = true ; break ; } } getLoginAllCommand ( ) . setIsExecutionAllowed ( allow ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void canDoActionVmShareableDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateVmShareableDisk ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED.toString ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryRetVal = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; java.lang.String signature = ( ( java.lang.String ) ( queryRetVal.getReturnValue ( ) ) ) ; org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( signature , getTicket ( ) , getClientUrl ( ) ) ; invoker.invokeClientNative ( ) ; }

Target:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , config , getVncHost ( ) , getVncPort ( ) , getTicket ( ) , false ) ; invoker.invokeClient ( ) ; }
Source:
private void updatePreviewedDiskSnapshots ( final java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : getVmDisks ( ) ) { if ( ( diskImage.getSnapshots ( ) . size ( ) ) <= 1 ) { continue ; } org.ovirt.engine.core.compat.Guid snapshotId = diskImage.getSnapshots ( ) . get ( 1 ) . getVmSnapshotId ( ) ; getSnapshotsMap ( ) . get ( snapshotId ) . getEntity ( ) . getDiskImages ( ) . add ( diskImage ) ; } updateItems ( snapshots ) ; }

Target:
private void updatePreviewedDiskSnapshots ( final java.util.List < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getVmDisks ( ) ) { if ( ( diskImage.getSnapshots ( ) . size ( ) ) <= 1 ) { continue ; } org.ovirt.engine.core.compat.Guid snapshotId = diskImage.getSnapshots ( ) . get ( 1 ) . getVmSnapshotId ( ) ; getSnapshotsMap ( ) . get ( snapshotId ) . getEntity ( ) . getDiskImages ( ) . add ( diskImage ) ; } updateItems ( snapshots ) ; }
Source:
public void onSetupNetworks ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkConnectivityCheckTimeoutInSeconds ( new org.ovirt.engine.ui.frontend.AsyncQuery ( sourceListModel , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { getConnectivityTimeout ( ) . setEntity ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; postOnSetupNetworks ( ) ; } } ) ) ; }

Target:
private boolean shouldBeRemoved ( org.ovirt.engine.core.compat.Guid attachmentId ) { java.util.Set < org.ovirt.engine.core.compat.Guid > removedAttachmentIds = new java.util.HashSet ( org.ovirt.engine.core.common.businessentities.Entities.getIds ( hostSetupNetworksParametersData.removedNetworkAttachments ) ) ; return removedAttachmentIds.contains ( attachmentId ) ; }
Source:
protected void buildVmSoundDevices ( ) { if ( ( vm.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) { createInfo.put ( VdsProperties.soundDevice , getSoundDevice ( vm.getStaticData ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }

Target:
protected void buildVmSoundDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmSoundDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.SOUND ) ; if ( ! ( vmSoundDevices.isEmpty ( ) ) ) { createInfo.put ( VdsProperties.soundDevice , OsRepositoryImpl.INSTANCE.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }
Source:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.VmPool vmPool = dbFacade.getVmPoolDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForVmPool ( ) { org.ovirt.engine.core.common.businessentities.VmPool vmPool = dbFacade.getVmPoolDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_POOL_ID ) ; org.junit.Assert.assertNotNull ( vmPool ) ; java.lang.String name = vmPool.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.VM_POOL_ID , VdcObjectType.VmPool ) ) ) ; }
Source:
protected boolean isOsSupportingHotPlug ( ) { int vmOs = org.ovirt.engine.core.bll.VmCommand.getVm ( ) . getOs ( ) ; java.lang.String [ ] unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.HotPlugUnsupportedOsList ) . split ( "," ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( osRepository.getOsName ( vmOs ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; return false ; } } return true ; }

Target:
protected org.ovirt.engine.core.dao.ImageDao getImageDao ( ) { return org.ovirt.engine.core.bll.VmCommand.getDbFacade ( ) . getImageDao ( ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.HostNic nic = resource.get ( ) ; org.junit.Assert.assertTrue ( nic.isSetStatistics ( ) ) ; hostNicsResource.verifyModelSpecific ( nic , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_IDX ) ; } finally { accepts.clear ( ) ; } }