auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForClonedDisk ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }

Target:
protected boolean validateSpaceRequirements ( ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( ) ; if ( validate ( storageDomainValidator.isDomainWithinThresholds ( ) ) ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getSnapshots ( ) . addAll ( getAllImageSnapshots ( ) ) ; return validate ( storageDomainValidator.hasSpaceForClonedDisk ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) ) ; } return false ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void assertEntireMapContentsUnchanged ( ) { org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue newVal1 = innerMap.get ( key1 ) ; org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue newVal2 = innerMap.get ( key2 ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE1_WIDTH , newVal1.getWidth ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE1_LENGTH , newVal1.getLength ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE2_WIDTH , newVal2.getWidth ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE2_LENGTH , newVal2.getLength ( ) ) ; }

Target:
public void assertEntireMapContentsUnchanged ( ) { org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue newVal1 = innerMap.get ( key1 ) ; org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.MyValue newVal2 = innerMap.get ( key2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE1_WIDTH , newVal1.getWidth ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE1_LENGTH , newVal1.getLength ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE2_WIDTH , newVal2.getWidth ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.utils.collections.CopyOnAccessMapTest.VALUE2_LENGTH , newVal2.getLength ( ) ) ; }
Source:
private void createVMFromTemplate ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.UICommand > commands = new java.util.ArrayList < > ( ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createDefaultOkUiCommand ( "OnSaveVm" , this ) ) ; commands.add ( org.ovirt.engine.ui.uicommonweb.UICommand.createCancelUiCommand ( "Cancel" , this ) ) ; setupNewVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmFromTemplateModelBehavior ( template ) , this ) , template.getVmType ( ) , getSystemTreeSelectedItem ( ) , commands ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.VmTemplate withVmInit = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; setupNewVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ( new org.ovirt.engine.ui.uicommonweb.models.vms.NewVmFromTemplateModelBehavior ( withVmInit ) , this ) , withVmInit.getVmType ( ) , getSystemTreeSelectedItem ( ) , commands ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( roleId ) , aQuery ) ; }
Source:
public void testContainsKeyReturnsTrueForExistingName ( ) { java.lang.String name = "name" ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( null , name ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.junit.Assert.assertThat ( map.containsKey ( name ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testContainsKeyReturnsTrueForExistingName ( ) { java.lang.String name = "name" ; java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( null , name ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.hamcrest.MatcherAssert.assertThat ( map.containsKey ( name ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }
Source:
void initEditors ( ) { selectHostAutomaticallyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; selectDestinationHostEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; hostsListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDS > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return vds.getName ( ) ; } } ) ; clustersEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < org.ovirt.engine.core.common.businessentities.VDSGroup > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) { @ java.lang.Override protected java.lang.String renderNullSafe ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { return cluster.getName ( ) ; } } ) ; }

Target:
void initEditors ( ) { selectHostAutomaticallyEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; selectDestinationHostEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelRadioButtonEditor ( "1" ) ; hostsListEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; clustersEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ) ; }
Source:
public void testLockedDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Locked ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }

Target:
private void testBusyDomainInList ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( status ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand.equals ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public java.lang.String getTooltipContent ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item , org.ovirt.engine.ui.webadmin.section.main.view.popup.host.panels.NetworkItemPanel panel ) { if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) { showNetwork ( ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ) ; } else if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) { showNic ( ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) ( item ) ) ) ; } else if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) { return null ; } return this . getElement ( ) . getInnerHTML ( ) ; }

Target:
public final com.google.gwt.safehtml.shared.SafeHtml getTooltipContent ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > item ) { if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) { showNetwork ( ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ) ; } else if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) { showNic ( ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ) ( item ) ) ) ; } else if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ) { return null ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( this . getElement ( ) . getInnerHTML ( ) ) ; }
Source:
public void validateInvalidDestinationDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.storage.lsm.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }

Target:
public void validateInvalidDestinationDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; dstStorageDomain.setStorageDomainType ( StorageDomainType.ISO ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_ILLEGAL ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS makeTestVds ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VDS newVdsData = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; newVdsData.setHostName ( "BUZZ" ) ; newVdsData.setSSHPort ( 22 ) ; newVdsData.setSSHUsername ( "root" ) ; newVdsData.setSSHKeyFingerprint ( "1234" ) ; newVdsData.setVdsName ( "BAR" ) ; newVdsData.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "1.2.3" ) ) ; newVdsData.setVdsGroupId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; newVdsData.setId ( vdsId ) ; return newVdsData ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS makeTestVds ( org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.VDS newVdsData = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; newVdsData.setHostName ( "BUZZ" ) ; newVdsData.setSshPort ( 22 ) ; newVdsData.setSshUsername ( "root" ) ; newVdsData.setSshKeyFingerprint ( "1234" ) ; newVdsData.setVdsName ( "BAR" ) ; newVdsData.setVdsGroupCompatibilityVersion ( new org.ovirt.engine.core.compat.Version ( "1.2.3" ) ) ; newVdsData.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVdsData.setId ( vdsId ) ; return newVdsData ; }
Source:
public void testGetValue ( ) { final java.lang.String key = "MaxNumberOfHostsInStoragePool" ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( "getValue: Testing fetch of {}" , key ) ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( "getValue: got: {}" , configKey ) ; org.junit.Assert.assertNotNull ( configKey.getValue ( ) ) ; }

Target:
public void testGetValue ( ) { final java.lang.String key = "MaxNumberOfHostsInStoragePool" ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( "getValue: Testing fetch of {}" , key ) ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( "getValue: got: {}" , configKey ) ; org.junit.jupiter.api.Assertions.assertNotNull ( configKey.getValue ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_pool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage_pool mockStoragePool ( org.ovirt.engine.core.compat.Version compatibilityVersion ) { org.ovirt.engine.core.compat.Guid storagePoolId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; storagePool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
public void waitBeforeNextPoll ( long timeBeforePoll ) { if ( ( ( java.lang.System.currentTimeMillis ( ) ) - timeBeforePoll ) < ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ) { try { java.lang.Thread.sleep ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ; } catch ( java.lang.InterruptedException e ) { } } }

Target:
private void waitBetweenPolls ( ) { while ( ( ( timestampOfEndOfPreviousInvocation ) != null ) && ( ( ( currentTimestamp ( ) ) - ( timestampOfEndOfPreviousInvocation ) ) < ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK_IN_NANOS ) ) ) { try { java.lang.Thread.sleep ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ; } catch ( java.lang.InterruptedException e ) { } } }
Source:
public void testRemove ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot s : dbFacade.getSnapshotDao ( ) . getAll ( ) ) { dbFacade.getSnapshotDao ( ) . remove ( s.getId ( ) ) ; } dao.remove ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.ovirt.engine.core.common.businessentities.VmStatic result = dao.get ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testRemove ( ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot s : dbFacade.getSnapshotDao ( ) . getAll ( ) ) { dbFacade.getSnapshotDao ( ) . remove ( s.getId ( ) ) ; } dao.remove ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.ovirt.engine.core.common.businessentities.VmStatic result = dao.get ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) ; org.junit.Assert.assertNull ( result ) ; org.ovirt.engine.core.dao.PermissionDAO permissionsDao = dbFacade.getPermissionDao ( ) ; org.junit.Assert.assertEquals ( "vm permissions wasn't removed" , 0 , permissionsDao.getAllForEntity ( org.ovirt.engine.core.dao.VmStaticDAOTest.EXISTING_VM_ID ) . size ( ) ) ; }
Source:
public boolean isNumOfSocketsCorrect ( int totalCpuCores ) { boolean isNumOfVcpusCorrect = ( ( extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ) * ( extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ) ) == totalCpuCores ; return isNumOfVcpusCorrect ; }

Target:
public void numOfSocketChanged ( ) { final int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; final int totalCpuCores = getTotalCpuCores ( ) ; if ( ( numOfSockets == 0 ) || ( totalCpuCores == 0 ) ) { return ; } getModel ( ) . getThreadsPerCore ( ) . setSelectedItem ( 1 ) ; getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; setCpuChangeability ( ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackend ( cmd , true ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.atLeast ( 1 ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.atLeast ( 1 ) ) . addServerHookInDb ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_ENABLE ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } else if ( getCancelImportCommand ( ) . equals ( command ) ) { cancelImport ( ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.network.NetworkInterface findInterfaceByNetworkName ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > items , java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface i : items ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( i.getNetworkName ( ) , name ) ) { return i ; } } return null ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult passthroughProfileContainsSupportedProperties ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES ) . when ( ( ( vnicProfile.isPassthrough ( ) ) && ( ( vnicProfile.isPortMirroring ( ) ) || ( ( vnicProfile.getNetworkQosId ( ) ) != null ) ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult passthroughProfileContainsSupportedProperties ( boolean useDefaultNetworkFilterId ) { boolean nullValuedNetworkFilterWillBeUsed = ( ( vnicProfile.getNetworkFilterId ( ) ) == null ) && ( ! useDefaultNetworkFilterId ) ; boolean conditionOccurs = ( vnicProfile.isPassthrough ( ) ) && ( ( ( vnicProfile.isPortMirroring ( ) ) || ( ( vnicProfile.getNetworkQosId ( ) ) != null ) ) || ( ! nullValuedNetworkFilterWillBeUsed ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_CONTAINS_NOT_SUPPORTED_PROPERTIES ) . when ( conditionOccurs ) ; }
Source:
private static java.lang.String LoadFile ( java.lang.String fileName ) { java.lang.String content = "" ; fileName = org.ovirt.engine.core.common.config.ConfigUtil.resolvePath ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getSysprepDir ( ) , fileName ) ; if ( org.ovirt.engine.core.utils.FileUtil.fileExists ( fileName ) ) { try { content = org.ovirt.engine.core.utils.FileUtil.readAllText ( fileName ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( "Failed to read sysprep template: " + fileName ) , e ) ; } } else { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( ( "Sysprep template: " + fileName ) + " not found" ) ) ; } return content ; }

Target:
private static java.lang.String LoadFile ( java.lang.String fileName ) { java.lang.String content = "" ; fileName = org.ovirt.engine.core.common.config.ConfigUtil.resolvePath ( org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getSysprepDir ( ) , fileName ) ; if ( new java.io.File ( fileName ) . exists ( ) ) { try { content = org.ovirt.engine.core.utils.FileUtil.readAllText ( fileName ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( "Failed to read sysprep template: " + fileName ) , e ) ; } } else { org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.log.error ( ( ( "Sysprep template: " + fileName ) + " not found" ) ) ; } return content ; }
Source:
public void PostOnSave ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; } }

Target:
protected void updateConfigValues ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }
Source:
public void edit ( final M model ) { if ( ( this . model ) != null ) { this . model.getItemsChangedEvent ( ) . removeListener ( itemsChangedListener ) ; } this . model = model ; model.getItemsChangedEvent ( ) . addListener ( itemsChangedListener ) ; init ( model ) ; }

Target:
public void edit ( final M model ) { if ( ( this . model ) != null ) { this . model.getItemsChangedEvent ( ) . removeListener ( itemsChangedListener ) ; } this . model = model ; model.getItemsChangedEvent ( ) . addListener ( itemsChangedListener ) ; setVisible ( model.getIsAvailable ( ) ) ; init ( model ) ; }
Source:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Collections.singletonList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . addExistingInterfaces ( slave ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassCanDoAction ( ) ; group.setCompatibilityVersion ( Version.v3_3 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void testValidate ( ) { org.junit.Assert.assertTrue ( "1" , underTest.validateFieldValue ( "LOAD" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , underTest.validateFieldValue ( "LOAD" , "123" ) ) ; org.junit.Assert.assertTrue ( "123.456" , underTest.validateFieldValue ( "LOAD" , "123.456" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , underTest.validateFieldValue ( "LOAD" , "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.junit.jupiter.api.Assertions.assertTrue ( underTest.validateFieldValue ( "LOAD" , "1" ) , "1" ) ; org.junit.jupiter.api.Assertions.assertTrue ( underTest.validateFieldValue ( "LOAD" , "123" ) , "123" ) ; org.junit.jupiter.api.Assertions.assertTrue ( underTest.validateFieldValue ( "LOAD" , "123.456" ) , "123.456" ) ; org.junit.jupiter.api.Assertions.assertFalse ( underTest.validateFieldValue ( "LOAD" , "JarJar" ) , "JarJar" ) ; }
Source:
private void initManualWidgets ( boolean allowMultipleSelection ) { isPluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; imageDiskTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( allowMultipleSelection ) ; lunDiskTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( allowMultipleSelection ) ; }

Target:
private void initManualWidgets ( boolean allowMultipleSelection ) { isPluggedEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; imageDiskTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( allowMultipleSelection ) ; lunDiskTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( allowMultipleSelection ) ; cinderDiskTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable ( allowMultipleSelection ) ; messageLabel = new com.google.gwt.user.client.ui.HTML ( ) ; warningLabel = new com.google.gwt.user.client.ui.HTML ( ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setvm_name ( "testVm" ) ; final org.ovirt.engine.core.common.action.ImportVmParameters p = new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; return p ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setVmName ( "testVm" ) ; final org.ovirt.engine.core.common.action.ImportVmParameters p = new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; return p ; }
Source:
protected boolean isVmUpOrDown ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; return false ; } return true ; }

Target:
protected boolean isVmInUpPausedDownStatus ( ) { if ( ( ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL ) ; return false ; } return true ; }
Source:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; java.util.List < org.ovirt.engine.core.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVmProperties ( vm.getVdsGroupCompatibilityVersion ( ) , customProperties ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { getVmPropertiesUtils ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }

Target:
protected boolean validateVmProperties ( org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String runOnceCustomProperties , java.util.List < java.lang.String > messages ) { java.lang.String customProperties = ( runOnceCustomProperties != null ) ? runOnceCustomProperties : vm.getCustomProperties ( ) ; java.util.List < org.ovirt.engine.core.common.utils.customprop.ValidationError > validationErrors = getVmPropertiesUtils ( ) . validateVmProperties ( vm.getVdsGroupCompatibilityVersion ( ) , customProperties ) ; if ( ! ( validationErrors.isEmpty ( ) ) ) { getVmPropertiesUtils ( ) . handleCustomPropertiesError ( validationErrors , messages ) ; return false ; } return true ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testRemoveAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertFalse ( featuresSupported.isEmpty ( ) ) ; dao.removeAllSupportedHostFeature ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 , featuresSupported ) ; java.util.Set < java.lang.String > featuresSupportedAfterDeletion = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertTrue ( "Failed to remove addtional supported features" , featuresSupportedAfterDeletion.isEmpty ( ) ) ; }

Target:
public void testAddSupportedHostFeature ( ) { java.lang.String newFeature = "NEW_FEATURE_1" ; dao.addSupportedHostFeature ( FixturesTool.HOST_ID , newFeature ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertThat ( "Failed to add the feature" , featuresSupported , org.hamcrest.CoreMatchers.hasItem ( newFeature ) ) ; }
Source:
public void testExecuteQueryNotSupported ( ) { setup ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError.NOT_SUPPORTED ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.LldpInfo > returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertTrue ( ( returnValue == null ) ) ; }

Target:
public void testExecuteQueryNotSupported ( ) { setup ( org.ovirt.engine.core.bll.network.host.GetTlvsByHostNicIdQueryTest.ExpectedError.NOT_SUPPORTED ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.LldpInfo > returnValue = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNull ( returnValue ) ; }
Source:
private void mockValidators ( ) { org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; }

Target:
private void mockValidators ( ) { org.mockito.Mockito.doReturn ( vmValidator ) . when ( command ) . createVmValidator ( ) ; org.mockito.Mockito.doReturn ( snapshotsValidator ) . when ( command ) . createSnapshotsValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }