auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModelsByRole ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType role = getModel ( ) . getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getStorageModelsByRole ( role ) ) ; return getSelectableModels ( items ) ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModelsByRole ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType role = getModel ( ) . getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = getModel ( ) . getStorageModelsByRole ( role ) ; return getSelectableModels ( items ) ; }
Source:
private void initializeObjectState ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getSnapshotName ( ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . getSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) ) ; }

Target:
private void initializeObjectState ( ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getSnapshotName ( ) ) ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = org.ovirt.engine.core.bll.RemoveSnapshotCommand.getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . getSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) ) ; }
Source:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry : storageDomains ) { org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; } }

Target:
public void onRemoval ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDao ( ) . getAllByConnectionId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomainEntry = storageDomains.get ( 0 ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainDynamicDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; org.ovirt.engine.core.bll.provider.storage.AbstractOpenStackStorageProviderProxy.getDbFacade ( ) . getStorageDomainStaticDao ( ) . remove ( storageDomainEntry.getId ( ) ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message execute ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message message ) { java.util.Map < java.lang.String , java.lang.String > headers = message.getHeaders ( ) ; java.lang.String destHeader = headers.get ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION ) ; if ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.isEmpty ( destHeader ) ) { return new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . error ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_MESSAGE , "Missing required header" ) ; } for ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener el : eventListeners ) { el.onMessageReceived ( message.getContent ( ) . getBytes ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.UTF8 ) ) ; } return null ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message execute ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message message ) { java.util.Map < java.lang.String , java.lang.String > headers = message.getHeaders ( ) ; java.lang.String destHeader = headers.get ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_DESTINATION ) ; if ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.isEmpty ( destHeader ) ) { return new org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message ( ) . error ( ) . withHeader ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.HEADER_MESSAGE , "Missing required header" ) ; } for ( org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener el : eventListeners ) { el.onMessageReceived ( message.getContent ( ) ) ; } return null ; }
Source:
boolean areRequiredNetworksAvailable ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds ) { for ( final org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIf : vmNetworkInterfaces ) { boolean found = false ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsIf : allInterfacesForVds ) { if ( org.apache.commons.lang.StringUtils.equals ( vmIf.getNetworkName ( ) , vdsIf.getNetworkName ( ) ) ) { found = true ; break ; } } if ( ! found ) { org.ovirt.engine.core.bll.VdsSelector.log.debug ( "VDS is not ok for running the VM as network is missing" ) ; return false ; } } return true ; }

Target:
boolean areRequiredNetworksAvailable ( final java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmNetworkInterfaces , final java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > allInterfacesForVds ) { for ( final org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmIf : vmNetworkInterfaces ) { boolean found = false ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vdsIf : allInterfacesForVds ) { if ( org.apache.commons.lang.StringUtils.equals ( vmIf.getNetworkName ( ) , vdsIf.getNetworkName ( ) ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 2 ) ; initParetResource ( resource.parent , uriInfo ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.util.List < java.lang.Integer > filterPossibleValues ( java.util.List < java.lang.Integer > candidates , java.util.List < java.lang.Integer > others ) { java.util.List < java.lang.Integer > res = new java.util.ArrayList < java.lang.Integer > ( ) ; int currentCpusCores = getTotalCpuCores ( ) ; for ( java.lang.Integer candidate : candidates ) { for ( java.lang.Integer other : others ) { if ( ( candidate * other ) == currentCpusCores ) { res.add ( candidate ) ; break ; } } } return res ; }

Target:
protected java.util.List < java.lang.Integer > filterPossibleValues ( java.util.List < java.lang.Integer > candidates , java.util.List < java.lang.Integer > others ) { java.util.List < java.lang.Integer > res = new java.util.ArrayList < java.lang.Integer > ( ) ; int currentCpusCores = getTotalCpuCores ( ) ; for ( java.lang.Integer candidate : candidates ) { for ( java.lang.Integer other : others ) { if ( ( candidate * other ) == currentCpusCores ) { res.add ( candidate ) ; break ; } } } return res ; }
Source:
public void setupMocks ( ) { setUpCommand ( ) ; mockGetStorageDomainList ( ) ; mockDbDao ( ) ; org.mockito.Mockito.when ( vmHandler.verifyMacPool ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( vmHandler.isVmPriorityValueLegal ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( true ) ; command.init ( ) ; }

Target:
public void setupMocks ( ) { setUpCommand ( ) ; mockGetStorageDomainList ( ) ; mockDbDao ( ) ; command.init ( ) ; }
Source:
public void createCpuProfileTest ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.createCpuProfile ( org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_ID , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_NAME ) ; org.junit.Assert.assertEquals ( cpuProfile.getName ( ) , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_NAME ) ; org.junit.Assert.assertEquals ( cpuProfile.getClusterId ( ) , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( cpuProfile.getId ( ) ) ; org.junit.Assert.assertEquals ( cpuProfile.getProfileType ( ) , ProfileType.CPU ) ; }

Target:
public void createCpuProfileTest ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile cpuProfile = org.ovirt.engine.core.bll.profiles.CpuProfileHelper.createCpuProfile ( org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_ID , org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_NAME ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_NAME , cpuProfile.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.bll.profiles.CpuProfileHelperTest.CLUSTER_ID , cpuProfile.getClusterId ( ) ) ; org.junit.Assert.assertNotNull ( cpuProfile.getId ( ) ) ; org.junit.Assert.assertEquals ( ProfileType.CPU , cpuProfile.getProfileType ( ) ) ; }
Source:
public void RequestSearch ( ) { searchRequested = true ; model.setItems ( new java.util.ArrayList ( ) ) ; model.getSelectedItemChangedEvent ( ) . raise ( this , new org.ovirt.engine.core.compat.EventArgs ( ) ) ; model.getSelectedItemsChangedEvent ( ) . raise ( this , new org.ovirt.engine.core.compat.EventArgs ( ) ) ; }

Target:
public void RequestSearch ( ) { searchRequested = true ; }
Source:
public void testEchoStderr ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat >&2" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( 0 , stdout.size ( ) ) ; }

Target:
public void testEchoStderr ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; try ( final java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; final java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; final java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ) { client.executeCommand ( "cat >&2" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( 0 , stdout.size ( ) ) ; } }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }
Source:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) . value ( ) ) ; for ( org.ovirt.engine.api.model.Ip ip : model.getIps ( ) . getIps ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.ReportedDevice postPopulate ( org.ovirt.engine.api.model.ReportedDevice model ) { model.setType ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.model.ReportedDeviceType.class ) ) ; for ( org.ovirt.engine.api.model.Ip ip : model.getIps ( ) . getIps ( ) ) { ip.setVersion ( org.ovirt.engine.api.restapi.types.MappingTestHelper.shuffle ( org.ovirt.engine.api.restapi.types.IpVersion.class ) . value ( ) ) ; ip.setGateway ( null ) ; ip.setNetmask ( null ) ; } return model ; }
Source:
public java.util.ArrayList < java.lang.Integer > get64bitOss ( ) { java.util.ArrayList < java.lang.Integer > oss = new java.util.ArrayList < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String bus = getValueByVersion ( idToUnameLookup.get ( osId ) , "bus" , null ) ; if ( "64" . equalsIgnoreCase ( bus ) ) { oss.add ( osId ) ; } } return oss ; }

Target:
public java.util.List < java.lang.Integer > get64bitOss ( ) { java.util.List < java.lang.Integer > oss = new java.util.ArrayList < > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String bus = getValueByVersion ( idToUnameLookup.get ( osId ) , "bus" , null ) ; if ( "64" . equalsIgnoreCase ( bus ) ) { oss.add ( osId ) ; } } return oss ; }
Source:
public void refreshDetails ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getGlusterRebalanceStatus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue vdcValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity rebalanceStatusEntity = vdcValue.getReturnValue ( ) ; if ( rebalanceStatusEntity != null ) { showStatus ( rebalanceStatusEntity ) ; } } } ) , volumeEntity.getClusterId ( ) , volumeEntity.getId ( ) ) ; }

Target:
public void refreshDetails ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterRebalanceStatus ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue vdcValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity rebalanceStatusEntity = vdcValue.getReturnValue ( ) ; if ( rebalanceStatusEntity != null ) { showStatus ( rebalanceStatusEntity ) ; } } } ) , volumeEntity.getClusterId ( ) , volumeEntity.getId ( ) ) ; }
Source:
public static int totalVideoRAMSizeMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Integer > settings = org.ovirt.engine.core.bll.utils.VideoDeviceSettings.getVideoDeviceSettings ( vm.getStaticData ( ) ) ; return ( ( ( settings.getOrDefault ( VdsProperties.VIDEO_RAM , 0 ) ) + ( settings.getOrDefault ( VdsProperties.VIDEO_VRAM , 0 ) ) ) + 1023 ) / 1024 ; }

Target:
public int totalVideoRAMSizeMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Map < java.lang.String , java.lang.Integer > settings = getVideoDeviceSettings ( vm.getStaticData ( ) ) ; return ( ( ( settings.getOrDefault ( VdsProperties.VIDEO_RAM , 0 ) ) + ( settings.getOrDefault ( VdsProperties.VIDEO_VRAM , 0 ) ) ) + 1023 ) / 1024 ; }
Source:
private void updateOps ( byte [ ] message ) { if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { try { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.parse ( message ) ) ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ignored ) { } } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }

Target:
private void updateOps ( byte [ ] message ) { if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { try { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.parse ( message ) ) ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ignored ) { } } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( ( ) -> { client.updateInterestedOps ( ) ; return null ; } ) ; }
Source:
public void onRevealOverlayContent ( org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent event ) { java.util.Set < com.gwtplatform.mvp.client.PresenterWidget < ? > > children = getChildren ( com.gwtplatform.mvp.client.presenter.slots.LegacySlotConvertor.convert ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) ; if ( ( event.getContent ( ) ) != null ) { event.getContent ( ) . setCurrentPlaceWidget ( children.iterator ( ) . next ( ) ) ; } setInSlot ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetOverlay , event.getContent ( ) ) ; }

Target:
public void onRevealOverlayContent ( org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent event ) { java.util.Set < com.gwtplatform.mvp.client.PresenterWidget < ? > > children = getChildren ( com.gwtplatform.mvp.client.presenter.slots.LegacySlotConvertor.convert ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) ; if ( ( ( event.getContent ( ) ) != null ) && ( ! ( children.isEmpty ( ) ) ) ) { event.getContent ( ) . setCurrentPlaceWidget ( children.iterator ( ) . next ( ) ) ; } setInSlot ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetOverlay , event.getContent ( ) ) ; }
Source:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.connection.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters , null ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . findConnectionWithSameDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageServerConnections.class ) ) ; }

Target:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.connection.AddStorageServerConnectionCommand ( parameters , null ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . findConnectionWithSameDetails ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageServerConnections.class ) ) ; }
Source:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmNicValidator.networkLinkingSupported ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }

Target:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmNicValidator.networkLinkingSupported ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }
Source:
public void fetch ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStats = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.GetAllVmStats , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsManager.getCopyVds ( ) ) ) ; if ( getStats.getSucceeded ( ) ) { vdsmVms = ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ) ( getStats.getReturnValue ( ) ) ) ; onFetchVms ( ) ; } else { onError ( ) ; } }

Target:
public boolean fetch ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue getStats = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.GetAllVmStats , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsManager.getCopyVds ( ) ) ) ; if ( getStats.getSucceeded ( ) ) { vdsmVms = ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > ) ( getStats.getReturnValue ( ) ) ) ; onFetchVms ( ) ; return true ; } else { onError ( ) ; return false ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } }

Target:
public void onSuccess ( java.lang.String pk ) { if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( pk ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( returnValue ) ) ; if ( ! ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByStorageType ( disks , DiskStorageType.LUN ) . isEmpty ( ) ) ) { setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cloneVmLunsWontBeCloned ( ) ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByStorageType ( disks , DiskStorageType.LUN ) . isEmpty ( ) ) ) { setMessage ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cloneVmLunsWontBeCloned ( ) ) ; } }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true , null ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.Bookmark o1 , org.ovirt.engine.core.common.businessentities.Bookmark o2 ) { java.lang.String name1 = o1.getbookmark_name ( ) ; java.lang.String name2 = o2.getbookmark_name ( ) ; if ( ( name1 == null ) || ( name2 == null ) ) { throw new java.lang.IllegalArgumentException ( "Bookmark name cannot be null" ) ; } return name1.compareTo ( name2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.Bookmark o1 , org.ovirt.engine.core.common.businessentities.Bookmark o2 ) { java.lang.String name1 = o1.getName ( ) ; java.lang.String name2 = o2.getName ( ) ; if ( ( name1 == null ) || ( name2 == null ) ) { throw new java.lang.IllegalArgumentException ( "Bookmark name cannot be null" ) ; } return name1.compareTo ( name2 ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.VmBaseListModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : storageDomains ) { if ( ( a.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { filteredStorageDomains.add ( a ) ; } } vmListModel.PostExportGetStorageDomainList ( filteredStorageDomains ) ; }
Source:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUp ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getstatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getstatus ( ) ) ; } }

Target:
protected void Perform ( ) { if ( org.ovirt.engine.core.common.businessentities.VM.isStatusUp ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.Pause , new org.ovirt.engine.core.common.vdscommands.PauseVDSCommandParameters ( org.ovirt.engine.core.bll.PauseVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.PauseVmCommand.getVmId ( ) ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.PauseVmCommand.setSucceeded ( true ) ; } else { setActionReturnValue ( org.ovirt.engine.core.bll.PauseVmCommand.getVm ( ) . getStatus ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; if ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . isUseCinderCommandCallback ( ) ) { parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setCommandId ( org.ovirt.engine.core.bll.RunVmCommand.getParametersForChildCommand ( ) . get ( 0 ) . getCommandId ( ) ) ; } return parameters ; }

Target:
private org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters buildCreateSnapshotParametersForEndAction ( ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters parameters = buildCreateSnapshotParameters ( ) ; parameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; parameters.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; parameters.setCommandId ( org.ovirt.engine.core.bll.RunVmCommand.getParametersForChildCommand ( ) . get ( 0 ) . getCommandId ( ) ) ; return parameters ; }
Source:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; mockCompatibilityVersion ( Version.v3_5 ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; mockIsGlusterEnabled ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; mockIsGlusterEnabled ( true ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public java.util.Set < java.lang.String > computeSelecetedLabels ( ) { java.util.Set < java.lang.String > selectedLabels = new java.util.HashSet < > ( ) ; selectedLabels.clear ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : getItems ( ) ) { selectedLabels.add ( labelModel.getSelectedItem ( ) ) ; } return selectedLabels ; }

Target:
public java.util.Set < java.lang.String > computeSelecetedLabels ( ) { java.util.Set < java.lang.String > selectedLabels = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > labelModel : getItems ( ) ) { selectedLabels.add ( labelModel.getSelectedItem ( ) ) ; } return selectedLabels ; }
Source:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.trim ( ) . length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } }

Target:
public static java.lang.String decrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.DECRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getPrivateKeyEntry ( ) . getPrivateKey ( ) ) ; return new java.lang.String ( rsa.doFinal ( new org.apache.commons.codec.binary.Base64 ( ) . decode ( source ) ) , java.nio.charset.Charset.forName ( "UTF-8" ) ) ; } }
Source:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfMoreThanOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 5 , 2 , 2 , 2 , 2 ) ; org.junit.Assert.assertEquals ( 5 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getstorage_pool_id ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getStoragePoolId ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.api.model.Disk > values ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > result = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.api.model.Disk diskImage : values ) { result.put ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( diskImage ) ) . getImageId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( diskImage ) ) ) ; } return result ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.api.model.Disk > values ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > result = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.api.model.Disk diskImage : values ) { result.put ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( diskImage ) ) . getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( diskImage ) ) ) ; } return result ; }
Source:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = collection.getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setSessionHelper ( sessionHelper ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = collection.getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
public void testCanDoActionWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand < org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters > ( params ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }

Target:
public void testCanDoActionWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand ( params ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult consistentDataCenter ( ) { return ( ( getOldQos ( ) ) == null ) || ( ! ( qos.getStoragePoolId ( ) . equals ( getOldQos ( ) . getStoragePoolId ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_QOS_STORAGE_POOL_NOT_CONSISTENT ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult consistentDataCenter ( ) { return ( ( qos ) != null ) && ( ( ( getOldQos ( ) ) == null ) || ( ! ( qos.getStoragePoolId ( ) . equals ( getOldQos ( ) . getStoragePoolId ( ) ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_QOS_STORAGE_POOL_NOT_CONSISTENT ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
public void sufficientDiskSpace ( ) { org.ovirt.engine.core.bll.validator.ImportValidator validator = setupDiskSpaceTest ( createParameters ( ) ) ; org.junit.Assert.assertTrue ( validator.validateSpaceRequirements ( mockCreateDiskDummiesForSpaceValidations ( ) ) . isValid ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForDisksWithSnapshots ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void sufficientDiskSpace ( ) { org.ovirt.engine.core.bll.validator.ImportValidator validator = setupDiskSpaceTest ( createParameters ( ) ) ; org.junit.Assert.assertTrue ( validator.validateSpaceRequirements ( mockCreateDiskDummiesForSpaceValidations ( ) ) . isValid ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForDisksWithSnapshots ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator , org.mockito.Mockito.never ( ) ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > result = dao.getAllOfType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool pool : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , pool.getstorage_pool_type ( ) ) ; } }

Target:
public void testGetAllOfType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > result = dao.getAllOfType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool pool : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , pool.getstorage_pool_type ( ) ) ; } }
Source:
private void runCommand ( ) throws org.ovirt.engine.core.domains.ManageDomainsResult { java.lang.String action = args.get ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_ACTION ) ; if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_ADD.equals ( action ) ) { addDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_EDIT.equals ( action ) ) { editDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_DELETE.equals ( action ) ) { deleteDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_VALIDATE.equals ( action ) ) { validate ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_LIST.equals ( action ) ) { getConfiguration ( ) ; } }

Target:
public void runCommand ( ) throws org.ovirt.engine.core.domains.ManageDomainsResult { java.lang.String action = args.get ( org.ovirt.engine.core.domains.ManageDomainsArguments.ARG_ACTION ) ; if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_ADD.equals ( action ) ) { addDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_EDIT.equals ( action ) ) { editDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_DELETE.equals ( action ) ) { deleteDomain ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_VALIDATE.equals ( action ) ) { validate ( ) ; } else if ( org.ovirt.engine.core.domains.ManageDomainsArguments.ACTION_LIST.equals ( action ) ) { getConfiguration ( ) ; } }
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.webadmin.section.main.presenter.popup.cluster.NewClusterNetworkPopupPresenterWidget.ViewDef ) ( getView ( ) ) ) . setDataCenterName ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( model.getDataCenters ( ) . getSelectedItem ( ) ) ) . getname ( ) ) ; }

Target:
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.webadmin.section.main.presenter.popup.cluster.NewClusterNetworkPopupPresenterWidget.ViewDef ) ( getView ( ) ) ) . setDataCenterName ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( model.getDataCenters ( ) . getSelectedItem ( ) ) ) . getName ( ) ) ; }
Source:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Application application = resource.get ( ) ; assertEquals ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.APPLICATION_INDEX ] , application.getName ( ) ) ; verifyLinks ( application ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; org.ovirt.engine.api.model.Application application = resource.get ( ) ; assertEquals ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendVmApplicationResourceTest.APPLICATION_INDEX ] , application.getName ( ) ) ; verifyLinks ( application ) ; }