auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void init ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { setDiskImages ( diskImages ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel moveDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > diskImages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; moveDiskModel.onInitAllDisks ( diskImages ) ; moveDiskModel.onInitDisks ( ) ; } } ) ) ; }

Target:
public void init ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { setDiskImages ( diskImages ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel moveDiskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.MoveDiskModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > diskImages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; moveDiskModel.onInitAllDisks ( diskImages ) ; moveDiskModel.onInitDisks ( ) ; } } ) ) ; }
Source:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.powermock.api.mockito.PowerMockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.cpuExists ( ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.cpuFlagsNotMissing ( ) ; allQueriesEmpty ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }

Target:
public void disableGlusterWhenVolumesExist ( ) { createCommandWithVirtEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesEmpty ( ) ; clusterHasGlusterVolumes ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_GLUSTER_WHEN_CLUSTER_CONTAINS_VOLUMES ) ; }
Source:
private void updateDcLabels ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkLabelsByDataCenterId ( getSelectedDc ( ) . getId ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; stopProgress ( ) ; onExportChanged ( ) ; } } ) ) ; }

Target:
private void updateDcLabels ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkLabelsByDataCenterId ( getSelectedDc ( ) . getId ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String label = getNetworkLabel ( ) . getSelectedItem ( ) ; getNetworkLabel ( ) . setItems ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; getNetworkLabel ( ) . setSelectedItem ( label ) ; onExportChanged ( ) ; } } ) ) ; }
Source:
public void dontSyncNetworkOnDefaultMtu ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setMtu ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }

Target:
public void dontSyncNetworkOnDefaultMtu ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setMtu ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextInt ( ) ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( nic ) ) ; validateAndAssertNoChanges ( helper ) ; }
Source:
public void testGetIdsForOvfDeletionTwoToDelete ( ) { org.ovirt.engine.core.dao.VmDao vmDao = dbFacade.getVmDao ( ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = vmAndTemplatesGenerationsDao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "there should be 2 ovfs for deletion" , 2 , guidsToDelete.size ( ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; }

Target:
public void testGetIdsForOvfDeletionTwoToDelete ( ) { vmDao.remove ( FixturesTool.VM_RHEL5_POOL_50 ) ; vmDao.remove ( FixturesTool.VM_RHEL5_POOL_51 ) ; java.util.List < org.ovirt.engine.core.compat.Guid > guidsToDelete = vmAndTemplatesGenerationsDao.getIdsForOvfDeletion ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER ) ; org.junit.Assert.assertEquals ( "there should be 2 ovfs for deletion" , 2 , guidsToDelete.size ( ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.Assert.assertTrue ( "the list of guids for deletion doesn't contain an expected guid" , guidsToDelete.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; }
Source:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.getDeviceType ( device ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device.getInnerMap ( ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }

Target:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.getDeviceType ( device ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }
Source:
public java.util.ArrayList < java.lang.Integer > get64bitOss ( ) { java.util.ArrayList < java.lang.Integer > oss = new java.util.ArrayList < java.lang.Integer > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String bus = getValueByVersion ( idToUnameLookup.get ( osId ) , "bus" , null ) ; if ( ( bus != null ) && ( bus.equalsIgnoreCase ( "64" ) ) ) { oss.add ( osId ) ; } } return oss ; }

Target:
public java.util.ArrayList < java.lang.Integer > get64bitOss ( ) { java.util.ArrayList < java.lang.Integer > oss = new java.util.ArrayList < java.lang.Integer > ( ) ; for ( int osId : getOsIds ( ) ) { java.lang.String bus = getValueByVersion ( idToUnameLookup.get ( osId ) , "bus" , null ) ; if ( "64" . equalsIgnoreCase ( bus ) ) { oss.add ( osId ) ; } } return oss ; }
Source:
public void testIsQcowV3SupportedForDcVersionV4 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V4 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testIsQcowV3SupportedForDcVersionV4 ( ) { disk1.setVolumeFormat ( VolumeFormat.COW ) ; disk1.setQcowCompat ( QcowCompat.QCOW2_V3 ) ; org.ovirt.engine.core.common.businessentities.StoragePool sp = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; sp.setStoragePoolFormatType ( StorageFormatType.V4 ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( sp ) ; org.junit.Assert.assertThat ( validator.isQcowVersionSupportedForDcVersion ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setClusterCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "3.1" ) ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }

Target:
protected void mockVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; command.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( command ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( Guid.Empty ) ) . thenReturn ( vds ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network n ) { if ( ( n.getvlan_id ( ) ) != null ) { return ( n.getvlan_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getvlan_id ( ) ) ) && ( n.getstorage_pool_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getstorage_pool_id ( ) ) ) ; } return false ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.Network n ) { if ( ( n.getvlan_id ( ) ) != null ) { return ( n.getvlan_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getvlan_id ( ) ) ) && ( n.getstorage_pool_id ( ) . equals ( getParameters ( ) . getNetwork ( ) . getstorage_pool_id ( ) ) ) ; } return false ; }
Source:
public long nextLong ( long l ) { if ( l <= 0 ) { throw new java.lang.IllegalArgumentException ( "l must be greater than 0!" ) ; } long rand = super . nextLong ( ) ; if ( rand == ( java.lang.Long.MIN_VALUE ) ) { rand ++ ; } return ( java.lang.Math.abs ( rand ) ) % l ; }

Target:
public long nextLong ( long l ) { if ( l <= 0 ) { throw new java.lang.IllegalArgumentException ( "l must be greater than 0!" ) ; } long rand = nextLong ( ) ; if ( rand == ( java.lang.Long.MIN_VALUE ) ) { rand ++ ; } return ( java.lang.Math.abs ( rand ) ) % l ; }
Source:
public void validateSameSourceAndDest ( ) { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; }

Target:
public void validateSameSourceAndDest ( ) { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; }
Source:
private boolean evaluateHostUpgradeInternalCommandProgress ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds , org.ovirt.engine.core.bll.CommandBase < ? > rootCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity upgradeCommand = getHostUpgradeInternalCommand ( childCmdIds ) ; if ( upgradeCommand == null ) { return false ; } switch ( upgradeCommand.getCommandStatus ( ) ) { case ACTIVE : case NOT_STARTED : case FAILED : case FAILED_RESTARTED : case UNKNOWN : rootCommand.setCommandStatus ( CommandStatus.FAILED ) ; return true ; case SUCCEEDED : rootCommand.setCommandStatus ( CommandStatus.SUCCEEDED ) ; return true ; } return true ; }

Target:
private boolean evaluateHostUpgradeInternalCommandProgress ( java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds , org.ovirt.engine.core.bll.CommandBase < ? > rootCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity upgradeCommand = getHostUpgradeInternalCommand ( childCmdIds ) ; if ( upgradeCommand == null ) { return false ; } switch ( upgradeCommand.getCommandStatus ( ) ) { case ACTIVE : case NOT_STARTED : return false ; case FAILED : case FAILED_RESTARTED : case UNKNOWN : rootCommand.setCommandStatus ( CommandStatus.FAILED ) ; return true ; case SUCCEEDED : rootCommand.setCommandStatus ( CommandStatus.SUCCEEDED ) ; return true ; } return true ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.Object [ ] array = ( ( java.lang.Object [ ] ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior ) ( array [ 0 ] ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel ) ( array [ 1 ] ) ) ; behavior.postUpdateItemsAvailability ( storageModelItem , ( returnValue == null ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.NewEditStorageModelBehavior behavior = this ; org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel storageModelItem = item ; behavior.postUpdateItemsAvailability ( storageModelItem , ( returnValue == null ) ) ; }
Source:
public void setCoresPerSocket ( java.lang.Integer value ) { if ( ( ( coresPerSocket ) == null ) && ( value == null ) ) { return ; } if ( ( ( coresPerSocket ) == null ) || ( ! ( coresPerSocket.equals ( value ) ) ) ) { coresPerSocket = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "CoresPerSocket" ) ) ; } }

Target:
public void setCoresPerSocket ( java.lang.String value ) { if ( ( ( coresPerSocket ) == null ) && ( value == null ) ) { return ; } if ( ( ( coresPerSocket ) == null ) || ( ! ( coresPerSocket.equals ( value ) ) ) ) { coresPerSocket = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "CoresPerSocket" ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , provider ) ) ; org.mockito.Mockito.doReturn ( networkDao ) . when ( validator ) . getNetworkDao ( ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , provider ) ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }
Source:
public void testBadGuidValidation ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; control.replay ( ) ; resource.update ( host ) ; }

Target:
public void testBadGuidValidation ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; org.ovirt.engine.api.model.Host host = new org.ovirt.engine.api.model.Host ( ) ; host.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; host.getCluster ( ) . setId ( "!!!" ) ; resource.update ( host ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel < ? > tableSelectionModel = ( ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) ) != null ) ? org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) . getSelectionModel ( ) : null ; if ( tableSelectionModel != null ) { registerHandler ( tableSelectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { updateDetailModelSelection ( ) ; } } ) ) ; } }

Target:
protected void onBind ( ) { super . onBind ( ) ; org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel < ? > tableSelectionModel = ( ( getTable ( ) ) != null ) ? getTable ( ) . getSelectionModel ( ) : null ; if ( tableSelectionModel != null ) { registerHandler ( tableSelectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { updateDetailModelSelection ( ) ; } } ) ) ; } }
Source:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.when ( command.getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingBlockDomainSuccessfully ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getLUNs ( ) ) . when ( command ) . getLUNsFromVgInfo ( parameters.getStorageDomain ( ) . getStorage ( ) ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , false , null ) ; return nic ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNicSyncedWithNetwork ( java.lang.String nicName , org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , network.getVlanId ( ) , network.getName ( ) , network.isVmNetwork ( ) , network.getAddr ( ) , false , null ) ; return nic ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid vmGuid ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmGuid ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , 2 , new java.util.HashMap < > ( ) , true , false , false , "alias" , java.util.Collections.singletonMap ( "prop1" , "value1" ) , null , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( org.ovirt.engine.core.compat.Guid vmGuid ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vmGuid ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "floppy" , "type:'drive', controller:'0', bus:'0', unit:'1'" , new java.util.HashMap < > ( ) , true , false , false , "alias" , java.util.Collections.singletonMap ( "prop1" , "value1" ) , null , null ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.String value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( value != null ) && ( ( value.length ( ) ) > ( getMaxLength ( ) ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . lenValidationFieldMusnotExceed ( getMaxLength ( ) ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; if ( ( ( value != null ) && ( value instanceof java.lang.String ) ) && ( ( ( ( java.lang.String ) ( value ) ) . length ( ) ) > ( getMaxLength ( ) ) ) ) { result.setSuccess ( false ) ; result.getReasons ( ) . add ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . lenValidationFieldMusnotExceed ( getMaxLength ( ) ) ) ; } return result ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; java.util.Collections.singletonList ( storageId ) ; disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageId ) ) ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskId ) ; java.util.Collections.singletonList ( storageId ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storageId ) ) ) ; return disk ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpInterfaces ( ) , failure ) ; control.replay ( ) ; }
Source:
private static java.lang.Boolean AssignBoolValue ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct input , java.lang.String name ) { if ( input.containsKey ( name ) ) { if ( ( input.getItem ( name ) ) instanceof java.lang.Boolean ) { return ( ( java.lang.Boolean ) ( input.getItem ( name ) ) ) ; } return java.lang.Boolean.parseBoolean ( input.getItem ( name ) . toString ( ) ) ; } return null ; }

Target:
private static java.lang.Boolean AssignBoolValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { if ( input.containsKey ( name ) ) { if ( ( input.get ( name ) ) instanceof java.lang.Boolean ) { return ( ( java.lang.Boolean ) ( input.get ( name ) ) ) ; } return java.lang.Boolean.parseBoolean ( input.get ( name ) . toString ( ) ) ; } return null ; }
Source:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; vds.setVmCount ( 1 ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setVmCount ( 0 ) ; org.junit.Assert.assertFalse ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }

Target:
public void testVirtIsMonitoringNeeded ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.NonOperational ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; vds.setStatus ( VDSStatus.Up ) ; org.junit.Assert.assertTrue ( virtStrategy.isMonitoringNeeded ( vds ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.PostGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.PostGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel templateModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageTemplateListModel ) ( model ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; templateModel.setItems ( templates ) ; templateModel.setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.VmTemplateComparator ( ) ) ; setItems ( templates ) ; setIsEmpty ( ( ( templates.size ( ) ) == 0 ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; initializeImages ( ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getDiskImageDao ( ) ) . thenReturn ( diskImageDao ) ; imagesIds = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getIds ( ) ) . thenReturn ( imagesIds ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; initializeImages ( ) ; imagesIds = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getIds ( ) ) . thenReturn ( imagesIds ) ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NetworkLabel model = new org.ovirt.engine.api.model.NetworkLabel ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkLabel" , "add" , "id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.NetworkLabel model = new org.ovirt.engine.api.model.NetworkLabel ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkLabel" , "add" , "id" ) ; } }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isVirtioScsiEnabledForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isVirtioScsiEnabledForVm ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , boolean saveToDb , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setSaveToDb ( saveToDb ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { 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 ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceNotEnough ( ) throws java.lang.Exception { 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 ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.validator.StorageDomainValidator getStorageDomainValidator ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { if ( ( entry.getValue ( ) ) == null ) { entry.setValue ( new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( getStorageDomainDAO ( ) . getForStoragePool ( entry.getKey ( ) , storagePoolId ) ) ) ; } return entry.getValue ( ) ; }

Target:
protected org.ovirt.engine.core.bll.validator.StorageDomainValidator getStorageDomainValidator ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.StorageDomainValidator > entry ) { if ( ( entry.getValue ( ) ) == null ) { entry.setValue ( new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( getStorageDomainDAO ( ) . getForStoragePool ( entry.getKey ( ) , storagePoolId ) ) ) ; } return entry.getValue ( ) ; }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , ovfEntityData.getStorageDomainId ( ) ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; }
Source:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }

Target:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertEquals ( 2 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }
Source:
public java.lang.String createSnapshot ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , final java.lang.Boolean force ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.SnapshotForCreate snapshotForCreate = new com.woorea.openstack.cinder.model.SnapshotForCreate ( ) ; snapshotForCreate.setVolumeId ( cinderDisk.getId ( ) . toString ( ) ) ; snapshotForCreate.setForce ( force ) ; return proxy.createSnapshot ( snapshotForCreate ) ; } } ) ; }

Target:
public java.lang.String createSnapshot ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.SnapshotForCreate snapshotForCreate = new com.woorea.openstack.cinder.model.SnapshotForCreate ( ) ; snapshotForCreate.setVolumeId ( cinderDisk.getId ( ) . toString ( ) ) ; return proxy.createSnapshot ( snapshotForCreate ) ; } } ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( createTestCommand ( volumeId2 , 0 ) ) ; prepareMocks ( cmd ) ; mockBackend ( false , EngineError.GlusterVolumeRemoveBricksStartFailed ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED ) ; }

Target:
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 ( cmd.getAuditLogTypeValue ( ) , AuditLogType.START_REMOVING_GLUSTER_VOLUME_BRICKS_FAILED ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.BootSequence getSequence ( ) { java.lang.StringBuilder str = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel a : getItems ( ) ) { if ( a.getIsChangable ( ) ) { org.ovirt.engine.core.common.businessentities.BootSequence bs = ( ( org.ovirt.engine.core.common.businessentities.BootSequence ) ( a.getEntity ( ) ) ) ; str.append ( bs.toString ( ) ) ; } } return ! ( str.equals ( "" ) ) ? org.ovirt.engine.core.common.businessentities.BootSequence.valueOf ( str.toString ( ) ) : null ; }

Target:
public org.ovirt.engine.core.common.businessentities.BootSequence getSequence ( ) { java.lang.StringBuilder str = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel a : getItems ( ) ) { if ( a.getIsChangable ( ) ) { org.ovirt.engine.core.common.businessentities.BootSequence bs = ( ( org.ovirt.engine.core.common.businessentities.BootSequence ) ( a.getEntity ( ) ) ) ; str.append ( bs.toString ( ) ) ; } } return ! ( str.toString ( ) . equals ( "" ) ) ? org.ovirt.engine.core.common.businessentities.BootSequence.valueOf ( str.toString ( ) ) : null ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; model.dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; if ( ( ( model.dataCenter ) == null ) || ( ( model.dataCenter.getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) { model.UpdateOptionsNonLocalFSData ( ) ; } else { model.UpdateOptionsLocalFSData ( ) ; } }
Source:
public void setEntity ( org.ovirt.engine.core.common.businessentities.VDS value ) { if ( ( super . getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS currentItem = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( super . getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS newItem = value ; org.ovirt.engine.core.compat.Guid currentItemId = currentItem.getId ( ) ; org.ovirt.engine.core.compat.Guid newItemId = newItem.getId ( ) ; if ( currentItemId.equals ( newItemId ) ) { setEntity ( value , false ) ; updateActionAvailability ( ) ; return ; } } super . setEntity ( value ) ; }

Target:
public void setEntity ( org.ovirt.engine.core.common.businessentities.VDS value ) { if ( ( super . getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDS currentItem = super . getEntity ( ) ; org.ovirt.engine.core.compat.Guid currentItemId = currentItem.getId ( ) ; org.ovirt.engine.core.compat.Guid newItemId = value.getId ( ) ; if ( currentItemId.equals ( newItemId ) ) { setEntity ( value , false ) ; updateActionAvailability ( ) ; return ; } } super . setEntity ( value ) ; }
Source:
public void vmTemplateNameWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmTemplateName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void vmTemplateNameWithVm ( ) { final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmTemplateName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }