auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = dao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; existingNfsAutoConnection = dao.get ( FixturesTool.EXISTING_STORAGE_CONNECTION_NFS_AUTO_ID.toString ( ) ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionDaoTest.EXISTING_DOMAIN_STORAGE_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStorageServerConnectionDao ( ) ; existingConnection = dao.get ( "0cc146e8-e5ed-482c-8814-270bc48c297f" ) ; existingNfsAutoConnection = dao.get ( FixturesTool.EXISTING_STORAGE_CONNECTION_NFS_AUTO_ID.toString ( ) ) ; newServerConnection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newServerConnection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c2980" ) ; newServerConnection.setconnection ( org.ovirt.engine.core.dao.StorageServerConnectionDaoTest.EXISTING_DOMAIN_STORAGE_NAME ) ; }
Source:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) ) . withEveryFeatureSupported ( ) ) ) . build ( vmBase , getModel ( ) ) ; }

Target:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { new org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor ( callback , new org.ovirt.engine.ui.uicommonweb.builders.vm.NameAndDescriptionVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommentVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) . withEveryFeatureSupported ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CoreVmBaseToUnitBuilder ( new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToUnitBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.SerialNumberPolicyVmBaseToUnitBuilder ( ) ) . withEveryFeatureSupported ( ) ) ) . build ( vmBase , getModel ( ) ) ; }
Source:
public void setEntity ( java.lang.Object value ) { cluster = null ; super . setEntity ( value ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; updateActionAvailability ( ) ; } } ) , ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) . getVdsGroupId ( ) ) ; } }

Target:
public void setEntity ( java.lang.Object value ) { cluster = null ; super . setEntity ( value ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; updateActionAvailability ( ) ; } } ) , ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getEntity ( ) ) ) . getVdsGroupId ( ) ) ; } }
Source:
private void perform ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . setStartTime ( new java.util.Date ( ) ) ; boolean migrateSucceeded = ( connectLunDisks ( getDestinationVdsId ( ) ) ) && ( migrateVm ( ) ) ; if ( ! migrateSucceeded ) { org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . setMigreatingToPort ( 0 ) ; org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . setMigreatingFromPort ( 0 ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.RESOURCE_MANAGER_MIGRATION_FAILED_AT_DST ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.MigrateVmCommand.getExecutionContext ( ) , true ) ; }

Target:
private void perform ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . setStartTime ( new java.util.Date ( ) ) ; boolean migrateSucceeded = ( connectLunDisks ( getDestinationVdsId ( ) ) ) && ( migrateVm ( ) ) ; if ( ! migrateSucceeded ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.RESOURCE_MANAGER_MIGRATION_FAILED_AT_DST ) ; } org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.MigrateVmCommand.getExecutionContext ( ) , true ) ; }
Source:
public boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ) { java.lang.String networkName = iface.getNetworkName ( ) ; return ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ; }

Target:
public boolean isValidVmNetwork ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ) { java.lang.String networkName = iface.getNetworkName ( ) ; return ( networkName == null ) || ( ( networksByName.containsKey ( networkName ) ) && ( networksByName.get ( networkName ) . isVmNetwork ( ) ) ) ; }
Source:
public void testSave ( ) { newVmStatistics.setId ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; newVmStatistics.setMigrationProgressPercent ( 0 ) ; newVmStatistics.setMemoryUsageHistory ( java.util.Arrays.asList ( 2 , 3 , 4 ) ) ; newVmStatistics.setCpuUsageHistory ( java.util.Arrays.asList ( 5 , 6 , 7 ) ) ; newVmStatistics.setNetworkUsageHistory ( java.util.Collections.emptyList ( ) ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }

Target:
public void testSave ( ) { newVmStatistics.setId ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; newVmStatistics.setMigrationProgressPercent ( 0 ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }
Source:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return false ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; if ( ! ( supportedStorageFormats.contains ( storageFormat ) ) ) { return false ; } return true ; }

Target:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return true ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; if ( ! ( supportedStorageFormats.contains ( storageFormat ) ) ) { return false ; } return true ; }
Source:
public void create10GBVmWith11GbAvailableAndA5GbBuffer ( ) throws java.lang.Exception { mockStorageDomainDaoGetForStoragePool ( ) ; mockMaxPciSlots ( ) ; mockStorageDomainDaoGetAllForStoragePool ( ) ; mockUninterestingMethods ( ) ; mockGetAllSnapshots ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void create10GBVmWith11GbAvailableAndA5GbBuffer ( ) throws java.lang.Exception { mockMaxPciSlots ( ) ; mockStorageDomainDaoGetAllForStoragePool ( ) ; mockUninterestingMethods ( ) ; mockGetAllSnapshots ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createDefaultCluster ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volume ) . when ( volumeDao ) . getById ( masterVolumeId ) ; org.mockito.Mockito.doReturn ( GlusterStatus.UP ) . when ( volume ) . getStatus ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( command ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( VDSStatus.Up ) . when ( vds ) . getStatus ( ) ; org.mockito.Mockito.doReturn ( glusterUtil ) . when ( command ) . getGlusterUtil ( ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volume ) . when ( volumeDao ) . getById ( masterVolumeId ) ; org.mockito.Mockito.doReturn ( GlusterStatus.UP ) . when ( volume ) . getStatus ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( command ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( VDSStatus.Up ) . when ( vds ) . getStatus ( ) ; }
Source:
protected void executeQueryCommand ( ) { if ( ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) != null ) { org.ovirt.engine.core.bll.GetVmsInitQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.VmHandler.getVmInitByIds ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) ) ; } }

Target:
protected void executeQueryCommand ( ) { if ( ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) ) != null ) { org.ovirt.engine.core.bll.GetVmsInitQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.VmHandler.getVmInitByIds ( org.ovirt.engine.core.bll.GetVmsInitQuery.getParameters ( ) . getIds ( ) , true ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.MoveOrCopyDiskModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; model.setDataCenter ( dataCenter ) ; model.setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; model.postInitStorageDomains ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { setDataCenter ( dataCenter ) ; setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; postInitStorageDomains ( ) ; }
Source:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "C" ) ) ; org.junit.Assert.assertTrue ( "cluster" , comps.contains ( "Cluster" ) ) ; org.junit.Assert.assertTrue ( ( ( comp.getCompletion ( "Z" ) . length ) == 0 ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "C" ) ) ; org.junit.Assert.assertTrue ( "cluster" , comps.contains ( "Cluster" ) ) ; org.junit.Assert.assertEquals ( 0 , comp.getCompletion ( "Z" ) . length ) ; }
Source:
protected void buildVmBootOptions ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getInitrdUrl ( ) ) ) ) { createInfo.add ( VdsProperties.InitrdUrl , vm.getInitrdUrl ( ) ) ; } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getKernelUrl ( ) ) ) ) { createInfo.add ( VdsProperties.KernelUrl , vm.getKernelUrl ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getKernelParams ( ) ) ) ) { createInfo.add ( VdsProperties.KernelParams , vm.getKernelParams ( ) ) ; } } }

Target:
protected void buildVmBootOptions ( ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getInitrdUrl ( ) ) ) ) { createInfo.put ( VdsProperties.InitrdUrl , vm.getInitrdUrl ( ) ) ; } if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getKernelUrl ( ) ) ) ) { createInfo.put ( VdsProperties.KernelUrl , vm.getKernelUrl ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getKernelParams ( ) ) ) ) { createInfo.put ( VdsProperties.KernelParams , vm.getKernelParams ( ) ) ; } } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForDataCenter ( org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.GetNetworksByStoragePoolIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
private com.google.gwt.user.client.ui.IsWidget createGeneralAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ADDITIONAL_INFO_ITEM ) ; generalExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmInterfaceListGroupItem.constants.generalLabel ( ) , IconType.EYE.getCssName ( ) ) ; getClickHandlerRegistrations ( ) . add ( generalExpand.addClickHandler ( this ) ) ; panel.add ( generalExpand ) ; return panel ; }

Target:
private com.google.gwt.user.client.ui.IsWidget createGeneralAdditionalInfo ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ADDITIONAL_INFO_ITEM ) ; generalExpand = new org.ovirt.engine.ui.common.widget.listgroup.ExpandableListViewItem ( org.ovirt.engine.ui.common.widget.uicommon.vm.VmInterfaceListGroupItem.constants.generalLabel ( ) ) ; getClickHandlerRegistrations ( ) . add ( generalExpand.addClickHandler ( this ) ) ; panel.add ( generalExpand ) ; return panel ; }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = setVmDiskImagesList ( ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ) . thenReturn ( dbFacade ) ; org.powermock.api.mockito.PowerMockito.when ( dbFacade.getDiskDao ( ) ) . thenReturn ( diskDao ) ; org.powermock.api.mockito.PowerMockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = setVmDiskImagesList ( ) ; org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ) . thenReturn ( dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getDiskDao ( ) ) . thenReturn ( diskDao ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
public void doTestBadAddFromConfigurationMissingParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; model.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "initialization.configuration.type" , "initialization.configuration.data" ) ; } }

Target:
public void doTestBadAddFromConfigurationMissingParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = createModel ( null ) ; model.setInitialization ( new org.ovirt.engine.api.model.Initialization ( ) ) ; model.getInitialization ( ) . setConfiguration ( new org.ovirt.engine.api.model.Configuration ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "add" , "initialization.configuration.type" , "initialization.configuration.data" ) ; } }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStartFailed ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStartFailed ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public static void init ( final com.google.gwt.event.shared.EventBus eventBus ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = org.ovirt.engine.ui.uicommonweb.models.CommonModel.newInstance ( ) ; org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.common.uicommon.model.MainModelSelectionChangeEvent.fire ( eventBus , org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItem ( ) ) ; } } ) ; }

Target:
public static void init ( final com.google.gwt.event.shared.EventBus eventBus ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = org.ovirt.engine.ui.uicommonweb.models.CommonModel.newInstance ( eventBus ) ; org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.common.uicommon.model.MainModelSelectionChangeEvent.fire ( eventBus , org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItem ( ) ) ; } } ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomainId ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImageList = new java.util.ArrayList < > ( ) ; diskImageList.add ( disk ) ; return diskImageList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > createDiskImageList ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setImageId ( diskImageId ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageDomainId ) ) ) ; return java.util.Collections.singletonList ( disk ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM vm = resource.get ( ) ; assertTrue ( vm.isSetStatistics ( ) ) ; verifyModel ( vm , 0 ) ; } finally { accepts.clear ( ) ; } }
Source:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.Network net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setname ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setdescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setstorage_pool_id ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; getNetworkDAO ( ) . save ( net ) ; }

Target:
private void addDefaultNetworks ( ) { org.ovirt.engine.core.common.businessentities.Network net = new org.ovirt.engine.core.common.businessentities.Network ( ) ; net.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; net.setname ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.ManagementNetwork ) ) ; net.setdescription ( AddVdsGroupCommand.DefaultNetworkDescription ) ; net.setstorage_pool_id ( org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getStoragePool ( ) . getId ( ) ) ; net.setVmNetwork ( true ) ; org.ovirt.engine.core.bll.storage.AddEmptyStoragePoolCommand.getNetworkDAO ( ) . save ( net ) ; }
Source:
public void setUsePatternFly ( boolean use ) { keyField.setUsePatternFly ( use ) ; valueField.setUsePatternFly ( use ) ; valuesField.setUsePatternFly ( use ) ; if ( use ) { keyField.getElement ( ) . getStyle ( ) . setPaddingRight ( 5 , Unit.PX ) ; valueField.getElement ( ) . getStyle ( ) . setPaddingRight ( 5 , Unit.PX ) ; valuesField.getElement ( ) . getStyle ( ) . setPaddingRight ( 5 , Unit.PX ) ; } }

Target:
public void setUsePatternFly ( boolean use ) { keyField.setUsePatternFly ( use ) ; valueField.setUsePatternFly ( use ) ; valuesField.setUsePatternFly ( use ) ; }
Source:
public void postOnSetupNetworks ( ) { org.ovirt.engine.ui.uicommonweb.action.SimpleAction closeAction = getCloseAction ( ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters hostSetupNetworksParameters = createHostSetupNetworksParameters ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction setupNetworksAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.HostSetupNetworks , hostSetupNetworksParameters , this , true ) ; setupNetworksAction.then ( getVfsConfigAction ( ) ) . then ( getCommitNetworkChangesAction ( ) ) . onAllExecutionsFinish ( closeAction ) ; setupNetworksAction.runAction ( ) ; }

Target:
public void postOnSetupNetworks ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters hostSetupNetworksParameters = createHostSetupNetworksParameters ( ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction setupNetworksAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.HostSetupNetworks , hostSetupNetworksParameters , this , true ) ; setupNetworksAction.then ( getVfsConfigAction ( ) ) . then ( getCommitNetworkChangesAction ( ) ) . onAllExecutionsFinish ( getCloseAction ( ) ) ; setupNetworksAction.runAction ( ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String tooltipContent ; if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; tooltipContent = config.getTooltip ( ) ; } else { tooltipContent = getPoolVmTooltip ( vm.getVmType ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltipContent ) ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String tooltipContent ; if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; tooltipContent = config.getTooltip ( ) ; } else { tooltipContent = getPoolVmTooltip ( vm.getVmType ( ) ) ; } return tooltipContent ; }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int eventFloodRate = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int eventFloodRate = ( ( auditLogable.isExternal ( ) ) && ( ( auditLogable.getEventFloodInSec ( ) ) == 0 ) ) ? 30 : logType.getEventFloodRate ( ) ; if ( eventFloodRate > 0 ) { auditLogable.setEndTime ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( eventFloodRate ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }
Source:
protected void buildFilesForOvfs ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > > ovfs , org.ovirt.engine.core.utils.archivers.tar.InMemoryTar inMemoryTar ) throws java.lang.Exception { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > pair : ovfs ) { inMemoryTar.addTarEntry ( pair.getSecond ( ) . getBytes ( ) , ( ( pair.getFirst ( ) ) + ".ovf" ) ) ; } }

Target:
protected void buildFilesForOvfs ( java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > > ovfs , org.ovirt.engine.core.utils.archivers.tar.InMemoryTar inMemoryTar ) throws java.lang.Exception { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.String > pair : ovfs ) { if ( ( pair.getSecond ( ) ) != null ) { inMemoryTar.addTarEntry ( pair.getSecond ( ) . getBytes ( ) , ( ( pair.getFirst ( ) ) + ".ovf" ) ) ; } } }
Source:
private void setUpMock ( ) { geoRepDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao.class ) ; org.mockito.Mockito.doReturn ( geoRepDao ) . when ( getQuery ( ) ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( masterVolumeId ) . when ( getQueryParameters ( ) ) . getId ( ) ; org.mockito.Mockito.doReturn ( getMockGeoRepSessions ( ) ) . when ( geoRepDao ) . getGeoRepSessions ( masterVolumeId ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails > ( ) ) . when ( geoRepDao ) . getGeoRepSessionDetails ( sessionId ) ; }

Target:
private void setUpMock ( ) { org.mockito.Mockito.doReturn ( masterVolumeId ) . when ( getQueryParameters ( ) ) . getId ( ) ; org.mockito.Mockito.doReturn ( getMockGeoRepSessions ( ) ) . when ( geoRepDao ) . getGeoRepSessions ( masterVolumeId ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails > ( ) ) . when ( geoRepDao ) . getGeoRepSessionDetails ( sessionId ) ; }
Source:
public final void runAction ( ) { if ( ( actionFlowState ) == null ) { actionFlowState = new org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState ( 1 , finalAction ) ; } if ( ( model.getProgress ( ) ) == null ) { model.startProgress ( null ) ; actionFlowState.setStartedProgress ( true ) ; } if ( ( parallelAction ) != null ) { parallelAction.runParallelAction ( actionFlowState ) ; } if ( shouldExecute ( ) ) { internalRunAction ( ) ; } else { runNextAction ( ) ; } }

Target:
public final void runAction ( ) { if ( ( actionFlowState ) == null ) { actionFlowState = new org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState ( 1 , finalAction ) ; } if ( ( model.getProgress ( ) ) == null ) { model.startProgress ( ) ; actionFlowState.setStartedProgress ( true ) ; } if ( ( parallelAction ) != null ) { parallelAction.runParallelAction ( actionFlowState ) ; } if ( shouldExecute ( ) ) { internalRunAction ( ) ; } else { runNextAction ( ) ; } }
Source:
public void hasNoStorageDomains ( ) { org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void hasNoStorageDomains ( ) { org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainCommand < org.ovirt.engine.core.common.action.StorageDomainPoolParametersBase > ( params ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }

Target:
public void setup ( ) { map = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainCommand ( params ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }
Source:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; if ( imageParams != null ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } } }

Target:
private void removeVmImages ( ) { java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > imageParams = org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase param : imageParams ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageToRemoveByParam ( ( ( org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ) ( param ) ) ) ; if ( diskImage != null ) { org.ovirt.engine.core.bll.ImagesHandler.removeDiskImage ( diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getVmId ( ) ) ; } } }
Source:
protected boolean validateBallonDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBalloonDeviceExists ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . getOsId ( ) , getEffectiveCompatibilityVersion ( ) ) ) ) { addValidationMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failValidation ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }

Target:
protected boolean validateBallonDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBalloonDeviceExists ( getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isBalloonEnabled ( getVm ( ) . getStaticData ( ) . getOsId ( ) , getEffectiveCompatibilityVersion ( ) ) ) ) { addValidationMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failValidation ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }
Source:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }

Target:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < > ( ) ; dashboardMap = new java.util.HashMap < > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }
Source:
public void vmNameNullVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setvm_name ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void vmNameNullVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setVmName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
public void testGetAllForDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network > result = dao.getAllForDataCenter ( datacenter ) ; org.ovirt.engine.core.dao.NetworkDAOTest.assertGetAllForClusterResult ( result ) ; for ( org.ovirt.engine.core.common.businessentities.network net : result ) { org.junit.Assert.assertEquals ( datacenter , net.getstorage_pool_id ( ) ) ; } }

Target:
public void testGetAllForDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > result = dao.getAllForDataCenter ( datacenter ) ; org.ovirt.engine.core.dao.NetworkDAOTest.assertGetAllForClusterResult ( result ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : result ) { org.junit.Assert.assertEquals ( datacenter , net.getstorage_pool_id ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase RunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getSession ( ) . getId ( ) ) ; if ( noBackend ) { org.ovirt.engine.core.common.action.VdcReturnValueBase rValue = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; rValue.setSucceeded ( true ) ; return rValue ; } return getBackend ( ) . runAction ( actionType , params ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getSession ( ) . getId ( ) ) ; if ( noBackend ) { org.ovirt.engine.core.common.action.VdcReturnValueBase rValue = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; rValue.setSucceeded ( true ) ; return rValue ; } return getBackend ( ) . runAction ( actionType , params ) ; }
Source:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > setUpTemplates ( boolean notFound ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ret = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , org.ovirt.engine.core.common.queries.DiskImageList > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getVmTemplateEntity ( i ) , new org.ovirt.engine.core.common.queries.DiskImageList ( ) ) ; } return ret ; }

Target:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > setUpTemplates ( boolean notFound ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ret = new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getVmTemplateEntity ( i ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; } return ret ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskList.addAll ( disks ) ; java.util.Collections.sort ( diskList , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model1 ) ) ; searchableListModel.setItems ( diskList ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model1 ) ) ; searchableListModel.setItems ( disks ) ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( volume == null ) { return ; } org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.VolumeStatus status = org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.getVolumeStatus ( volume ) ; com.google.gwt.resources.client.ImageResource statusImage = getStatusImage ( status ) ; java.lang.String tooltip = getToolTip ( status ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( applicationTemplates.statusTemplate ( statusImageHtml , tooltip ) ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.cell.Context context , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( volume == null ) { return ; } org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.VolumeStatus status = org.ovirt.engine.ui.frontend.utils.GlusterVolumeUtils.getVolumeStatus ( volume ) ; com.google.gwt.resources.client.ImageResource statusImage = getStatusImage ( status ) ; java.lang.String tooltip = getToolTip ( status ) ; com.google.gwt.safehtml.shared.SafeHtml statusImageHtml = com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( statusImage ) . getHTML ( ) ) ; sb.append ( applicationTemplates.statusTemplate ( statusImageHtml , tooltip , id ) ) ; }