auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( 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 ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void testExecuteCommandFailsWithClusterIdForStop ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , EngineError.GlusterServicesActionFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STOP_FAILED ) ; }

Target:
public void testExecuteCommandFailsWithClusterIdForStop ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) , null ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , EngineError.GlusterServicesActionFailed , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STOP_FAILED ) ; }
Source:
private void executeActionInTransactionScope ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.registerRollbackHandler ( this ) ; } if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.cancelTasks ( this ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }

Target:
private void executeActionInTransactionScope ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.registerRollbackHandler ( this ) ; } if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { cancelTasks ( ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }
Source:
private static java.security.KeyStore getTrustStore ( java.lang.String filePath , java.lang.String password ) throws java.io.IOException , java.security.KeyStoreException , java.security.NoSuchAlgorithmException , java.security.cert.CertificateException { java.io.InputStream in = new java.io.FileInputStream ( filePath ) ; java.security.KeyStore ks = java.security.KeyStore.getInstance ( "JKS" ) ; ks.load ( in , password.toCharArray ( ) ) ; return ks ; }

Target:
private static java.security.KeyStore getTrustStore ( java.lang.String filePath , java.lang.String password ) throws java.io.IOException , java.security.KeyStoreException , java.security.NoSuchAlgorithmException , java.security.cert.CertificateException { java.security.KeyStore ks ; try ( java.io.InputStream in = new java.io.FileInputStream ( filePath ) ) { ks = java.security.KeyStore.getInstance ( "JKS" ) ; ks.load ( in , password.toCharArray ( ) ) ; } return ks ; }
Source:
public void onSuccess ( java.lang.Object innerModel , java.lang.Object innerReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( innerReturnValue ) ) . getReturnValue ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( quotas ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( quotas ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getName ( ) ) ; hosts.add ( vds ) ; } return hosts ; }
Source:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }
Source:
public void testGet ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE , result.getId ( ) ) ; org.junit.Assert.assertEquals ( false , result.isPortMirroring ( ) ) ; org.junit.Assert.assertFalse ( result.isPassthrough ( ) ) ; }

Target:
public void testGet ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE , result.getId ( ) ) ; org.junit.Assert.assertFalse ( result.isPortMirroring ( ) ) ; org.junit.Assert.assertFalse ( result.isPassthrough ( ) ) ; }
Source:
private java.lang.String getPrintableConnectionsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.vdscommands.storage_server_connections con : getConnectionList ( ) ) { sb.append ( "{ id: " ) ; sb.append ( con.getid ( ) ) ; sb.append ( ", connection: " ) ; sb.append ( con.getconnection ( ) ) ; sb.append ( " };" ) ; } return sb.toString ( ) ; }

Target:
private java.lang.String getPrintableConnectionsList ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.vdscommands.storage_server_connections con : getConnectionList ( ) ) { sb.append ( con ) ; } return sb.toString ( ) ; }
Source:
private boolean validateNetworkProviderConfiguration ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . isInstallHost ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) ) != null ) ) && ( ! ( validateNetworkProviderProperties ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) , org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkMappings ( ) ) ) ) ; }

Target:
private boolean validateNetworkProviderConfiguration ( ) { return ( ( ! ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . isInstallHost ( ) ) ) || ( ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) ) == null ) ) || ( validateNetworkProviderProperties ( org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkProviderId ( ) , org.ovirt.engine.core.bll.UpdateVdsCommand.getParameters ( ) . getNetworkMappings ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( _diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDAO ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; _diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return _diskImage ; default : return super . getImage ( ) ; } }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskImage getImage ( ) { switch ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getActionState ( ) ) { case END_SUCCESS : case END_FAILURE : if ( ( _diskImage ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages = org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getDiskImageDAO ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.MoveOrCopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; _diskImage = ( diskImages.isEmpty ( ) ) ? null : diskImages.get ( 0 ) ; } return _diskImage ; default : return super . getImage ( ) ; } }
Source:
public void testExecuteCommandFailsWithServerIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) , null ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , EngineError.GlusterServicesActionFailed , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_START_FAILED ) ; }

Target:
public void testExecuteCommandFailsWithServerIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) , null ) ) ; setUpMockUpForStart ( ) ; mockBackend ( false , EngineError.GlusterServicesActionFailed , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.never ( ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_SERVICE_START_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.MacPool o1 , org.ovirt.engine.core.common.businessentities.MacPool o2 ) { int retVal = ( - 1 ) * ( java.lang.Boolean.compare ( o1.isDefaultPool ( ) , o2.isDefaultPool ( ) ) ) ; if ( retVal != 0 ) { return retVal ; } return lexoNumeric.compare ( o1.getName ( ) , o2.getName ( ) ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.MacPool o1 , org.ovirt.engine.core.common.businessentities.MacPool o2 ) { int retVal = ( - 1 ) * ( java.lang.Boolean.compare ( o1.isDefaultPool ( ) , o2.isDefaultPool ( ) ) ) ; if ( retVal != 0 ) { return retVal ; } return lexoNumeric.compare ( o1 , o2 ) ; }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel model ) { splitTable.edit ( model.getProviderNetworks ( ) , model.getImportedNetworks ( ) , model.getAddImportCommand ( ) , model.getCancelImportCommand ( ) ) ; dcColumn.edit ( model.getDataCenters ( ) ) ; driver.edit ( model ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel model ) { splitTable.edit ( model.getProviderNetworks ( ) , model.getImportedNetworks ( ) , model.getAddImportCommand ( ) , model.getCancelImportCommand ( ) ) ; driver.edit ( model ) ; }
Source:
private org.ovirt.engine.core.bll.QueriesCommandBase < ? > mockQuery ( ) { org.ovirt.engine.core.bll.QueriesCommandBase < ? > query = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.QueriesCommandBase.class , org.mockito.Mockito.withSettings ( ) . useConstructor ( params ) . defaultAnswer ( Answers.CALLS_REAL_METHODS ) ) ; org.mockito.Mockito.doReturn ( mockSessionDataContainer ) . when ( query ) . getSessionDataContainer ( ) ; query.postConstruct ( ) ; return query ; }

Target:
private org.ovirt.engine.core.bll.QueriesCommandBase < ? > mockQuery ( ) { org.ovirt.engine.core.bll.QueriesCommandBase < ? > query = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.QueriesCommandBase.class , org.mockito.Mockito.withSettings ( ) . useConstructor ( params , null ) . defaultAnswer ( Answers.CALLS_REAL_METHODS ) ) ; org.mockito.Mockito.doReturn ( mockSessionDataContainer ) . when ( query ) . getSessionDataContainer ( ) ; query.postConstruct ( ) ; return query ; }
Source:
private boolean canRemoveLunDisk ( ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( ( vm.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } return true ; }

Target:
private boolean canRemoveLunDisk ( ) { if ( ( listVms ) != null ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : listVms ) { if ( ( vm.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( disk.getId ( ) , vm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } } return true ; }
Source:
public static java.util.List < java.lang.String > assertCanDoActionMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}canDoAction messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.CanDoActionTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }

Target:
public static java.util.List < java.lang.String > assertCanDoActionMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.EngineMessage message ) { java.util.List < java.lang.String > canDoActionMessages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}canDoAction messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.CanDoActionTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , canDoActionMessages ) , canDoActionMessages.contains ( message.name ( ) ) ) ; return canDoActionMessages ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network before = dao.getByName ( existing_net_name ) ; before.setdescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network after = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.Network before = dao.getByName ( existing_net_name ) ; before.setdescription ( "This is a completely changed description" ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.Network after = dao.getByName ( existing_net_name ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }
Source:
private java.lang.String getMemoryFromActiveSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( getFlow ( ) ) == ( org.ovirt.engine.core.common.action.RunVmParams.RunVmFlow.RESUME_HIBERNATE ) ) { return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; }

Target:
protected java.lang.String getMemoryFromActiveSnapshot ( ) { if ( memoryFromSnapshotUsed ) { return org.apache.commons.lang.StringUtils.EMPTY ; } if ( ( getFlow ( ) ) == ( org.ovirt.engine.core.common.action.RunVmParams.RunVmFlow.RESUME_HIBERNATE ) ) { return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.isMemorySnapshotSupportedByArchitecture ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getClusterArch ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return org.apache.commons.lang.StringUtils.EMPTY ; } return org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , false , null ) ; return nic ; }
Source:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } org.ovirt.engine.core.bll.tasks.TaskManagerUtil.cancelTasks ( this ) ; }

Target:
public void rollback ( ) { log.errorFormat ( "Transaction rolled-back for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Host model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ADDRESSES [ index ] , model.getAddress ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.HOST_STATUS [ index ] . value ( ) , model.getStatus ( ) . getState ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Host model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.ADDRESSES [ index ] , model.getAddress ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.HOST_STATUS [ index ] , model.getStatus ( ) ) ; }
Source:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( getOldDisk ( ) . getDiskStorageType ( ) . isInternal ( ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }

Target:
private boolean updateImageParametersRequiringVmDownRequested ( ) { if ( ! ( getOldDisk ( ) . getDiskStorageType ( ) . isInternal ( ) ) ) { return false ; } org.ovirt.engine.core.compat.Guid oldQuotaId = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) . getQuotaId ( ) ; if ( oldQuotaId == null ) { return false ; } return ! ( java.util.Objects.equals ( oldQuotaId , getQuotaId ( ) ) ) ; }
Source:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }

Target:
public void setUp ( ) { tested = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.common.system.ClientStorageImpl ( ) { @ java.lang.Override void initStorage ( ) { } } ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setLocalItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( tested ) . setSessionItemImpl ( org.mockito.ArgumentMatchers.anyString ( ) , org.mockito.ArgumentMatchers.anyString ( ) ) ; }
Source:
public void setText ( java.lang.String text ) { super . setText ( new org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer < java.lang.String > ( ) . render ( text ) ) ; if ( showBorder ) { getElement ( ) . getStyle ( ) . setBorderWidth ( 1 , Unit.PX ) ; } if ( disableResizing ) { getElement ( ) . getStyle ( ) . setProperty ( "resize" , "none" ) ; } }

Target:
public void setText ( java.lang.String text ) { super . setText ( new org.ovirt.engine.ui.common.widget.renderer.EmptyValueRenderer < java.lang.String > ( ) . render ( text ) ) ; }
Source:
protected static boolean CanAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId ) { boolean returnValue = true ; java.util.ArrayList < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , messages ) ) { returnValue = false ; } if ( returnValue ) { if ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId , messages ) ) ) { returnValue = false ; } } return returnValue ; }

Target:
protected static boolean CanAttachPrestartedVmToUser ( org.ovirt.engine.core.compat.Guid vmId ) { boolean returnValue = true ; java.util.ArrayList < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmAssignedToUser ( vmId , messages ) ) { returnValue = false ; } if ( returnValue ) { if ( ! ( org.ovirt.engine.core.bll.VmPoolCommandBase.vmIsRunningStateless ( vmId ) ) ) { returnValue = false ; } } return returnValue ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Map < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ) ( source ) ) : new java.util.HashMap < org.ovirt.engine.core.compat.Version , java.util.Map < java.lang.String , java.lang.String > > ( ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; vfMap = returnValue.getReturnValue ( ) ; if ( ( vfMap ) == null ) { vfMap = java.util.Collections.emptyMap ( ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; vfMap = returnValue.getReturnValue ( ) ; if ( ( vfMap ) == null ) { vfMap = java.util.Collections.emptyMap ( ) ; } queryFreeBonds ( ) ; }
Source:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.NGuid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getVdsGroupId ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllStaticByStoragePool ( ) { org.ovirt.engine.core.compat.Guid spID = dbFacade.getVdsGroupDao ( ) . get ( newVmStatic.getVdsGroupId ( ) ) . getStoragePoolId ( ) ; org.junit.Assert.assertNotNull ( spID.getValue ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > result = dao.getAllByStoragePoolId ( spID.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
private void Preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { } } , null ) ; } }

Target:
private void Preview ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.TryBackToAllSnapshotsOfVm , new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getVmName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }

Target:
private static void logField ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticFromOvf , java.lang.String fieldName , java.lang.String fieldValue ) { java.lang.String vmName = vmStaticFromOvf.getName ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "FieldName" , fieldName ) ; logable.addCustomValue ( "VmName" , vmName ) ; logable.addCustomValue ( "FieldValue" , fieldValue ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VM_IMPORT_INFO ) ; }
Source:
public boolean isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connectionsForDomain = getAllConnectionsForDomain ( storageDomain.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionForDomain : connectionsForDomain ) { if ( connectionForDomain.getid ( ) . equals ( connection.getid ( ) ) ) { return true ; } } return false ; }

Target:
public boolean isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connectionsForDomain = getAllConnectionsForDomain ( storageDomain.getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionForDomain : connectionsForDomain ) { if ( connectionForDomain.getId ( ) . equals ( connection.getId ( ) ) ) { return true ; } } return false ; }
Source:
public void testGetAllConnectionsOfNfsDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = dao.getAllForDomain ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "d9ede37f-e6c3-4bf9-a984-19174070aa31" ) ) ; org.junit.Assert.assertEquals ( connections.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( connections.get ( 0 ) . geIid ( ) , "0cc146e8-e5ed-482c-8814-270bc48c2981" ) ; }

Target:
public void testGetAllConnectionsOfNfsDomain ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = dao.getAllForDomain ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "d9ede37f-e6c3-4bf9-a984-19174070aa31" ) ) ; org.junit.Assert.assertEquals ( connections.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( connections.get ( 0 ) . getId ( ) , "0cc146e8-e5ed-482c-8814-270bc48c2981" ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storageListModel , storages ) ; } else { storageListModel.saveNewPosixStorage ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storages ) { if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storages ) ; } else { saveNewPosixStorage ( ) ; } }
Source:
public java.nio.channels.SelectionKey connect ( ) throws java.io.IOException { final java.net.InetSocketAddress addr = new java.net.InetSocketAddress ( java.net.InetAddress.getByName ( this . host ) , this . port ) ; java.nio.channels.SocketChannel socketChannel = java.nio.channels.SocketChannel.open ( ) ; socketChannel.connect ( addr ) ; socketChannel.configureBlocking ( false ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; java.nio.channels.SelectionKey key = socketChannel.register ( this . selector , interestedOps , new java.util.concurrent.ConcurrentLinkedDeque < > ( ) ) ; setDaemon ( true ) ; start ( ) ; return key ; }

Target:
public java.nio.channels.SelectionKey connect ( int port ) throws java.io.IOException { final java.net.InetSocketAddress addr = new java.net.InetSocketAddress ( java.net.InetAddress.getByName ( this . host ) , port ) ; java.nio.channels.SocketChannel socketChannel = java.nio.channels.SocketChannel.open ( ) ; socketChannel.connect ( addr ) ; socketChannel.configureBlocking ( false ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; java.nio.channels.SelectionKey key = socketChannel.register ( this . selector , interestedOps , new java.util.concurrent.ConcurrentLinkedDeque < > ( ) ) ; setDaemon ( true ) ; start ( ) ; return key ; }
Source:
public org.ovirt.engine.api.resource.DomainGroupResource getDomainGroupSubResource ( java.lang.String id ) { try { byte [ ] bytes = org.apache.commons.codec.binary.Hex.decodeHex ( id.toCharArray ( ) ) ; org.ovirt.engine.core.common.utils.ExternalId externalId = new org.ovirt.engine.core.common.utils.ExternalId ( bytes ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendDomainGroupResource ( externalId , this ) ) ; } catch ( org.apache.commons.codec.DecoderException exception ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( exception , ( ( "Can't decode domain group identifier '" + id ) + "'." ) , Response.Status.INTERNAL_SERVER_ERROR ) ; } }

Target:
public org.ovirt.engine.api.resource.DomainGroupResource getDomainGroupSubResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendDomainGroupResource ( id , this ) ) ; }
Source:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( ) ; }

Target:
public void testErrorHandling ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( false ) ; value.setExceptionObject ( new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ( "unknown host" ) ) ; org.mockito.Mockito.when ( resourceManager.runVdsCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( value ) ; updater.refreshVdsStats ( true ) ; }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; queryReturnValue.setReturnValue ( returnValue ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ) . thenReturn ( queryReturnValue ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryReturnValue = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; queryReturnValue.setReturnValue ( returnValue ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( queryReturnValue ) ; }
Source:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , result.get ( 0 ) . getId ( ) ) ; }
Source:
public void executeCommandFailedWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( EngineError.GlusterHookNotFound , e.getErrorCode ( ) ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; }

Target:
public void executeCommandFailedWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( false , EngineError.GlusterHookNotFound ) ; try { cmd.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.junit.Assert.assertEquals ( EngineError.GlusterHookNotFound , e.getErrorCode ( ) ) ; } org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "Message" ) ) { message.setText ( object.getMessage ( ) ) ; } }
Source:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }

Target:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( srcDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getStorageType ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getName ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getmaster_domain_version ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getName ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getmaster_domain_version ( ) ) ) ; }