auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; 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 ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsOldLabelWasRemovedValid ( ) { final java.lang.String removedLabelName = "lbl1" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( removedLabelName ) ) ; 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.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedLabels ( removedLabelName ) ) . addExistingInterfaces ( slave ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void assertNoDuplicateKeys ( java.lang.String filePath ) throws java.io.IOException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( filePath ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.DuplicatePropertyException exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + filePath ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }

Target:
public static void assertNoDuplicateKeys ( java.io.File file ) throws java.io.IOException { org.ovirt.engine.core.utils.NoDuplicateProperties props = new org.ovirt.engine.core.utils.NoDuplicateProperties ( ) ; try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ) { props.load ( is ) ; } catch ( org.ovirt.engine.core.utils.DuplicatePropertyException exception ) { org.junit.Assert.fail ( ( ( ( "Check for duplicate keys in " + ( file.getAbsolutePath ( ) ) ) + " failed: " ) + ( exception.getMessage ( ) ) ) ) ; } }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorages ( long storageSize , double storageSizeUsed ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > ( ) ; quotaStorages.add ( getQuotaStorage ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.UNLIMITED_STORAGE , 0 ) ) ; quotaStorages.add ( getQuotaStorage ( 50 , 5 ) ) ; quotaStorages.add ( getQuotaStorage ( storageSize , storageSizeUsed ) ) ; return quotaStorages ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > getQuotaStorages ( long storageSize , double storageSizeUsed ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.QuotaStorage > ( ) ; quotaStorages.add ( getQuotaStorage ( org.ovirt.engine.core.bll.quota.QuotaManagerTest.UNLIMITED_STORAGE , 0 ) ) ; quotaStorages.add ( getQuotaStorage ( 50 , 5 ) ) ; quotaStorages.get ( 0 ) . setStorageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quotaStorages.get ( 1 ) . setStorageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quotaStorages.add ( getQuotaStorage ( storageSize , storageSizeUsed ) ) ; return quotaStorages ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getDomainsDisksMap ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > domainsDisksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskImages ) { java.util.List < org.ovirt.engine.core.compat.Guid > domainIds = disk.getStorageIds ( ) ; for ( org.ovirt.engine.core.compat.Guid domainId : domainIds ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( domainId , disk , domainsDisksMap ) ; } } return domainsDisksMap ; }

Target:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > getDomainsDisksMap ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > domainsDisksMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskImages ) { java.util.List < org.ovirt.engine.core.compat.Guid > domainIds = disk.getStorageIds ( ) ; for ( org.ovirt.engine.core.compat.Guid domainId : domainIds ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( domainId , disk , domainsDisksMap ) ; } } return domainsDisksMap ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( ( storage.getAvailableDiskSize ( ) ) == null ) || ( ( storage.getAvailableDiskSize ( ) ) < 1 ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.AbstractFindStoragePopupView.messages.gigabytes ( "< 1" ) ; } return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.AbstractFindStoragePopupView.messages.gigabytes ( java.lang.String.valueOf ( storage.getAvailableDiskSize ( ) ) ) ; }

Target:
public java.lang.String getText ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( ( storage.getAvailableDiskSize ( ) ) == null ) || ( ( storage.getAvailableDiskSize ( ) ) < 1 ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.AbstractFindStoragePopupView.messages.gibibytes ( "< 1" ) ; } return org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.AbstractFindStoragePopupView.messages.gibibytes ( java.lang.String.valueOf ( storage.getAvailableDiskSize ( ) ) ) ; }
Source:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair = pairOf ( null , createVmInternalData ( ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.Up ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }

Target:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData > pair = pairOf ( createDbVm ( ) , createVmInternalData ( ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.Up ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }
Source:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate , vmTemplate.getstatus ( ) ) ; } vmTemplate.setstatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }

Target:
private static void SetVmTemplateStatus ( org.ovirt.engine.core.compat.Guid vmTemplateGuid , org.ovirt.engine.core.common.businessentities.VmTemplateStatus status , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . get ( vmTemplateGuid ) ; if ( vmTemplate != null ) { if ( compensationContext != null ) { compensationContext.snapshotEntityStatus ( vmTemplate , vmTemplate.getStatus ( ) ) ; } vmTemplate.setStatus ( status ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmTemplateDao ( ) . update ( vmTemplate ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.log.warnFormat ( "VmTemplateHandler::SetVmTemplateStatus: vmTemplate is null, not setting status '{0}' to vmTemplate" , status ) ; } }
Source:
public static void GetDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmInterfaceType GetDefaultNicType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { return org.ovirt.engine.core.common.businessentities.VmInterfaceType.pv ; }
Source:
public void testActivate ( ) { setUriInfo ( setUpActionExpectations ( ActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; org.junit.Assert.assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testActivate ( ) { setUriInfo ( setUpActionExpectations ( ActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void testGetAllVdsSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Host:" , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiVdsSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Hosts" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public void moveUnpluggedDiskVmUp ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }

Target:
public void moveUnpluggedDiskVmUp ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.init ( ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }
Source:
public void testAddNameSuppliedButNoId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setName ( "orcus" ) ; model.setDescription ( DESCRIPTIONS [ 0 ] ) ; setUpEntityQueryExpectations ( 1 , null ) ; setUpGetNetworksByDataCenterExpectations ( 1 , null ) ; setUpClusterExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUpActionExpectations ( VdcActionType.AttachNetworkToCluster , org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , true , true ) ; collection.add ( model ) ; }

Target:
private org.ovirt.engine.api.model.Network getModel ( int index ) { org.ovirt.engine.api.model.Network model = new org.ovirt.engine.api.model.Network ( ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; return model ; }
Source:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.common.utils.ConsoleUtils.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.common.utils.ConsoleManager.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
protected void configure ( ) { super . configure ( ) ; bind ( org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemMessagesTranslator.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.section.login.presenter.ConnectAutomaticallyProvider.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.userportal.utils.ConnectAutomaticallyManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.ConsoleUtils.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleUtilsImpl.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.uicommonweb.ConsoleManager.class ) . to ( org.ovirt.engine.ui.common.utils.ConsoleManagerImpl.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
private void addInlineStatistics ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( resolver , newModel ( vm.getId ( ) ) ) ; org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Vm , org.ovirt.engine.core.common.businessentities.VM > statisticsResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , query ) ) ; org.ovirt.engine.api.model.Statistics statistics = statisticsResource.list ( ) ; vm.setStatistics ( statistics ) ; }

Target:
private void addInlineStatistics ( org.ovirt.engine.api.model.Vm vm ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.VmStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.VmStatisticalQuery ( resolver , newModel ( vm.getId ( ) ) ) ; org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Vm , org.ovirt.engine.core.common.businessentities.VM > statisticsResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource ( entityType , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( vm.getId ( ) ) , query ) ) ; org.ovirt.engine.api.model.Statistics statistics = statisticsResource.list ( ) ; vm.setStatistics ( statistics ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "OS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmOsType.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VMStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmType.class ) ; } else if ( "QUOTA" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.NullableStringAutoCompleter ( ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "OS" . equals ( fieldName ) ) { return org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.searchbackend.OsValueAutoCompleter.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VMStatus.class ) ; } else if ( "TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VmType.class ) ; } else if ( "QUOTA" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.NullableStringAutoCompleter ( ) ; } return null ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( bckndCmdParams.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( getVds ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; revealDiskPanel ( disk ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { boolean isAttach = ( ( java.lang.Boolean ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) . getEntity ( ) ) ) ; createDiskPanel.setVisible ( ( ! isAttach ) ) ; attachDiskPanel.setVisible ( isAttach ) ; if ( ( ! isAttach ) && ( ! ( isNewLunDiskEnabled ) ) ) { disk.getIsInternal ( ) . setEntity ( true ) ; } revealDiskPanel ( disk ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > > groupTasksByRootCommandId ( java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > tasksInDB ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > > rootCommandIdToCommandsMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks task : tasksInDB ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( task.getRootCommandId ( ) , task , rootCommandIdToCommandsMap ) ; } return rootCommandIdToCommandsMap ; }

Target:
private static boolean hasEmptyVdsmId ( org.ovirt.engine.core.common.businessentities.AsyncTask task ) { return Guid.Empty.equals ( task.getVdsmTaskId ( ) ) ; }
Source:
public void saveNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice netDevice = generateNewEntity ( ) ; netDevice.setCapability ( "net" ) ; netDevice.setNetworkInterfaceName ( "eth1" ) ; dao.save ( netDevice ) ; org.ovirt.engine.core.common.businessentities.HostDevice result = dao.get ( netDevice.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( netDevice , result ) ; }

Target:
public void saveNetworkDevice ( ) { org.ovirt.engine.core.common.businessentities.HostDevice netDevice = generateNewEntity ( ) ; netDevice.setCapability ( "net" ) ; netDevice.setNetworkInterfaceName ( "eth1" ) ; dao.save ( netDevice ) ; org.ovirt.engine.core.common.businessentities.HostDevice result = dao.get ( netDevice.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( netDevice , result ) ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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 ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private void showPreviouslyShownDialog ( ) { getDiskModel ( ) . getEntity ( ) . updateBootableFrom ( parentModel.getAllCurrentDisks ( ) ) ; if ( ( getDiskModel ( ) . getEntity ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) { maybeLoadAttachableDisks ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) ( getDiskModel ( ) . getEntity ( ) ) ) ) ; } showDialog ( getDiskModel ( ) . getEntity ( ) ) ; }

Target:
private void showPreviouslyShownDialog ( ) { getDiskModel ( ) . getEntity ( ) . updateBootableFrom ( parentModel.getAllCurrentDisksModels ( ) ) ; if ( ( getDiskModel ( ) . getEntity ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) { maybeLoadAttachableDisks ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImagesAttachDiskModel ) ( getDiskModel ( ) . getEntity ( ) ) ) ) ; } showDialog ( getDiskModel ( ) . getEntity ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getAllCurrentDisks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel line : getItems ( ) ) { if ( line.isGhost ( ) ) { continue ; } res.add ( line.getDisk ( ) ) ; } return res ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > getAllCurrentDisks ( ) { if ( ( getItems ( ) ) == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > res = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.InstanceImageLineModel line : getItems ( ) ) { if ( line.isGhost ( ) ) { continue ; } res.add ( line.getDisk ( ) ) ; } return res ; }
Source:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }

Target:
private void initOsRepository ( ) { OsInfoPreferencesLoader.INSTANCE.init ( java.nio.file.FileSystems.getDefault ( ) . getPath ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getEtcDir ( ) . getAbsolutePath ( ) , org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.OsRepositoryConfDir ) ) ) ; OsRepositoryImpl.INSTANCE.init ( OsInfoPreferencesLoader.INSTANCE.getPreferences ( ) ) ; org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.utils.OsRepositoryImpl.INSTANCE ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; dbFacade.populateDwhOsInfo ( osRepository.getOsNames ( ) ) ; }
Source:
private void UpdateDomainInProblemData ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.debugFormat ( "domain {0} still in problem. vds: {1}" , domainId , vdsName ) ; _domainsInProblem.get ( domainId ) . add ( vdsId ) ; UpdateVdsInProblem ( domainId , vdsId ) ; }

Target:
private void DomainRecoveredFromProblem ( org.ovirt.engine.core.compat.Guid domainId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String vdsName ) { java.lang.String domainIdTuple = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ; org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( "Domain {0} recovered from problem. vds: {1}" , domainIdTuple , vdsName ) ; ClearVds ( vdsId , domainId ) ; _domainsInProblem.get ( domainId ) . remove ( vdsId ) ; if ( ( _domainsInProblem.get ( domainId ) . size ( ) ) == 0 ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.infoFormat ( ( "Domain {0} has recovered from problem. No active host in the DC is reporting it as" + " problematic, so clearing the domain recovery timer." ) , domainIdTuple ) ; _domainsInProblem.remove ( domainId ) ; ClearTimer ( domainId ) ; } }
Source:
public void testGetClusterByClusterPolicyId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > result = dao.getClustersByClusterPolicyId ( FixturesTool.CLUSTER_POLICY_EVEN_DISTRIBUTION ) ; java.util.List < org.ovirt.engine.core.compat.Guid > vdsGroupIdList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup group : result ) { vdsGroupIdList.add ( group.getId ( ) ) ; } org.junit.Assert.assertTrue ( vdsGroupIdList.contains ( FixturesTool.VDS_GROUP_RHEL6_ISCSI ) ) ; org.junit.Assert.assertTrue ( vdsGroupIdList.contains ( FixturesTool.VDS_GROUP_NO_RUNNING_VMS ) ) ; org.junit.Assert.assertTrue ( vdsGroupIdList.contains ( FixturesTool.VDS_GROUP_RHEL6_NFS ) ) ; }

Target:
public void testGetClusterByClusterPolicyId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getClustersByClusterPolicyId ( FixturesTool.CLUSTER_POLICY_EVEN_DISTRIBUTION ) ; java.util.List < org.ovirt.engine.core.compat.Guid > clusterIdList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster group : result ) { clusterIdList.add ( group.getId ( ) ) ; } org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_ISCSI ) ) ; org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_NO_RUNNING_VMS ) ) ; org.junit.Assert.assertTrue ( clusterIdList.contains ( FixturesTool.CLUSTER_RHEL6_NFS ) ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.ReportCommand addOpenReportCommand ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand ) { if ( openReportCommands.add ( reportCommand ) ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > items = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.IVdcQueryable > Cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ( ) ; UpdateReportCommandAvailability ( reportCommand , items ) ; return reportCommand ; } else { return null ; } }

Target:
private org.ovirt.engine.ui.uicommonweb.ReportCommand addOpenReportCommand ( org.ovirt.engine.ui.uicommonweb.ReportCommand reportCommand ) { if ( openReportCommands.add ( reportCommand ) ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > items = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.IVdcQueryable > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ( ) ; UpdateReportCommandAvailability ( reportCommand , items ) ; return reportCommand ; } else { return null ; } }
Source:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = dbFacade.getVdsGroupDAO ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( vdsGroup ) ; java.lang.String name = vdsGroup.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID , VdcObjectType.VdsGroups ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForCluster ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = dbFacade.getVdsGroupDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( vdsGroup ) ; java.lang.String name = vdsGroup.getname ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDAOTest.CLUSTER_ID , VdcObjectType.VdsGroups ) ) ) ; }
Source:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check job with step and no async task deleted" , ( ( dao.get ( new org.ovirt.engine.core.compat.Guid ( "54947df8-0e9e-4471-a2f9-9af509fb0002" ) ) ) == null ) ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }

Target:
public void deleteCompletedJobs ( ) throws java.text.ParseException { int sizeBeforeDelete = dao.getAll ( ) . size ( ) ; java.text.DateFormat df = new java.text.SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; java.util.Date dateToDelete = df.parse ( "2013-02-9 10:11:00" ) ; dao.deleteCompletedJobs ( dateToDelete , dateToDelete ) ; int sizeAfterDelete = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertTrue ( "Check job with step and no async task are not deleted" , ( ( dao.get ( new org.ovirt.engine.core.compat.Guid ( "54947df8-0e9e-4471-a2f9-9af509fb0002" ) ) ) != null ) ) ; org.junit.Assert.assertTrue ( "Check an entry was deleted" , ( sizeBeforeDelete > sizeAfterDelete ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , null , networkName , true , null , false , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; }

Target:
private void mockCalculateBaseNicWhenBaseNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) ) ) . thenReturn ( nic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( nic ) ; }
Source:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( new org.ovirt.engine.core.compat.Guid ( "99408929-82cf-4dc7-a532-9d998063fa95" ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) . getId ( ) , new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ) ; }

Target:
public void testGetVmsByInstanceTypeId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getVmsListByInstanceType ( new org.ovirt.engine.core.compat.Guid ( "99408929-82cf-4dc7-a532-9d998063fa95" ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) . getId ( ) , FixturesTool.VM_RHEL5_POOL_50 ) ; }
Source:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }

Target:
public void refreshHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { refreshCapabilities ( new java.util.concurrent.atomic.AtomicBoolean ( ) , vds ) ; } finally { if ( vds != null ) { updateDynamicData ( vds.getDynamicData ( ) ) ; updateNumaData ( vds ) ; monitoringStrategy.processHardwareCapabilities ( vds ) ; org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . handleVdsVersion ( vds.getId ( ) ) ; } } }
Source:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) == null ) { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "VM is null, not performing full endAction" ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; return ; } org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( false ) ; if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) ) == null ) { org.ovirt.engine.core.bll.StopVmCommandBase.log.warn ( "VM is null, not performing full endAction" ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; return ; } org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . setStatus ( VMStatus.Down ) ; snapshotDao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.StopVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.getVmDynamicDao ( ) . update ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getDynamicData ( ) ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.api.model.Permissions list ( ) { java.util.Set < org.ovirt.engine.api.model.Permission > permissions = new java.util.TreeSet ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.api.model.Permission > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( VdcQueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }

Target:
public org.ovirt.engine.api.model.Permissions list ( ) { java.util.Set < org.ovirt.engine.api.model.Permission > permissions = new java.util.TreeSet ( new org.ovirt.engine.api.restapi.resource.BackendAssignedPermissionsResource.PermissionsComparator ( ) ) ; java.util.List < org.ovirt.engine.api.model.Permission > directPermissions = getBackendCollection ( queryType , queryParams ) ; permissions.addAll ( directPermissions ) ; if ( queryType.equals ( QueryType.GetPermissionsForObject ) ) { permissions.addAll ( getInheritedPermissions ( ) ) ; } return mapCollection ( permissions ) ; }
Source:
public void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }