auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gwt.resources.client.ImageResource getStatusImage ( ) { switch ( ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) ( item ) ) . getStatus ( ) ) { case UP : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicUp ( ) ; case DOWN : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicDown ( ) ; case NONE : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.questionMarkImage ( ) ; default : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.questionMarkImage ( ) ; } }

Target:
private com.google.gwt.resources.client.ImageResource getStatusImage ( ) { switch ( item.getStatus ( ) ) { case UP : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicUp ( ) ; case DOWN : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.nicDown ( ) ; case NONE : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.questionMarkImage ( ) ; default : return org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NicPanel.resources.questionMarkImage ( ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmApplicationResource resource = getNotFoundResource ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void addCustomValueWillNotReturnANull ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String value = null ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( "" , v ) ; }

Target:
public void addCustomValueWillNotReturnANull ( ) { final java.lang.String key = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String value = null ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( "" , v ) ; }
Source:
public boolean isWebSocketProxyDefined ( ) { java.lang.String wsConfig = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) ; return ( ( wsConfig != null ) && ( ! ( "" . equals ( wsConfig ) ) ) ) && ( ! ( "Off" . equalsIgnoreCase ( wsConfig ) ) ) ; }

Target:
public boolean isWebSocketProxyDefined ( ) { java.lang.String wsConfig = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) ; return ( ( wsConfig != null ) && ( ! ( "" . equals ( wsConfig ) ) ) ) && ( ! ( "Off" . equalsIgnoreCase ( wsConfig ) ) ) ; }
Source:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; java.lang.System.out.println ( span ) ; assertEquals ( "hours1" , 10 , span.Hours ) ; assertEquals ( "minutes1" , 10 , span.Minutes ) ; assertEquals ( "seconds1" , 10 , span.Seconds ) ; assertEquals ( "days1" , 0 , span.Days ) ; assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }

Target:
public void testBasicConstructors ( ) { org.ovirt.engine.core.compat.TimeSpan span = new org.ovirt.engine.core.compat.TimeSpan ( 10 , 10 , 10 ) ; assertEquals ( "hours1" , 10 , span.Hours ) ; assertEquals ( "minutes1" , 10 , span.Minutes ) ; assertEquals ( "seconds1" , 10 , span.Seconds ) ; assertEquals ( "days1" , 0 , span.Days ) ; assertEquals ( "miliseconds" , 0 , span.Milliseconds ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateStoragePoolUp ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmImages ) { if ( ( vmImages.isEmpty ( ) ) || ( vm.isAutoStartup ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool ) . isUp ( ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateStoragePoolUp ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.StoragePool storagePool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmImages ) { if ( ( vmImages.isEmpty ( ) ) || ( vm.isAutoStartup ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( storagePool ) . isUp ( ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.DOMAIN , model.getDomain ( ) . getName ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Group model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertNotNull ( model.getDomain ( ) ) ; verifyLinks ( model ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.attachedStorageDomains = storageDomains ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; dataCenterGuideModel.attachedStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM createVmForTesting ( java.lang.String initrd , java.lang.String kernel ) { org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyCommand = createCommand ( ) ; mockVm ( spyCommand ) ; org.ovirt.engine.core.common.action.RunVmParams runVmParams = command.getParameters ( ) ; runVmParams.setinitrd_url ( initrd ) ; runVmParams.setkernel_url ( kernel ) ; spyCommand.CreateVm ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM createVmForTesting ( java.lang.String initrd , java.lang.String kernel ) { mockVm ( command ) ; org.ovirt.engine.core.common.action.RunVmParams runVmParams = command.getParameters ( ) ; runVmParams.setinitrd_url ( initrd ) ; runVmParams.setkernel_url ( kernel ) ; command.CreateVm ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ; return vm ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; result.setSuccess ( false ) ; result.getReasons ( ) . clear ( ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . quotaIsEmptyValidation ( ) ) ; return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; result.setSuccess ( false ) ; result.getReasons ( ) . clear ( ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . quotaIsEmptyValidation ( ) ) ; return result ; }
Source:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct generateOptions ( ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.CONNECTIVITY_CHECK , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) { options.add ( VdsProperties.CONNECTIVITY_TIMEOUT , org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > generateOptions ( ) { java.util.Map < java.lang.String , java.lang.Object > options = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; options.put ( VdsProperties.CONNECTIVITY_CHECK , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) { options.put ( VdsProperties.CONNECTIVITY_TIMEOUT , org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dataCenters.addAll ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExternalNetworkMap ( networkQuery , provider.getId ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > FindAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains i : items ) { if ( ( i.getstorage_domain_shared_status ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > FindAllStorageDomainsBySharedStatus ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > items , org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus status ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain i : items ) { if ( ( i.getstorage_domain_shared_status ( ) ) == status ) { ret.add ( i ) ; } } return ret ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { int appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { int appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
private org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters getFirstParam ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = getParameters ( ) ; if ( ( parameters != null ) && ( ( parameters.size ( ) ) != 0 ) ) { org.ovirt.engine.core.common.action.VdcActionParametersBase param = parameters.get ( 0 ) ; if ( ( param != null ) && ( param instanceof org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters ) ) { return ( ( org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters ) ( param ) ) ; } } return null ; }

Target:
private org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters getFirstParam ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = getParameters ( ) ; if ( ( parameters != null ) && ( ( parameters.size ( ) ) != 0 ) ) { org.ovirt.engine.core.common.action.VdcActionParametersBase param = parameters.get ( 0 ) ; if ( param instanceof org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters ) { return ( ( org.ovirt.engine.core.common.action.RemoveVmFromPoolParameters ) ( param ) ) ; } } return null ; }
Source:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct generateOptions ( ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.connectivityCheck , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) ) ; if ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) >= 0 ) { options.add ( VdsProperties.connectivityTimeout , org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }

Target:
private org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct generateOptions ( ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct options = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; options.add ( VdsProperties.connectivityCheck , java.lang.Boolean.toString ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . isCheckConnectivity ( ) ) { options.add ( VdsProperties.connectivityTimeout , org.ovirt.engine.core.vdsbroker.vdsbroker.SetupNetworksVDSCommand.getParameters ( ) . getConectivityTimeout ( ) ) ; } return options ; }
Source:
public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { final org.ovirt.engine.core.dao.VdsGroupDAO v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setvds_group_id ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; org.mockito.Mockito.when ( v.getFromCache ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }

Target:
public org.ovirt.engine.core.dao.VdsGroupDAO getVdsGroupDAO ( ) { final org.ovirt.engine.core.dao.VdsGroupDAO v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDAO.class ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setvds_group_id ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; setUpGetRngDeviceExpectations ( new int [ ] { 0 } ) ; super . testUpdate ( ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . testUpdate ( ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . spiceSelected ( event.getValue ( ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( event.getValue ( ) ) ) ) ; getView ( ) . rdpSelected ( ( ! ( event.getValue ( ) ) ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { getView ( ) . rdpSelected ( event.getValue ( ) ) ; getView ( ) . spiceSelected ( ( ! ( event.getValue ( ) ) ) ) ; getView ( ) . setWanOptionsVisible ( ( ( wanOptionsAvailable ) && ( ! ( event.getValue ( ) ) ) ) ) ; }
Source:
private void updateExportDomainLoadButtonEnabledState ( ) { final boolean enabled = ( ( getModel ( ) . getExportDomain ( ) ) != null ) && ( getModel ( ) . getDataCenters ( ) . getIsChangable ( ) ) ; getView ( ) . getLoadVmsFromExportDomainButton ( ) . setEnabled ( enabled ) ; }

Target:
private void updateExportDomainLoadButtonEnabledState ( ) { final boolean enabled = ( ( getModel ( ) . getExportDomain ( ) . getEntity ( ) ) != null ) && ( getModel ( ) . getDataCenters ( ) . getIsChangable ( ) ) ; getView ( ) . getLoadVmsFromExportDomainButton ( ) . setEnabled ( enabled ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters ( poolId ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
private void addAddress ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.add ( VdsProperties.Address , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugNicVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }

Target:
private void addAddress ( java.util.Map < java.lang.String , java.lang.Object > map , java.lang.String address ) { if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { map.put ( VdsProperties.Address , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStringUtils.string2Map ( org.ovirt.engine.core.vdsbroker.vdsbroker.HotPlugNicVDSCommand.getParameters ( ) . getVmDevice ( ) . getAddress ( ) ) ) ; } }
Source:
private void logNoProxyAvailable ( org.ovirt.engine.core.compat.Guid dataCenterId ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; java.lang.String dcName = ( dataCenterId == null ) ? "None" : org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( dataCenterId ) . getName ( ) ; logable.addCustomValue ( "StoragePoolName" , dcName ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_NO_PROXY_HOST_AVAILABLE_IN_DC ) ; }

Target:
private void logNoProxyAvailable ( org.ovirt.engine.core.compat.Guid dataCenterId ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; java.lang.String dcName = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( dataCenterId ) . getName ( ) ; logable.addCustomValue ( "StoragePoolName" , dcName ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_NO_PROXY_HOST_AVAILABLE_IN_DC ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result1 ) { getProfile ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( result1 ) ) ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; initSelectedType ( ) ; }

Target:
public void onSuccess ( java.lang.Object result1 ) { getProfile ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( result1 ) ) ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; initSelectedType ( ) ; }
Source:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }

Target:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }
Source:
protected void EndWithFailure ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; if ( ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ExportVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "ExportVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void EndWithFailure ( ) { org.ovirt.engine.core.bll.ExportVmCommand.EndActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) ) . withEveryFeatureSupported ( ) ) ) . build ( vmBase , getModel ( ) ) ; }

Target:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) ) ) ) . build ( vmBase , getModel ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > append ( org.ovirt.engine.ui.uicommonweb.builders.Builder < S , D > builder ) { java.util.List < org.ovirt.engine.ui.uicommonweb.builders.Builder < S , D > > enriched = new org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > ( subList ( 0 , size ( ) ) ) . subList ( 0 , size ( ) ) ; java.util.Collections.addAll ( enriched , builder ) ; return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > ( enriched ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.builders.BuilderList < S , D > append ( org.ovirt.engine.ui.uicommonweb.builders.Builder < S , D > builder ) { java.util.List < org.ovirt.engine.ui.uicommonweb.builders.Builder < S , D > > enriched = new org.ovirt.engine.ui.uicommonweb.builders.BuilderList ( subList ( 0 , size ( ) ) ) . subList ( 0 , size ( ) ) ; java.util.Collections.addAll ( enriched , builder ) ; return new org.ovirt.engine.ui.uicommonweb.builders.BuilderList ( enriched ) ; }
Source:
public void calculateNetworkImplementationDetailsInterfaceQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsInterfaceQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; iface.setQos ( null ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { this . clusterPolicyFirst = true ; super . executeCommand ( command , parameters ) ; this . clusterPolicyFirst = false ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command , java.lang.Object ... parameters ) { if ( ( ( command == ( getEditCommand ( ) ) ) && ( ( parameters.length ) > 0 ) ) && ( java.lang.Boolean.TRUE.equals ( parameters [ 0 ] ) ) ) { super . executeCommand ( command , parameters ) ; } }
Source:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.storage_domains entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getstorage_domain_shared_status ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain deprecatedPopulate ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.api.model.StorageDomain entity ) { if ( StorageDomainSharedStatus.Unattached.equals ( entity.getstorage_domain_shared_status ( ) ) ) { model.setStatus ( org.ovirt.engine.api.common.util.StatusUtils.create ( StorageDomainStatus.UNATTACHED ) ) ; } else { model.setStatus ( null ) ; } return super . deprecatedPopulate ( model , entity ) ; }
Source:
public void testGetWatchDogModels ( ) throws java.lang.Exception { java.util.List < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.Assert.assertTrue ( ( ( watchDogModels.size ( ) ) == 2 ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.Assert.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }

Target:
public void testGetWatchDogModels ( ) throws java.lang.Exception { java.util.List < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.Assert.assertEquals ( 2 , watchDogModels.size ( ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.Assert.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }
Source:
public void setDefaultNames3 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.clusterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; setDefaultNames4 ( ) ; } } , frontendHash ) ) ; }

Target:
public void setDefaultNames3 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.clusterList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; setDefaultNames4 ( ) ; } } , frontendHash ) ) ; }
Source:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public static java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }

Target:
public java.lang.Long determineImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.Image sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain , org.ovirt.engine.core.compat.Guid imageGroupID ) { if ( isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage imageInfoFromStorage = getVolumeInfoFromVdsm ( storagePoolId , srcDomain , imageGroupID , sourceImage.getId ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , imageInfoFromStorage.getActualSizeInBytes ( ) ) ; } return null ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel clusterNetworkListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkListModel ) ( model ) ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > dcNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel networkToManage = createNetworkList ( dcNetworks ) ; clusterNetworkListModel.setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHelpTag ( HelpTag.assign_networks ) ; networkToManage.setHashName ( "assign_networks" ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > dcNetworks ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel networkToManage = createNetworkList ( dcNetworks ) ; setWindow ( networkToManage ) ; networkToManage.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . assignDetachNetworksTitle ( ) ) ; networkToManage.setHelpTag ( HelpTag.assign_networks ) ; networkToManage.setHashName ( "assign_networks" ) ; }
Source:
public void migrationNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
public void updateAll ( java.util.Collection < T > entities ) { updateAll ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , entities ) ; for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }

Target:
public void updateAll ( java.util.Collection < T > entities ) { updateAll ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , entities ) ; }
Source:
public void testExecuteCommandByServerIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( null , org.ovirt.engine.core.compat.Guid.newGuid ( ) , 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 ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 2 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_STARTED ) ; }

Target:
public void testExecuteCommandByServerIdForStart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( null , org.ovirt.engine.core.compat.Guid.newGuid ( ) , 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 ( true , null , GlusterServiceStatus.STOPPED ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 2 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_SERVICE_STARTED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
protected void verifyUpdate ( org.ovirt.engine.api.model.Network model , int index ) { assertTrue ( model.isSetDisplay ( ) ) ; assertEquals ( model.isDisplay ( ) , true ) ; assertTrue ( model.isSetUsages ( ) ) ; assertNotNull ( model.getUsages ( ) . getUsages ( ) ) ; assertTrue ( model.getUsages ( ) . getUsages ( ) . contains ( NetworkUsage.DISPLAY.name ( ) ) ) ; assertTrue ( model.isSetRequired ( ) ) ; assertEquals ( model.isRequired ( ) , true ) ; }

Target:
protected void verifyUpdate ( org.ovirt.engine.api.model.Network model , int index ) { assertTrue ( model.isSetDisplay ( ) ) ; assertEquals ( model.isDisplay ( ) , true ) ; assertTrue ( model.isSetUsages ( ) ) ; assertNotNull ( model.getUsages ( ) . getUsages ( ) ) ; assertTrue ( model.getUsages ( ) . getUsages ( ) . contains ( NetworkUsage.DISPLAY.value ( ) ) ) ; assertTrue ( model.isSetRequired ( ) ) ; assertEquals ( model.isRequired ( ) , true ) ; }