auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testPassword ( ) throws java.lang.Exception { client.setPassword ( TestCommon.password ) ; client.connect ( ) ; client.authenticate ( ) ; java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 500 ) ; client.executeCommand ( org.ovirt.engine.core.utils.ssh.BasicTest.hello_command , null , out , null ) ; assertEquals ( org.ovirt.engine.core.utils.ssh.BasicTest.hello_result , new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ) ; }

Target:
public void testPassword ( ) throws java.lang.Exception { client.setPassword ( TestCommon.password ) ; client.connect ( ) ; client.authenticate ( ) ; java.io.ByteArrayOutputStream out = new org.ovirt.engine.core.utils.ssh.ConstraintByteArrayOutputStream ( 500 ) ; client.executeCommand ( org.ovirt.engine.core.utils.ssh.BasicTest.hello_command , null , out , null ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.ssh.BasicTest.hello_result , new java.lang.String ( out.toByteArray ( ) , "UTF-8" ) ) ; }
Source:
private void verifyIps ( org.ovirt.engine.api.model.Device device ) { java.util.List < org.ovirt.engine.api.model.IP > ips = device.getIps ( ) . getIPs ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }

Target:
private void verifyIps ( org.ovirt.engine.api.model.ReportedDevice device ) { java.util.List < org.ovirt.engine.api.model.IP > ips = device.getIps ( ) . getIPs ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length , ips.size ( ) ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES.length ) ; i ++ ) { assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDevicesResourceTest.ADDRESSES [ i ] , ips.get ( i ) . getAddress ( ) ) ; } }
Source:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , true , true ) ) ; javax.ws.rs.core.Response response = ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . activate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testDeactivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotUnPlugDiskFromVm , org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters.class , new java.lang.String [ ] { "VmId" , "DiskId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , true , true ) ) ; javax.ws.rs.core.Response response = resource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
protected void postGetHost ( java.lang.String hostName ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( "[virt-viewer]" ) ; configBuilder.append ( "\ntype=vnc" ) . append ( "\nhost=" ) . append ( hostName ) . append ( "\nport=" ) . append ( getEntity ( ) . getDisplay ( ) . toString ( ) ) . append ( "\npassword=" ) . append ( otp64 ) . append ( "\ntitle=" ) . append ( getTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
private java.lang.String getOtp64 ( ) { return otp64 ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) ; }

Target:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getPreferredSPMId ( ) ) ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.StorageDomainDynamic domain ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "available_disk_size" , domain.getavailable_disk_size ( ) ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "used_disk_size" , domain.getused_disk_size ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatestorage_domain_dynamic" , parameterSource ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.StorageDomainDynamic domain ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "available_disk_size" , domain.getAvailableDiskSize ( ) ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "used_disk_size" , domain.getUsedDiskSize ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatestorage_domain_dynamic" , parameterSource ) ; }
Source:
public static void getDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > pair , boolean caseSensitive ) { if ( "CREATIONDATE" . equals ( fieldName ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( pair.getSecond ( ) , '\'' ) ) ) ; pair.setSecond ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ) ; } else { super . formatValue ( fieldName , pair , caseSensitive ) ; } }

Target:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > pair , boolean caseSensitive ) { if ( "CREATION_DATE" . equals ( fieldName ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( pair.getSecond ( ) , '\'' ) ) ) ; pair.setSecond ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ) ; } else { super . formatValue ( fieldName , pair , caseSensitive ) ; } }
Source:
public void shouldDetectNonMigratableVMs ( ) { invalidVM.setMigrationSupport ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_NOT_MIGRATABLE ) ) ; }

Target:
public void shouldDetectPassThroughDeviceOnVM ( ) { org.mockito.Mockito.when ( hostDeviceManager.checkVmNeedsDirectPassthrough ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( true ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NEEDS_PASSTHROUGH.name ( ) ) ) ; }
Source:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isIncomingHeartbeat ( ) ) ) && ( this . isIncomingHeartbeatExeeded ( ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . disconnect ( "Heartbeat exeeded" ) ; } }

Target:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isIncomingHeartbeat ( ) ) ) && ( this . isIncomingHeartbeatExeeded ( ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exceeded. Closing channel" ) ; this . disconnect ( "Heartbeat exceeded" ) ; } }
Source:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmTemplateDao ( ) ; existingTemplate = dao.get ( new org.ovirt.engine.core.compat.Guid ( "1b85420c-b84c-4f29-997e-0eb674b40b79" ) ) ; newVmTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; newVmTemplate.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; newVmTemplate.setName ( "NewVmTemplate" ) ; newVmTemplate.setVdsGroupId ( org.ovirt.engine.core.dao.VmTemplateDAOTest.VDS_GROUP_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmTemplateDao ( ) ; existingTemplate = dao.get ( new org.ovirt.engine.core.compat.Guid ( "1b85420c-b84c-4f29-997e-0eb674b40b79" ) ) ; newVmTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; newVmTemplate.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVmTemplate.setName ( "NewVmTemplate" ) ; newVmTemplate.setVdsGroupId ( org.ovirt.engine.core.dao.VmTemplateDAOTest.VDS_GROUP_ID ) ; }
Source:
public void networkBelongsToClusterDataCenterNotValid ( ) { cluster.setStoragePoolId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; network.setDataCenterId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID2 ) ; org.junit.Assert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }

Target:
public void networkBelongsToClusterDataCenterNotValid ( ) { cluster.setStoragePoolId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID1 ) ; network.setDataCenterId ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.TEST_DC_ID2 ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkBelongsToClusterDataCenter ( cluster , network ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.hasItem ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorTestBase.NETWORK_NAME_REPLACEMENT ) ) ) ) ; }
Source:
public void updataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmsInPool ( 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 ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.setMaxVmsInPool ( ( ( java.lang.Integer ) ( returnValue ) ) ) ; behavior.updateMaxNumOfVmCpus ( ) ; } } ) ) ; }

Target:
public void updataMaxVmsInPool ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmsInPool ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { setMaxVmsInPool ( returnValue ) ; updateMaxNumOfVmCpus ( ) ; } } ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.common.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.common.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.common.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getVmId ( ) , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ChangeVMClusterCommand.getParameters ( ) . getClusterId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.ChangeVMClusterCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfileId ( org.ovirt.engine.core.compat.Guid vnicProfileId ) { if ( vnicProfileId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.Network retVal = null ; org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVnicProfileDao ( ) . get ( vnicProfileId ) ; if ( ( vnicProfile.getNetworkId ( ) ) != null ) { retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; } return retVal ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.Network getNetworkByVnicProfile ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile ) { if ( vnicProfile == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.Network retVal = null ; if ( ( vnicProfile.getNetworkId ( ) ) != null ) { retVal = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . get ( vnicProfile.getNetworkId ( ) ) ; } return retVal ; }
Source:
public void testGetWithTrailingSlash ( ) { doTestGet ( ( ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.URI_BASE ) + "/" ) ) ; }

Target:
private void setupExpectations ( org.ovirt.engine.core.common.mode.ApplicationMode appMode , java.lang.String [ ] relationships ) { org.easymock.EasyMock.expect ( current.get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ) . andReturn ( appMode ) . anyTimes ( ) ; resource.setUriInfo ( setUpUriInfo ( ( ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.URI_BASE ) + "/" ) , relationships ) ) ; setUpGetSystemVersionExpectations ( ) ; setUpGetSystemStatisticsExpectations ( ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: remove ) , detail ) ; }
Source:
private void warnIfNotAllDisksPermitSnapshots ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ! ( disk.isAllowSnapshot ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT ) ; break ; } } }

Target:
private void warnIfNotAllDisksPermitSnapshots ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ! ( disk.isAllowSnapshot ( ) ) ) { auditLogDirector.log ( this , AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT ) ; break ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig mapRow ( java.sql.ResultSet rs , int index ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig entity = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "id" ) ) ; entity.setNicId ( getGuidDefaultEmpty ( rs , "nic_id" ) ) ; entity.setAllNetworksAllowed ( rs.getBoolean ( "all_networks_allowed" ) ) ; ( ( org.ovirt.engine.core.dao.network.HostNicVfsConfigDaoDbFacadeImpl ) ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getHostNicVfsConfigDao ( ) ) ) . fillNetworksAndLabelsDataOnConfig ( entity ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig mapRow ( java.sql.ResultSet rs , int index ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig entity = new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( ) ; entity.setId ( getGuid ( rs , "id" ) ) ; entity.setNicId ( getGuid ( rs , "nic_id" ) ) ; entity.setAllNetworksAllowed ( rs.getBoolean ( "is_all_networks_allowed" ) ) ; ( ( org.ovirt.engine.core.dao.network.HostNicVfsConfigDaoDbFacadeImpl ) ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getHostNicVfsConfigDao ( ) ) ) . fillNetworksAndLabelsDataOnConfig ( entity ) ; return entity ; }
Source:
private void resetTabsValidity ( ) { setIsGeneralTabValid ( true ) ; setIsSystemTabValid ( true ) ; setIsFirstRunTabValid ( true ) ; setIsDisplayTabValid ( true ) ; setIsHostTabValid ( true ) ; setIsAllocationTabValid ( true ) ; setIsBootSequenceTabValid ( true ) ; setRngTabValid ( true ) ; setIsCustomPropertiesTabValid ( true ) ; getValid ( ) . setEntity ( true ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( NumaSupportModel.SUBMIT_NUMA_SUPPORT.equals ( command.getName ( ) ) ) { onNumaSupport ( ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = org.ovirt.engine.core.bll.AddUserProfileCommand.getParameters ( ) . getUserProfile ( ) ; profile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; profile.setUserId ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserId ( ) ) ; if ( ( ! ( profile.getSshPublicKey ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( profile.getSshPublicKeyId ( ) ) ) ) { profile.setSshPublicKeyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } userProfileDao.save ( profile ) ; org.ovirt.engine.core.bll.AddUserProfileCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = org.ovirt.engine.core.bll.AddUserProfileCommand.getParameters ( ) . getUserProfile ( ) ; profile.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; profile.setUserId ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserId ( ) ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( profile.getSshPublicKey ( ) ) ) ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( profile.getSshPublicKeyId ( ) ) ) ) { profile.setSshPublicKeyId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } userProfileDao.save ( profile ) ; org.ovirt.engine.core.bll.AddUserProfileCommand.setSucceeded ( true ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.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 { setUpEntityQueryExpectations ( 1 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void addNetworkToPool ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setName ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultManagementNetwork ) ) + "2" ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = new java.util.ArrayList < > ( ) ; networks.add ( network ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StoragePool createHigherVersionStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.createBasicPool ( ) ; pool.setIsLocal ( true ) ; pool.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_2 ) ; return pool ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult ( queryType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( f ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult ( queryType , parameters , null ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.OnFailure ( f ) ; }
Source:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }
Source:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.Assert.assertTrue ( "Update should be valid for different names" , vmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsName ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmTemplateHandler.isUpdateValid ( src , dest ) , "Update should be valid for different names" ) ; }
Source:
public void testCanDoActionNonExistingStorageDomain ( ) { org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testCanDoActionNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDAOMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDAOMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( "canDoAction shouldn't be possible for a non-existent storage domain" , command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVdsGroup , org.ovirt.engine.core.common.action.VdsGroupParametersBase.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testRemoveByName ( ) { dao.removeByName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_NAME ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( 1 , volumes.size ( ) ) ; org.junit.Assert.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.Assert.assertFalse ( volumes.contains ( existingReplVol ) ) ; }

Target:
public void testRemoveByName ( ) { dao.removeByName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_NAME ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getByClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , volumes.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( volumes.contains ( existingDistVol ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( volumes.contains ( existingReplVol ) ) ; }
Source:
public void testDevicePassthroughMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setHostDevicePassthroughEnabled ( true ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; assertNotNull ( host ) ; assertNotNull ( host.getDevicePassthrough ( ) ) ; assertTrue ( host.getDevicePassthrough ( ) . isEnabled ( ) ) ; }

Target:
public void testDevicePassthroughMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setHostDevicePassthroughEnabled ( true ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; org.junit.Assert.assertNotNull ( host ) ; org.junit.Assert.assertNotNull ( host.getDevicePassthrough ( ) ) ; org.junit.Assert.assertTrue ( host.getDevicePassthrough ( ) . isEnabled ( ) ) ; }
Source:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }

Target:
public void removeAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces = java.util.Arrays.asList ( org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.createNewInterface ( ) ) ; org.mockito.Mockito.when ( vmNicDao.getAllForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( interfaces ) ; vmInterfaceManager.removeAll ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { verifyRemoveAllDelegatedCorrectly ( iface ) ; } }
Source:
public void testAddIncompleteParameters_2 ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Disk" , "add" , "provisionedSize|size" ) ; } }

Target:
public void testAddLunDisk_MissingType ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . setType ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Storage" , "validateDiskForCreation" , "type" ) ; } }
Source:
private void testIsManagementNetworkInGivenClusterCommon ( boolean expectedResult ) { org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkCluster ) ; org.mockito.Mockito.when ( mockNetworkCluster.isManagement ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.Assert.assertEquals ( expectedResult , actual ) ; }

Target:
private void testIsManagementNetworkInGivenClusterCommon ( boolean expectedResult ) { org.mockito.Mockito.when ( mockNetworkClusterDao.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_CLUSTER_ID ) ) . thenReturn ( mockNetworkCluster ) ; org.mockito.Mockito.when ( mockNetworkCluster.isManagement ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedResult , actual ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > externalVms = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . < java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.vms.ExternalVm ( vm ) ) ; } this . externalVms.setItems ( externalVms ) ; stopProgress ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void isUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }
Source:
public static void getDomainListViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( ) ; expectGetConnections ( ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; checkReturnValue ( ) ; }

Target:
private void commonTestFlow ( boolean withDummyLun ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getVgId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VG_ID ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VDS_ID ) ; expectGetLunsForVg ( org.ovirt.engine.core.bll.storage.disk.lun.GetLunsByVgIdQueryTest.VG_ID , withDummyLun ) ; expectGetDeviceList ( ) ; expectGetLunsMap ( ) ; expectGetConnections ( ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeQueryCommand ( ) ; checkReturnValue ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.EntityChangedEventDefinition ) ) { OnEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.Definition ) ) { EntityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.matchesDefinition ( org.ovirt.engine.ui.uicommonweb.models.EntityModel.EntityChangedEventDefinition ) ) { onEntityChanged ( ) ; } else if ( ev.matchesDefinition ( ProvidePropertyChangedEvent.Definition ) ) { entityPropertyChanged ( sender , ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ) ; } }