auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean externalNetworkValid ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator validator ) { org.ovirt.engine.core.bll.provider.ProviderValidator providerValidator = new org.ovirt.engine.core.bll.provider.ProviderValidator ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getDbFacade ( ) . getProviderDao ( ) . get ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getProvidedBy ( ) . getProviderId ( ) ) ) ; return ( ( validate ( providerValidator.providerIsSet ( ) ) ) && ( validate ( validator.externalNetworkNewInDataCenter ( ) ) ) ) && ( validate ( validator.externalNetworkIsVmNetwork ( ) ) ) ; }

Target:
private boolean externalNetworkValid ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.AddNetworkValidator validator ) { org.ovirt.engine.core.bll.provider.ProviderValidator providerValidator = new org.ovirt.engine.core.bll.provider.ProviderValidator ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getDbFacade ( ) . getProviderDao ( ) . get ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getProvidedBy ( ) . getProviderId ( ) ) ) ; return ( ( ( validate ( providerValidator.providerIsSet ( ) ) ) && ( validate ( validator.externalNetworkNewInDataCenter ( ) ) ) ) && ( validate ( validator.externalNetworkIsVmNetwork ( ) ) ) ) && ( validate ( validator.externalNetworkVlanValid ( ) ) ) ; }
Source:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
private void mockBackend ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; returnValue.setReturnValue ( java.lang.Boolean.FALSE ) ; org.mockito.Mockito.when ( backend.runInternalQuery ( org.mockito.Matchers.< org.ovirt.engine.core.common.queries.VdcQueryType > any ( org.ovirt.engine.core.common.queries.VdcQueryType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( returnValue ) ; org.mockito.Mockito.when ( backend.getResourceManager ( ) ) . thenReturn ( vdsBrokerFrontend ) ; org.mockito.Mockito.doReturn ( backend ) . when ( cmd ) . getBackend ( ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroup ( ) { if ( ( vdsGroup ) == null ) { vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_3 ) ; } return vdsGroup ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : storageDomains ) { if ( ( domain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }
Source:
public void nameNotAvailable ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Provider otherProvider = createProvider ( provider.getName ( ) ) ; org.mockito.Mockito.when ( providerDao.getByName ( provider.getName ( ) ) ) . thenReturn ( otherProvider ) ; org.junit.Assert.assertThat ( validator.nameAvailable ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameNotAvailable ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > otherProvider = createProvider ( provider.getName ( ) ) ; org.mockito.Mockito.when ( ( ( org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.Provider.AdditionalProperties > ) ( providerDao.getByName ( provider.getName ( ) ) ) ) ) . thenReturn ( otherProvider ) ; org.junit.Assert.assertThat ( validator.nameAvailable ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
public void testMissingParameterSpecificReason ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( "Missing stuff" , "{0} {1} required for {2}" , vm , "status" ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( "Missing stuff" , wae , "Vm" , "status" ) ; } }

Target:
public void testMissingParameterSpecificReason ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { org.ovirt.engine.api.common.util.CompletenessAssertor.validateParameters ( "Missing stuff" , "{0} {1} required for {2}" , vm , "status" ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( "Missing stuff" , wae , "Vm" , "status" ) ; } }
Source:
private void updateCinderDomainStatus ( final org.ovirt.engine.core.compat.Guid storageDomainId , final org.ovirt.engine.core.compat.Guid storagePoolId , final org.ovirt.engine.core.common.businessentities.StorageDomainStatus storageDomainStatus ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ; map.setStatus ( storageDomainStatus ) ; getStoragePoolIsoMapDao ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; }

Target:
private void updateCinderDomainStatus ( final org.ovirt.engine.core.compat.Guid storageDomainId , final org.ovirt.engine.core.compat.Guid storagePoolId , final org.ovirt.engine.core.common.businessentities.StorageDomainStatus storageDomainStatus ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = storagePoolIsoMapDao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ; map.setStatus ( storageDomainStatus ) ; storagePoolIsoMapDao.updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; }
Source:
public static void removeImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDynamicDao ( ) . remove ( diskImage.getImageId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . remove ( diskImage.getImageId ( ) ) ; }

Target:
public static void updateAllDiskImageSnapshotsStatus ( org.ovirt.engine.core.compat.Guid diskId , org.ovirt.engine.core.common.businessentities.storage.ImageStatus status ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . updateStatusOfImagesByImageGroupId ( diskId , status ) ; }
Source:
public void testImportAsNewEntity ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , true ) ; }

Target:
public void testImportAsNewEntity ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , true ) ; }
Source:
private void setUpMocksForRemove ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( cmd , hookFound , hook ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServers ( status ) ) ; }

Target:
private void setUpMocksForRemove ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( cmd , hookFound , hook ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServers ( status ) ) ; }
Source:
public void testAddGroupWithoutDirectoryName ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDomainList , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.GROUP_NAMES_WITH_NO_DOMAIN [ 0 ] ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyBadRequest ( wae ) ; } }

Target:
public void testAddGroupWithoutDirectoryName ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDomainList , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpDomains ( ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( org.ovirt.engine.api.restapi.resource.aaa.BackendGroupsResourceTest.GROUP_NAMES_WITH_NO_DOMAIN [ 0 ] ) ; verifyBadRequest ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.aaa.collection.add ( model ) ) ) ; }
Source:
public void testGetAllForDedicatedPowerClientByVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForDedicatedPowerClientByVds ( org.ovirt.engine.core.dao.VmDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDAOTest.VDS_GROUP_ID , vm.getvds_group_id ( ) ) ; } }

Target:
public void testGetAllForDedicatedPowerClientByVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForDedicatedPowerClientByVds ( org.ovirt.engine.core.dao.VmDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDAOTest.VDS_GROUP_ID , vm.getVdsGroupId ( ) ) ; } }
Source:
private void testUpdateManagementNetworkChange ( boolean managementBefore , boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { oldNetworkCluster.setManagement ( managementBefore ) ; networkCluster.setManagement ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }

Target:
private void testUpdateManagementNetworkChange ( boolean managementBefore , boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { oldNetworkCluster.setManagement ( managementBefore ) ; networkCluster.setManagement ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }
Source:
public static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permissions perms = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; perms.setAdElementId ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setRoleId ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
public static void addPermission ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.bll.PredefinedRoles role , org.ovirt.engine.core.common.VdcObjectType objectType ) { org.ovirt.engine.core.common.businessentities.Permission perms = new org.ovirt.engine.core.common.businessentities.Permission ( ) ; perms.setAdElementId ( userId ) ; perms.setObjectType ( objectType ) ; perms.setObjectId ( entityId ) ; perms.setRoleId ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult requiredValuesPresent ( ) { return ( ( getQos ( ) ) != null ) && ( ( missingValue ( getQos ( ) . getInboundAverage ( ) , getQos ( ) . getInboundPeak ( ) , getQos ( ) . getInboundBurst ( ) ) ) || ( missingValue ( getQos ( ) . getOutboundAverage ( ) , getQos ( ) . getOutboundPeak ( ) , getQos ( ) . getOutboundBurst ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_MISSING_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult requiredValuesPresent ( ) { return ( ( getQos ( ) ) != null ) && ( ( missingValue ( getQos ( ) . getInboundAverage ( ) , getQos ( ) . getInboundPeak ( ) , getQos ( ) . getInboundBurst ( ) ) ) || ( missingValue ( getQos ( ) . getOutboundAverage ( ) , getQos ( ) . getOutboundPeak ( ) , getQos ( ) . getOutboundBurst ( ) ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_MISSING_VALUES ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private int generateMaxLength ( ) { return doGenerateMaxLength ( getMaxNameLength ( ) , getPoolName ( ) . length ( ) ) ; }

Target:
protected java.lang.String getReason ( ) { return ( getQuestionMarksCount ( ) ) == 0 ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . numOfVmsInPoolInvalid ( generateMaxNumOfVms ( ) , getPoolName ( ) . length ( ) ) : org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . numOfVmsInPoolInvalidWithQuestionMarks ( generateMaxNumOfVmsWithQuestionMark ( ) , getPoolName ( ) . length ( ) , getQuestionMarksCount ( ) ) ; }
Source:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDAO ( ) ) . thenReturn ( vmDAO ) ; returnedVms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmDAO.getAllVmsRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVms ) ; }

Target:
private void mockDAOForQuery ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVmDao ( ) ) . thenReturn ( vmDAO ) ; returnedVms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getQuotaId ( ) ) . thenReturn ( quotaId ) ; org.mockito.Mockito.when ( vmDAO.getAllVmsRelatedToQuotaId ( quotaId ) ) . thenReturn ( returnedVms ) ; }
Source:
public void mockConfig ( ) { java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedClusters = new java.util.HashSet < > ( ) ; supportedClusters.add ( version ) ; org.mockito.Mockito.when ( host.getSupportedClusterVersionsSet ( ) ) . thenReturn ( supportedClusters ) ; org.mockito.Mockito.when ( host.getVdsGroupCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultRouteSupported , version , java.lang.Boolean.FALSE ) ; configRule.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; configRule.mockConfigValue ( ConfigValues.HostNetworkQosSupported , version , false ) ; }

Target:
public void mockConfig ( ) { java.util.HashSet < org.ovirt.engine.core.compat.Version > supportedClusters = new java.util.HashSet < > ( ) ; supportedClusters.add ( version ) ; org.mockito.Mockito.when ( host.getSupportedClusterVersionsSet ( ) ) . thenReturn ( supportedClusters ) ; org.mockito.Mockito.when ( host.getClusterCompatibilityVersion ( ) ) . thenReturn ( version ) ; configRule.mockConfigValue ( ConfigValues.DefaultRouteSupported , version , java.lang.Boolean.FALSE ) ; configRule.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; configRule.mockConfigValue ( ConfigValues.HostNetworkQosSupported , version , false ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers ) ; providersListModel.setIsChangable ( true ) ; providersListModel.setSelectedItem ( providers.get ( 0 ) ) ; getIsDiscorveredHosts ( ) . setEntity ( null ) ; getIsDiscorveredHosts ( ) . setEntity ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers , org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; providersListModel.setIsChangable ( true ) ; getIsDiscoveredHosts ( ) . setEntity ( null ) ; getIsDiscoveredHosts ( ) . setEntity ( true ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Items" ) ) ; } }

Target:
public void setItems ( java.lang.Iterable value ) { if ( ( items ) != value ) { ItemsChanging ( value , items ) ; items = value ; ItemsChanged ( ) ; getItemsChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Items" ) ) ; } }
Source:
private void initModels ( ) { getName ( ) . setEntity ( clusterPolicy.getName ( ) ) ; getName ( ) . setIsChangable ( ( ! ( clusterPolicy.isLocked ( ) ) ) ) ; getDescription ( ) . setEntity ( clusterPolicy.getDescription ( ) ) ; getDescription ( ) . setIsChangable ( ( ! ( clusterPolicy.isLocked ( ) ) ) ) ; initFilters ( ) ; initFunctions ( ) ; initLoadBalance ( ) ; initCustomPropertySheet ( ) ; }

Target:
private void initModels ( ) { getName ( ) . setEntity ( clusterPolicy.getName ( ) ) ; getName ( ) . setIsChangeable ( ( ! ( clusterPolicy.isLocked ( ) ) ) ) ; getDescription ( ) . setEntity ( clusterPolicy.getDescription ( ) ) ; getDescription ( ) . setIsChangeable ( ( ! ( clusterPolicy.isLocked ( ) ) ) ) ; initFilters ( ) ; initFunctions ( ) ; initLoadBalance ( ) ; initCustomPropertySheet ( ) ; }
Source:
public void successVmInPreviewForAttachedSnapshot ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; vmDevice.setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.storage.disk.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.diskMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.diskMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuDetails ) ; }
Source:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.Assert.assertEquals ( "Should be 1 changes" , 1 , changes.size ( ) ) ; }

Target:
public void testChanges ( ) { org.ovirt.engine.core.utils.Jedi jedi1 = new org.ovirt.engine.core.utils.Jedi ( ) ; org.ovirt.engine.core.utils.Jedi jedi2 = new org.ovirt.engine.core.utils.Jedi ( ) ; jedi2.saberColor = "red" ; java.util.List < java.lang.String > changes = org.ovirt.engine.core.utils.ObjectIdentityChecker.getChangedFields ( jedi1 , jedi2 ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , changes.size ( ) , "Should be 1 changes" ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , command.getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( command.getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , command.getClass ( ) . getName ( ) ) ; } }

Target:
public void run ( ) { log.info ( "Rollback for command '{}'" , command.getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( command.getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.error ( "Failed to cancel tasks for command '{}'" , command.getClass ( ) . getName ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean canDoAction ( ) { loadStorageDomain ( ) ; if ( ! ( org.ovirt.engine.core.bll.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( storageDomain ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }
Source:
private void writeLogEvent ( java.lang.String name , java.lang.String value ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmWriter.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; _writer.writeStartElement ( fullNameSB.toString ( ) ) ; _writer.writeRaw ( value ) ; _writer.writeEndElement ( ) ; }

Target:
private void writeLogEvent ( java.lang.String name , java.lang.String value ) { java.lang.StringBuilder fullNameSB = new java.lang.StringBuilder ( org.ovirt.engine.core.utils.ovf.OvfVmWriter.EXPORT_ONLY_PREFIX ) ; fullNameSB.append ( name ) ; _writer.writeElement ( fullNameSB.toString ( ) , value ) ; }
Source:
public void mockDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForVdsGroupWithStatus ( CLUSTER_ID , VDSStatus.Up ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }

Target:
public void mockDbFacadeAndDao ( ) { vdsDao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDao.class ) ; org.mockito.Mockito.when ( vdsDao.getAllForClusterWithStatus ( CLUSTER_ID , VDSStatus.Up ) ) . thenReturn ( mockGetAllVdsForwithStatus ( VDSStatus.Up ) ) ; clusterUtils = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.utils.ClusterUtils.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( clusterUtils ) . getVdsDao ( ) ; }
Source:
public void GetUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s@%s" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }

Target:
public void getUserNameFromUser ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.aaa.DbUser u = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; u.setLoginName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; u.setDomain ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) ; b.setCurrentUser ( u ) ; final java.lang.String un = b.getUserName ( ) ; org.junit.Assert.assertEquals ( java.lang.String.format ( "%s@%s" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.DOMAIN ) , un ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetPermissionsByAdElementId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , setUpPermissions ( ) , failure ) ; control.replay ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.String , java.lang.String > glusterServers = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = getGlusterUtils ( ) . getUpServer ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) ) ; if ( upServer != null ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; glusterServers = getAddedGlusterServers ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( returnValue.getReturnValue ( ) ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getQueryReturnValue ( ) . setReturnValue ( glusterServers ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.String , java.lang.String > glusterServers = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.common.businessentities.VDS upServer = glusterUtil.getUpServer ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getParameters ( ) . getClusterId ( ) ) ; if ( upServer != null ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( upServer.getId ( ) ) ) ; glusterServers = getAddedGlusterServers ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > ) ( returnValue.getReturnValue ( ) ) ) ) ; } org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQuery.getQueryReturnValue ( ) . setReturnValue ( glusterServers ) ; }
Source:
public void onPowerringUp ( ) { decreasePendingVm ( vmStaticDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }

Target:
protected void endExecutionMonitoring ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( vmDynamicDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; executionHandler.endJob ( executionContext , true ) ; } else { super . endExecutionMonitoring ( ) ; } }
Source:
protected void setUpGetPayloadExpectations ( int times ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
private void updateOptions ( ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; if ( ( getEntity ( ) ) != null ) { startProgress ( null ) ; updateOptionsData ( ) ; } }

Target:
public void updateOptions ( ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; if ( ( getEntity ( ) ) != null ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmDiskList ( 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 ) { updateOptionsPostData ( ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ) ; } } ) , getEntity ( ) . getId ( ) ) ; } }
Source:
public java.lang.StringBuilder GetTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , gettag_name ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( org.ovirt.engine.core.compat.StringFormat.format ( ",%1$s" , tag.GetTagNameAndChildrenNames ( ) ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder GetTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.tags tag : _children ) { builder.append ( ( "," + ( tag.GetTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }
Source:
public void checkMissingIpAddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }

Target:
public void checkMissingIpv4AddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv4ConfigurationDetails ( Ipv4BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter retval = null ; if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.TYPE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.StorageType.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.STATUS.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) { retval = new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return retval ; }
Source:
public void setCollapseSnapshot ( org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshotsModel ) { this . collapseSnapshots = collapseSnapshotsModel ; collapseSnapshots.getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setVolumeType ( VolumeType.Sparse ) ; } } ) ; }

Target:
public void setCollapseSnapshot ( org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshotsModel ) { if ( ! ( ( java.lang.Boolean ) ( collapseSnapshotsModel.getEntity ( ) ) ) ) { setSelectedVolumeType ( getVolumeType ( ) ) ; } this . collapseSnapshots = collapseSnapshotsModel ; }
Source:
private org.ovirt.engine.core.common.businessentities.StoragePool 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.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; storagePool.setstatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool 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.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( storagePoolId ) ; storagePool.setcompatibility_version ( compatibilityVersion ) ; storagePool.setStatus ( StoragePoolStatus.Up ) ; org.mockito.Mockito.when ( storagePoolDAO.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; return storagePool ; }
Source:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < java.lang.Object > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage_pool a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_pool > Cast ( getSelectedItems ( ) ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }

Target:
protected java.lang.Object [ ] getSelectedKeys ( ) { if ( ( getSelectedItems ( ) ) == null ) { return new java.lang.Object [ 0 ] ; } else { java.util.ArrayList < java.lang.Object > objL = new java.util.ArrayList < java.lang.Object > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StoragePool a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StoragePool > cast ( getSelectedItems ( ) ) ) { objL.add ( a.getId ( ) ) ; } return objL.toArray ( new java.lang.Object [ ] { } ) ; } }
Source:
public void shouldDetectInvalidHostOsIdentifier ( ) { newHost1.setHostOs ( "which OS am I?" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM ) ) , org.hamcrest.Matchers.not ( org.hamcrest.CoreMatchers.equalTo ( ValidationResult.VALID ) ) ) ; }

Target:
public void shouldDetectInvalidHostOsIdentifier ( ) { newHost1.setHostOs ( "which OS am I?" ) ; org.assertj.core.api.Assertions.assertThat ( validator.isUpgradePossible ( java.util.Arrays.asList ( newHost1 , newHost2 ) , java.util.Arrays.asList ( validVM ) ) ) . isNotEqualTo ( ValidationResult.VALID ) ; }
Source:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }