auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( command ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( null ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; }

Target:
public void validateFailedVMHasNotDisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup findDirectoryGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.Collection < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.bll.aaa.DirectoryUtils.findDirectoryGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( ( groups.size ( ) ) == 0 ) { return null ; } return new java.util.ArrayList < org.ovirt.engine.core.aaa.DirectoryGroup > ( groups ) . get ( 0 ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup findDirectoryGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.Collection < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.bll.aaa.DirectoryUtils.findDirectoryGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( ( groups.size ( ) ) == 0 ) { return null ; } return new java.util.ArrayList ( groups ) . get ( 0 ) ; }
Source:
public void testNoAffinityGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( host1 , host2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.Integer > scores = collectScores ( policyUnit.score ( cluster , hosts , newVm , null ) ) ; org.junit.Assert.assertEquals ( ( ( java.lang.Integer ) ( 1 ) ) , scores.get ( host1.getId ( ) ) ) ; org.junit.Assert.assertEquals ( ( ( java.lang.Integer ) ( 1 ) ) , scores.get ( host2.getId ( ) ) ) ; }

Target:
public void testNoAffinityGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = java.util.Arrays.asList ( host1 , host2 ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.Integer > scores = collectScores ( policyUnit.score ( cluster , hosts , newVm , null ) ) ; org.junit.Assert.assertEquals ( scores.get ( host1.getId ( ) ) , scores.get ( host2.getId ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult runDiscover ( ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.DISCOVER , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.EMPTY ) ; return parseDiscoverResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( ( "Could not communicate with the external scheduler while discovering" + e ) ) ; return null ; } }

Target:
public org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryResult runDiscover ( ) { try { org.apache.xmlrpc.client.XmlRpcClient client = new org.apache.xmlrpc.client.XmlRpcClient ( ) ; client.setConfig ( config ) ; java.lang.Object result = client.execute ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.DISCOVER , org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.EMPTY ) ; return parseDiscoverResults ( result ) ; } catch ( org.apache.xmlrpc.XmlRpcException e ) { org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerBrokerImpl.log.error ( "Could not communicate with the external scheduler while discovering" , e ) ; return null ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVlanSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.Network network ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createVlan ( nicName , network.getvlan_id ( ) , network.getName ( ) ) ; nic.setBridged ( network.isVmNetwork ( ) ) ; nic.setMtu ( network.getMtu ( ) ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlanSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVlan ( nicName , network.getvlan_id ( ) , network.getName ( ) ) ; nic.setBridged ( network.isVmNetwork ( ) ) ; nic.setMtu ( network.getMtu ( ) ) ; return nic ; }
Source:
public void testAttachFailDomainAlreadyInPool ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }

Target:
public void testAttachFailDomainAlreadyInPool ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ; behavior.UpdateCommandsAccordingToPoolType ( isManualPool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.VmItemBehavior ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmPool pool = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( returnValue ) ) ; boolean isManualPool = ( pool.getVmPoolType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmPoolType.Manual ) ; behavior.UpdateCommandsAccordingToPoolType ( isManualPool ) ; }
Source:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( new org.ovirt.engine.core.compat.Guid ( "99408929-82cf-4dc7-a532-9d998063fa95" ) ) ; org.junit.Assert.assertEquals ( result.size ( ) , 1 ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) . getId ( ) , new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ) ; }

Target:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( new org.ovirt.engine.core.compat.Guid ( "99408929-82cf-4dc7-a532-9d998063fa95" ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) . getId ( ) , new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ) ; }
Source:
public static java.lang.String removeBrackets ( java.lang.String txt ) { if ( ( ( txt != null ) & ( txt.startsWith ( "[" ) ) ) && ( txt.endsWith ( "]" ) ) ) { return txt.substring ( 1 , ( ( txt.length ( ) ) - 2 ) ) ; } return txt ; }

Target:
public static java.lang.String removeBrackets ( java.lang.String txt ) { if ( ( ( ( txt != null ) && ( ( txt.length ( ) ) >= 1 ) ) && ( txt.startsWith ( "[" ) ) ) && ( txt.endsWith ( "]" ) ) ) { return txt.substring ( 1 , ( ( txt.length ( ) ) - 2 ) ) ; } return txt ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; control.replay ( ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpEntityQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , new java.lang.RuntimeException ( FAILURE ) ) ; } finally { locales.clear ( ) ; } }
Source:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , success ) ; }

Target:
public void reportCompleted ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmOnceCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; boolean success = ( org.ovirt.engine.core.bll.RunVmOnceCommand.getParameters ( ) . getRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmOnceCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , success ) ; }
Source:
private void refreshTooltip ( ) { if ( ( ! ( isAttached ( ) ) ) || ( ! ( isVisible ( ) ) ) ) { return ; } if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectHorizontalOverflow ( label.getElement ( ) ) ) { tooltip.setText ( getText ( ) ) ; } else { tooltip.setText ( null ) ; } tooltip.reconfigure ( ) ; }

Target:
private void refreshTooltip ( ) { if ( ( ! ( isAttached ( ) ) ) || ( ! ( isVisible ( ) ) ) ) { return ; } if ( org.ovirt.engine.ui.common.utils.ElementUtils.detectHorizontalOverflow ( label.getElement ( ) ) ) { tooltip.setText ( getText ( ) ) ; } else { tooltip.setText ( null ) ; } }
Source:
public void getForExistingVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus expected = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; expected.setVdsId ( FixturesTool.HOST_ID ) ; expected.setStatus ( KdumpFlowStatus.DUMPING ) ; expected.setAddress ( "[\"192.168.122.18\", 2222]" ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dbFacade.getVdsKdumpStatusDao ( ) . get ( expected.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( expected , found ) ; }

Target:
public void getForExistingVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus expected = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; expected.setVdsId ( FixturesTool.HOST_ID ) ; expected.setStatus ( KdumpFlowStatus.DUMPING ) ; expected.setAddress ( "[\"192.168.122.18\", 2222]" ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( expected.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( expected , found ) ; }
Source:
public void testGetCdInterface ( ) throws java.lang.Exception { org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , null ) . equals ( "ide" ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.I440FX ) . equals ( "ide" ) ) ; org.junit.Assert.assertTrue ( OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.Q35 ) . equals ( "sata" ) ) ; }

Target:
public void testGetCdInterface ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "ide" , OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , null ) ) ; org.junit.Assert.assertEquals ( "ide" , OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.I440FX ) ) ; org.junit.Assert.assertEquals ( "sata" , OsRepositoryImpl.INSTANCE.getCdInterface ( 777 , null , ChipsetType.Q35 ) ) ; }
Source:
private void mockDependencies ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( glusterUtils ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( "test-vol" ) . when ( getQuery ( ) ) . getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getBrick ( ) ) . when ( brickDao ) . getById ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
private void mockDependencies ( ) { org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( glusterUtils ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( "test-vol" ) . when ( getQuery ( ) ) . getGlusterVolumeName ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.VOLUME_ID ) ; org.mockito.Mockito.doReturn ( getBrick ( ) ) . when ( brickDao ) . getById ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; labelsWidget.edit ( object.getLabelsModel ( ) ) ; bondSuggestEditor.setVisible ( true ) ; bondEditor.setVisible ( false ) ; labelsWidget.setVisible ( true ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; layoutPanel.setWidgetSize ( mainPanel , 300 ) ; asPopupPanel ( ) . setPixelSize ( 400 , 400 ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; labelsWidget.edit ( object.getLabelsModel ( ) ) ; bondSuggestEditor.setVisible ( true ) ; bondEditor.setVisible ( false ) ; labelsWidget.setVisible ( true ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; asPopupPanel ( ) . setPixelSize ( 400 , 400 ) ; }
Source:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; if ( ( taskType.equals ( AsyncTaskType.notSupported ) ) || ( cmdEntity.isCallBackEnabled ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } } }

Target:
public void updateCommandStatus ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.CommandStatus status ) { final org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = get ( commandId ) ; if ( cmdEntity != null ) { cmdEntity.setCommandStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; } }
Source:
public static 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.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > setMockForTesting ( java.util.Map < java.lang.String , java.lang.Object > diskData ) { java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > disksData = new java.util.HashMap < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ( ) ; disksData.put ( "vda" , diskData ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksInXmlRpc ( disksData ) ; mockDiskImageDao ( ) ; return xml ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > setMockForTesting ( java.util.Map < java.lang.String , java.lang.Object > diskData ) { java.util.Map < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > disksData = new java.util.HashMap < java.lang.String , java.util.Map < java.lang.String , java.lang.Object > > ( ) ; disksData.put ( "vda" , diskData ) ; return org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksInXmlRpc ( disksData ) ; }
Source:
private void setUpGetEntityExpectationsAllContent ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound ) ; java.util.List < java.lang.String > populateValue = new java.util.ArrayList < > ( ) ; populateValue.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( AbstractBackendResource.POPULATE ) ) . andReturn ( populateValue ) . anyTimes ( ) ; setupParentPopulateExpectations ( notFound ) ; }

Target:
private void setUpGetEntityExpectationsAllContent ( int times , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( times , notFound ) ; java.util.List < java.lang.String > populateValue = new java.util.ArrayList < > ( ) ; populateValue.add ( "true" ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( AbstractBackendResource.POPULATE ) ) . andReturn ( populateValue ) . anyTimes ( ) ; setupParentPopulateExpectations ( ) ; }
Source:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.< java.lang.Object > getValue ( org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configValue.toString ( ) ) , version ) ; configValuesMap.put ( key , value ) ; }

Target:
private void populateValueForConfigValue ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue , java.lang.String version , java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap ) { org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > key = new org.ovirt.engine.core.compat.KeyValuePairCompat ( configValue , version ) ; java.lang.Object value = org.ovirt.engine.core.common.config.Config.< java.lang.Object > getValue ( org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configValue.toString ( ) ) , version ) ; configValuesMap.put ( key , value ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setName ( "testTemplate" ) ; final org.ovirt.engine.core.common.action.ImportVmTemplateParameters p = new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , t ) ; return p ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmTemplateParameters createParameters ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate t = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; t.setName ( "testTemplate" ) ; return new org.ovirt.engine.core.common.action.ImportVmTemplateParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , t ) ; }
Source:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.storage_domains selectedItem ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageGeneralView.Driver.driver.edit ( getDetailModel ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_domains entity = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getDetailModel ( ) . getEntity ( ) ) ) ; if ( entity == null ) return ; totalSize.setValue ( entity.getTotalDiskSize ( ) ) ; availableSize.setValue ( entity.getavailable_disk_size ( ) ) ; usedSize.setValue ( entity.getused_disk_size ( ) ) ; overAllocationRatio.setValue ( entity.getstorage_domain_over_commit_percent ( ) ) ; formBuilder.showForm ( getDetailModel ( ) ) ; }

Target:
public void setMainTabSelectedItem ( org.ovirt.engine.core.common.businessentities.StorageDomain selectedItem ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.storage.SubTabStorageGeneralView.Driver.driver.edit ( getDetailModel ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain entity = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getDetailModel ( ) . getEntity ( ) ) ) ; if ( entity == null ) return ; totalSize.setValue ( entity.getTotalDiskSize ( ) ) ; availableSize.setValue ( entity.getavailable_disk_size ( ) ) ; usedSize.setValue ( entity.getused_disk_size ( ) ) ; overAllocationRatio.setValue ( entity.getstorage_domain_over_commit_percent ( ) ) ; formBuilder.showForm ( getDetailModel ( ) ) ; }
Source:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource map ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity entity ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource paramValue = new org.springframework.jdbc.core.namedparam.MapSqlParameterSource ( ) . addValue ( "snapshot_id" , entity.getId ( ) ) . addValue ( "snapshot_name" , entity.getSnapshotName ( ) ) . addValue ( "volume_id" , entity.getVolumeId ( ) ) . addValue ( "description" , entity.getDescription ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( entity.getStatus ( ) ) ) . addValue ( "_create_date" , entity.getCreatedAt ( ) ) ; return paramValue ; }

Target:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource map ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity entity ) { return new org.springframework.jdbc.core.namedparam.MapSqlParameterSource ( ) . addValue ( "snapshot_id" , entity.getId ( ) ) . addValue ( "snapshot_name" , entity.getSnapshotName ( ) ) . addValue ( "volume_id" , entity.getVolumeId ( ) ) . addValue ( "description" , entity.getDescription ( ) ) . addValue ( "status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( entity.getStatus ( ) ) ) . addValue ( "_create_date" , entity.getCreatedAt ( ) ) ; }
Source:
protected void setUpGetEntityExpectations ( boolean filter , boolean getCertInfo ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" , "Filtered" } , new java.lang.Object [ ] { GUIDS [ 0 ] , filter } , getEntity ( 0 ) ) ; if ( getCertInfo ) { setUpGetCertificateInfo ( ) ; } }

Target:
protected void setUpGetEntityExpectations ( boolean filter , boolean getCertInfo ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" , "Filtered" } , new java.lang.Object [ ] { GUIDS [ 0 ] , filter } , getEntity ( 0 ) ) ; }
Source:
public void testValidateStoragePoolStoragePoolNotUp ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertFalse ( command.validateStoragePool ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; }

Target:
public void testValidateStoragePoolStoragePoolNotUp ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; }
Source:
public void encodeWhenDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; java.lang.String diskDescription = org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateRandomString ( 170 ) ; disk.setDiskDescription ( diskDescription ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( "DiskAlias" ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( diskDescription.substring ( 0 , 164 ) ) ) ; }

Target:
public void encodeWhenDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; java.lang.String diskDescription = org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateRandomString ( 170 ) ; disk.setDiskDescription ( diskDescription ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( "DiskAlias" ) , generateDiskDescriptionJsonEntry ( diskDescription.substring ( 0 , 164 ) ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; validateEnums ( org.ovirt.engine.api.model.Event.class , event ) ; return performCreate ( VdcActionType.AddExternalEvent , new org.ovirt.engine.core.common.action.AddExternalEventParameters ( map ( event ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; validateEnums ( org.ovirt.engine.api.model.Event.class , event ) ; return performCreate ( VdcActionType.AddExternalEvent , getParameters ( event ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; labelsWidget.edit ( object.getLabelsModel ( ) ) ; bondSuggestEditor.setVisible ( true ) ; bondEditor.setVisible ( false ) ; labelsWidget.setVisible ( true ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; layoutPanel.getElement ( ) . getStyle ( ) . setOverflow ( Overflow.HIDDEN ) ; asPopupPanel ( ) . setPixelSize ( 400 , 275 ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel object ) { super . edit ( object ) ; bondSuggestEditor.setVisible ( true ) ; bondEditor.setVisible ( false ) ; info.setVisible ( false ) ; message.setVisible ( false ) ; layoutPanel.remove ( infoPanel ) ; layoutPanel.getElement ( ) . getStyle ( ) . setOverflow ( Overflow.HIDDEN ) ; asPopupPanel ( ) . setPixelSize ( 400 , 275 ) ; }
Source:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = dbFacade.getNetworkDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID ) ; org.junit.Assert.assertNotNull ( network ) ; java.lang.String name = network.getName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.NETWORK_ID , VdcObjectType.Network ) ) ) ; }
Source:
public void testNonExistingQuota ( ) { prepareVmToPassValidate ( ) ; vmStatic.setQuotaId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( quotaDao.getById ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.junit.Assert.assertFalse ( command.validateQuota ( vmStatic.getQuotaId ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }

Target:
public void testNonExistingQuota ( ) { prepareVmToPassValidate ( ) ; vmStatic.setQuotaId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.junit.Assert.assertFalse ( command.validateQuota ( vmStatic.getQuotaId ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }
Source:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.monitoring.VmsListFetcher fetcher = new org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher ( vdsManager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( ) . perform ( fetcher.getChangedVms ( ) , fetchTime , vdsManager , true ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.monitoring.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }

Target:
public void poll ( ) { if ( isMonitoringNeeded ( vdsManager.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.monitoring.VmsListFetcher fetcher = new org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher ( vdsManager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( ) . perform ( fetcher.getChangedVms ( ) , fetchTime , vdsManager , true ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.monitoring.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }
Source:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . setSsoToken ( user.getEngineSessionId ( ) ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . init ( ) ; org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . getReportsInitEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { commonModelProvider.get ( ) . updateReportsAvailability ( ) ; } } ) ; performLogin ( loginModel ) ; }

Target:
protected void onLogin ( final org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel ) { performLogin ( loginModel ) ; }
Source:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public int compare ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel x , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel y ) { java.lang.String xAlias = ( ( x.getDisk ( ) ) != null ) ? x.getDisk ( ) . getDiskAlias ( ) : "" ; java.lang.String yAlias = ( ( y.getDisk ( ) ) != null ) ? y.getDisk ( ) . getDiskAlias ( ) : "" ; if ( xAlias == null ) { return 1 ; } if ( yAlias == null ) { return - 1 ; } return xAlias.compareTo ( yAlias ) ; }

Target:
public int compare ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel x , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel y ) { return x.getDisk ( ) . getDiskAlias ( ) . compareTo ( y.getDisk ( ) . getDiskAlias ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connectionDetails.setid ( id.toString ( ) ) ; connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections populateBasicConnectionDetails ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connectionDetails.setId ( id.toString ( ) ) ; connectionDetails.setconnection ( connection ) ; connectionDetails.setstorage_type ( type ) ; return connectionDetails ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { final org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( result ) ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( dataCenter ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( dataCenter ) ; }
Source:
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.ui.uicommonweb.models.hosts.HostInterfaceListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel ) ( sender ) ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > interfaceLineModels = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( model.getItems ( ) ) ) ; showModels ( interfaceLineModels ) ; }

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.ui.uicommonweb.models.hosts.HostInterfaceListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel ) ( sender ) ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > interfaceLineModels = ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( model.getItems ( ) ) ) ; showModels ( interfaceLineModels , vds ) ; }
Source:
private void updateCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; cmdEntity.setReturnValue ( result ) ; if ( ! ( result.getCanDoAction ( ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.FAILED ) ; } else if ( CommandStatus.ACTIVE_SYNC.equals ( cmdEntity.getCommandStatus ( ) ) ) { cmdEntity.setCommandStatus ( ( result.getSucceeded ( ) ? org.ovirt.engine.core.compat.CommandStatus.SUCCEEDED : org.ovirt.engine.core.compat.CommandStatus.FAILED ) ) ; } coco.persistCommand ( cmdEntity ) ; }

Target:
private void updateCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; cmdEntity.setReturnValue ( result ) ; if ( ! ( result.getCanDoAction ( ) ) ) { cmdEntity.setCommandStatus ( CommandStatus.FAILED ) ; } coco.persistCommand ( cmdEntity ) ; }
Source:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity , javax.ws.rs.core.UriInfo ui ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( ui , statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }

Target:
private void addStatistics ( org.ovirt.engine.api.model.Vm model , org.ovirt.engine.api.restapi.resource.VM entity ) { model.setStatistics ( new org.ovirt.engine.api.model.Statistics ( ) ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( newModel ( model.getId ( ) ) ) ; java.util.List < org.ovirt.engine.api.model.Statistic > statistics = query.getStatistics ( entity ) ; for ( org.ovirt.engine.api.model.Statistic statistic : statistics ) { org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( statistic , query.getParentType ( ) ) ; } model.getStatistics ( ) . getStatistics ( ) . addAll ( statistics ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyVmCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; org.powermock.api.mockito.PowerMockito.mockStatic ( org.ovirt.engine.core.bll.QuotaManager.class ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > spyVmCommand ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( spyVmCommand , vmDAO ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( vmDao , org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDao ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notRemovingManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( vmDao , org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDao ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notRemovingManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getPinnedHost ( ) . setItems ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VDS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; stopProgress ( ) ; selectCurrentPinnedHost ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { getPinnedHost ( ) . setItems ( hosts ) ; stopProgress ( ) ; selectCurrentPinnedHost ( ) ; }
Source:
protected void updateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { getIsWipeAfterDelete ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.CONSTANTS.wipeAfterDeleteNotSupportedForFileDomains ( ) ) ; getIsWipeAfterDelete ( ) . setIsChangable ( false ) ; getIsWipeAfterDelete ( ) . setEntity ( false ) ; } else { getIsWipeAfterDelete ( ) . setIsChangable ( true ) ; getIsWipeAfterDelete ( ) . setEntity ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SANWipeAfterDelete ) ) ) ) ; } }

Target:
protected void updateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.StorageType storageType ) { if ( storageType.isFileDomain ( ) ) { getIsWipeAfterDelete ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.CONSTANTS.wipeAfterDeleteNotSupportedForFileDomains ( ) ) ; getIsWipeAfterDelete ( ) . setIsChangable ( false ) ; getIsWipeAfterDelete ( ) . setEntity ( false ) ; } else { getIsWipeAfterDelete ( ) . setIsChangable ( true ) ; getIsWipeAfterDelete ( ) . setEntity ( ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.SANWipeAfterDelete ) ) ) ) ; } }