auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testStorageDomainMappings ( ) { org.junit.Assert.assertEquals ( LunStatus.FREE , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Free , null ) ) ; org.junit.Assert.assertEquals ( LunStatus.USED , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Used , null ) ) ; org.junit.Assert.assertEquals ( LunStatus.UNUSABLE , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Unusable , null ) ) ; }

Target:
public void testStorageDomainMappings ( ) { org.junit.jupiter.api.Assertions.assertEquals ( LunStatus.FREE , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Free , null ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LunStatus.USED , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Used , null ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( LunStatus.UNUSABLE , org.ovirt.engine.api.restapi.types.StorageLogicalUnitMapper.map ( org.ovirt.engine.core.common.businessentities.storage.LunStatus.Unusable , null ) ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateTemplate ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; updateOSValues ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateVirtioScsiAvailability ( ) ; updateTemplate ( ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Id" , "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Id" , "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
public void OnSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.StartProgress ( null ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model ) ; }

Target:
public void OnSaveNetworkConfig ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ( model.getProgress ( ) ) != null ) { return ; } model.StartProgress ( null ) ; setcurrentModel ( model ) ; new org.ovirt.engine.ui.uicommonweb.models.hosts.SaveNetworkConfigAction ( this , model , getEntity ( ) ) . execute ( ) ; }
Source:
public void labelInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( false ) ; org.junit.Assert.assertThat ( validator.labelInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }

Target:
public void labelInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( false ) ; org.hamcrest.MatcherAssert.assertThat ( validator.labelInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_LABEL_NOT_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }
Source:
public void getClusterListByName ( 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.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void testNotRemovingUsedPoolRecordIsUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 1 ) ; final org.ovirt.engine.core.bll.ValidationResult validationResult = new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) ; org.junit.Assert.assertThat ( validationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.StoragePool > emptyList ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.common.scheduling.VmOverheadCalculator vmOverheadCalculator , java.lang.String diskDescription ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( vmOverheadCalculator.getSnapshotMemorySizeInBytes ( vm ) ) ; image.setVolumeType ( org.ovirt.engine.core.bll.memory.MemoryUtils.storageTypeToMemoryVolumeType ( storageType ) ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; image.setContentType ( DiskContentType.MEMORY_DUMP_VOLUME ) ; image.setDiskDescription ( diskDescription ) ; return image ; }
Source:
public void newProfile ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.uicommonweb.models.CommonModel.getInstance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; final org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel profileModel = new org.ovirt.engine.ui.uicommonweb.models.profiles.NewVnicProfileModel ( this , ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) . getcompatibility_version ( ) ) ; setWindow ( profileModel ) ; initNetworkList ( profileModel ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.StoragePool getSelectedDc ( ) { org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.uicommonweb.models.CommonModel.getInstance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeSelectedDc = org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel.findAncestor ( SystemTreeItemType.DataCenter , treeSelectedItem ) ; return ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeSelectedDc.getEntity ( ) ) ) ; }
Source:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . 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 ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; } } ) ; }

Target:
protected void listenOnConsoleModelChangeEvent ( com.google.gwt.event.shared.EventBus eventBus , final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { eventBus.addHandler ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.getType ( ) , new org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.ConsoleModelChangedHandler ( ) { @ java.lang.Override public void onConsoleModelChanged ( org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent event ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupConsole ( modelProvider ) ; } } ) ; }
Source:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.Assert.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveSharedBeforeLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( StorageDomainStatus.Active , "local domain name" , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sharedDomain = createDataStorageDomain ( StorageDomainStatus.Active , "shared domain name" , SHARED_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( localDomain , sharedDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( sharedDomain , cmd.electNewMaster ( ) ) ; }
Source:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicOnNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void bootProtocolChanged ( ) { org.ovirt.engine.core.common.businessentities.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.None ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.Dhcp ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplates = org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllTemplatesRelatedToQuotaId ( org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplates ) { org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( vmTemplate ) ; } org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vmTemplates ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > vmTemplates = org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllTemplatesRelatedToQuotaId ( org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate : vmTemplates ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( vmTemplate ) ; } org.ovirt.engine.core.bll.GetTemplatesRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vmTemplates ) ; }
Source:
public javax.ws.rs.core.Response requestVm ( org.ovirt.optimizer.service.facts.RunningVm request , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { optimizer.computeVmStart ( cluster , request.getId ( ) ) ; return javax.ws.rs.core.Response.ok ( ) . header ( "Access-Control-Allow-Origin" , "*" ) . header ( "Access-Control-Allow-Methods" , "POST" ) . header ( "Access-Control-Allow-Headers" , "Content-Type" ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response requestVm ( org.ovirt.optimizer.solver.facts.RunningVm request , @ javax.ws.rs.PathParam ( value = "cluster" ) java.lang.String cluster ) { optimizer.computeVmStart ( cluster , request.getId ( ) ) ; return javax.ws.rs.core.Response.ok ( ) . header ( "Access-Control-Allow-Origin" , "*" ) . header ( "Access-Control-Allow-Methods" , "POST" ) . header ( "Access-Control-Allow-Headers" , "Content-Type" ) . build ( ) ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { 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.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testGetEntityPermissionsByUserAndGroups ( ) { org.junit.Assert.assertNotNull ( dbFacade.getEntityPermissionsForUserAndGroups ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.dao.DbFacadeDAOTest.DIRECTORY_ELEMENT_ID_WITH_BASIC_PERMISSIONS.toString ( ) , ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.DbFacadeDAOTest.VMT_ID , VdcObjectType.VM , false ) ) ; org.junit.Assert.assertNull ( dbFacade.getEntityPermissionsForUserAndGroups ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.dao.DbFacadeDAOTest.DIRECTORY_ELEMENT_ID_WITH_BASIC_PERMISSIONS.toString ( ) , ActionGroup.CREATE_TEMPLATE , org.ovirt.engine.core.dao.DbFacadeDAOTest.VMT_ID , VdcObjectType.VM , false ) ) ; }

Target:
public void testGetEntityPermissionsByUserAndGroups ( ) { org.junit.Assert.assertNotNull ( dbFacade.getEntityPermissionsForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.DbFacadeDAOTest.DIRECTORY_ELEMENT_ID_WITH_BASIC_PERMISSIONS.toString ( ) , ActionGroup.VM_BASIC_OPERATIONS , org.ovirt.engine.core.dao.DbFacadeDAOTest.VMT_ID , VdcObjectType.VM , false ) ) ; org.junit.Assert.assertNull ( dbFacade.getEntityPermissionsForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.dao.DbFacadeDAOTest.DIRECTORY_ELEMENT_ID_WITH_BASIC_PERMISSIONS.toString ( ) , ActionGroup.CREATE_TEMPLATE , org.ovirt.engine.core.dao.DbFacadeDAOTest.VMT_ID , VdcObjectType.VM , false ) ) ; }
Source:
public void canAddVm ( ) { java.util.List < java.lang.String > reasons = new java.util.ArrayList < > ( ) ; initCommandMethods ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( ) ; org.junit.Assert.assertTrue ( "vm could not be added" , cmd.canAddVm ( reasons , java.util.Collections.singletonList ( createStorageDomain ( ) ) ) ) ; }

Target:
public void canAddVm ( ) { java.util.List < java.lang.String > reasons = new java.util.ArrayList < > ( ) ; initCommandMethods ( ) ; cmd.init ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateCustomProperties ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) , org.mockito.ArgumentMatchers.anyListOf ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateSpaceRequirements ( ) ; org.junit.Assert.assertTrue ( "vm could not be added" , cmd.canAddVm ( reasons , java.util.Collections.singletonList ( createStorageDomain ( ) ) ) ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
protected boolean validateSpaceRequirements ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( diskImages ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.storage.export.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( diskImages ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( diskImages ) ) ; }

Target:
protected boolean validateSpaceRequirements ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( diskImages ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.exportimport.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( diskImages ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( diskImages ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE : org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getSucceeded ( ) ) { if ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) { org.ovirt.engine.core.common.AuditLogType customValue = ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ? org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_UP : org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_DOWN ; addCustomValue ( "LinkState" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( customValue ) ) ; } else { org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.addCustomValue ( "LinkState" , " " ) ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_FAILED ; }
Source:
public void Connect ( ) { org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.logger.warning ( "Connecting via spice..." ) ; if ( ( cat.os.equalsIgnoreCase ( "Linux" ) ) && ( cat.browser.equalsIgnoreCase ( "Firefox" ) ) ) { connectNativelyViaXPI ( ) ; } else if ( ( cat.os.equalsIgnoreCase ( "Windows" ) ) && ( cat.browser.equalsIgnoreCase ( "Explorer" ) ) ) { connectNativelyViaActiveX ( ) ; } }

Target:
public boolean detectBrowserPlugin ( ) { if ( configurator.isClientLinuxFirefox ( ) ) { return detectXpiPlugin ( ) ; } else if ( configurator.isClientWindownsExplorer ( ) ) { return detectActiveXPlugin ( ) ; } return false ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; if ( ( object.getVmEntityType ( ) ) == null ) { setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.constants.unattachedDisk ( ) ) ; return null ; } return object.getVmEntityType ( ) . isVmType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : object.getVmEntityType ( ) . isTemplateType ( ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }
Source:
public static void removeTaskFromDbByTaskId ( org.ovirt.engine.core.compat.Guid taskId ) { try { if ( ( org.ovirt.engine.core.bll.tasks.TaskManagerUtil.callRemoveTaskFromDbByTaskId ( taskId ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Removed task {0} from DataBase" , taskId ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.error ( java.lang.String.format ( "Removing task %1$s from DataBase threw an exception." , taskId ) , e ) ; } }

Target:
public static void removeTaskFromDbByTaskId ( org.ovirt.engine.core.compat.Guid taskId ) { try { if ( ( org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.callRemoveTaskFromDbByTaskId ( taskId ) ) != 0 ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Removed task '{}' from DataBase" , taskId ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.error ( "Removing task '{}' from DataBase threw an exception: {}" , taskId , e.getMessage ( ) ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.debug ( "Exception" , e ) ; } }
Source:
public void markAsValid ( ) { markValidation ( false , null ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . 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 ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }
Source:
public boolean isUpdateAvailable ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backendInternal.runInternalQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( host.getId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.RpmVersion > isos = returnValue.getReturnValue ( ) ; boolean updateAvailable = org.ovirt.engine.core.common.utils.RpmVersionUtils.isUpdateAvailable ( isos , host.getHostOs ( ) ) ; if ( updateAvailable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLog = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLog.setVds ( host ) ; auditLogDirector.log ( auditLog , AuditLogType.OVIRT_NODE_UPDATES_ARE_AVAILABLE ) ; } return updateAvailable ; }

Target:
public boolean isUpdateAvailable ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = backendInternal.runInternalQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( host.getId ( ) ) ) ; java.util.List < org.ovirt.engine.core.compat.RpmVersion > isos = returnValue.getReturnValue ( ) ; boolean updateAvailable = org.ovirt.engine.core.common.utils.RpmVersionUtils.isUpdateAvailable ( isos , host.getHostOs ( ) ) ; if ( updateAvailable ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLog = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLog.setVds ( host ) ; auditLogDirector.log ( auditLog , AuditLogType.HOST_UPDATES_ARE_AVAILABLE ) ; } return updateAvailable ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { ( sucessCount ) ++ ; if ( ( ( toAddList.size ( ) ) > 0 ) && ( ( sucessCount ) == ( toRemoveList.size ( ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( ActionType.AddEventSubscription , toAddList ) ; } } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { ( sucessCount ) ++ ; if ( ( ( toAddList.size ( ) ) > 0 ) && ( ( sucessCount ) == ( toRemoveList.size ( ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( ActionType.AddEventSubscription , toAddList ) ; } } }
Source:
public static void GetDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit ) , aQuery ) ; }

Target:
public static void IsUSBEnabledByDefault ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.EnableUSBAsDefault ) , aQuery ) ; }
Source:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangable ( ( ! ( isAutoSelect ) ) ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangable ( ( ! value ) ) ; } }

Target:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangeable ( ( ! ( isAutoSelect ) ) ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangeable ( ( ! value ) ) ; } }
Source:
int doGenerateMaxLength ( int maxNameLengt , int poolNameLength ) { int allowedLength = ( maxNameLengt - poolNameLength ) - 1 ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( "" ) ; if ( allowedLength == 0 ) { return 0 ; } for ( int i = 0 ; i < allowedLength ; i ++ ) { sb.append ( "9" ) ; } return java.lang.Integer.parseInt ( sb.toString ( ) ) ; }

Target:
private int getMaxNumberInNDigits ( int numberOfDigits ) { return ( ( int ) ( ( java.lang.Math.pow ( 10 , numberOfDigits ) ) - 1 ) ) ; }
Source:
protected static < T > java.util.List < T > merge ( java.util.List < T > list , java.util.List < T > items ) { if ( list != null ) { if ( items != null ) { for ( T item : items ) { if ( ! ( list.contains ( item ) ) ) { list.add ( item ) ; } } } } else { return items ; } return list ; }

Target:
public static < T > java.util.Set < T > merge ( java.util.Set < T > list , java.util.Set < T > items ) { if ( list != null ) { if ( items != null ) { list.addAll ( items ) ; } } else { return items ; } return list ; }
Source:
public static void getDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , vds.getId ( ) , vds.getName ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed to refresh VDS, network error, continuing, vds='{}'({}): {}" , vds.getName ( ) , vds.getId ( ) , e.getMessage ( ) ) ; } org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; }
Source:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setStatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , existingStoragePoolIsoMap.getstorage_pool_id ( ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
private org.ovirt.engine.api.model.API addSystemVersion ( org.ovirt.engine.api.model.API api ) { java.lang.String productVersion = getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.ProductRPMVersion ) ; org.ovirt.engine.core.branding.BrandingManager obrand = org.ovirt.engine.core.branding.BrandingManager.getInstance ( ) ; api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( obrand.getMessage ( "obrand.backend.product" ) ) ; api.getProductInfo ( ) . setVendor ( obrand.getMessage ( "obrand.backend.vendor" ) ) ; api.getProductInfo ( ) . setFullVersion ( productVersion ) ; api.getProductInfo ( ) . setVersion ( getVersion ( ) ) ; return api ; }

Target:
private org.ovirt.engine.api.model.Api addSystemVersion ( org.ovirt.engine.api.model.Api api ) { java.lang.String productVersion = getConfigurationValueDefault ( java.lang.String.class , ConfigurationValues.ProductRPMVersion ) ; org.ovirt.engine.core.branding.BrandingManager obrand = org.ovirt.engine.core.branding.BrandingManager.getInstance ( ) ; api.setProductInfo ( new org.ovirt.engine.api.model.ProductInfo ( ) ) ; api.getProductInfo ( ) . setName ( obrand.getMessage ( "obrand.backend.product" ) ) ; api.getProductInfo ( ) . setVendor ( obrand.getMessage ( "obrand.backend.vendor" ) ) ; api.getProductInfo ( ) . setFullVersion ( productVersion ) ; api.getProductInfo ( ) . setVersion ( getVersion ( ) ) ; return api ; }
Source:
private void mockGetForDisk ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; vms.add ( vm ) ; java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid ) ) . thenReturn ( vmsMap ) ; }

Target:
private void mockGetForDisk ( org.ovirt.engine.core.common.businessentities.VM vm ) { mockGetForDisk ( java.util.Collections.singletonList ( vm ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) { return constants.currentSnapshotLabel ( ) ; } com.google.gwt.i18n.client.DateTimeFormat format = com.google.gwt.i18n.client.DateTimeFormat.getFormat ( "yyyy-MMM-dd, HH:mm:ss" ) ; return format.format ( snapshot.getCreationDate ( ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { if ( ( snapshot.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.ACTIVE ) ) { return constants.currentSnapshotLabel ( ) ; } return org.ovirt.engine.ui.common.widget.renderer.FullDateTimeRenderer.getLocalizedDateTimeFormat ( ) . format ( snapshot.getCreationDate ( ) ) ; }
Source:
public java.lang.String render ( java.lang.Boolean bool ) { if ( ( ( trueText ) == null ) || ( ( falseText ) == null ) ) { return bool.toString ( ) ; } return ( bool != null ) && ( bool.booleanValue ( ) ) ? trueText : falseText ; }

Target:
public java.lang.String render ( java.lang.Boolean valueToRender ) { if ( valueToRender == null ) { return "" ; } if ( ( ( trueText ) == null ) || ( ( falseText ) == null ) ) { return valueToRender.toString ( ) ; } return valueToRender.booleanValue ( ) ? trueText : falseText ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { createParameters ( srcStorageId , srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.name ( ) ) ) ; }

Target:
public void validateSameSourceAndDest ( ) throws java.lang.Exception { createParameters ( srcStorageId , srcStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.name ( ) ) ) ; }
Source:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; junit.framework.Assert.assertEquals ( numOfEntries , 3 ) ; java.lang.String [ ] entries = result.getAddresses ( ) ; for ( java.lang.String entry : entries ) { java.lang.System.out.println ( entry ) ; } }

Target:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList , "example.com" ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; junit.framework.Assert.assertEquals ( numOfEntries , 3 ) ; java.lang.String [ ] entries = result.getAddresses ( ) ; for ( java.lang.String entry : entries ) { java.lang.System.out.println ( entry ) ; } }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }