auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void latchedRunnableWrapperTest ( ) { final int threadsNumber = 100 ; runThreads ( threadsNumber , new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.RunnableCreator ( ) { @ java.lang.Override public java.lang.Runnable createRunnable ( ) { return new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.DummyRunnable ( ) ; } } ) ; org.junit.Assert.assertEquals ( threadsNumber , counter.intValue ( ) ) ; }

Target:
public void regularExecution ( ) { prepareMocks ( org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.THREADS_NUMBER ) ; latchedRunnableExecuter.execute ( ) ; org.junit.Assert.assertEquals ( "the counter wasn't incremented the expected number of times" , org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.THREADS_NUMBER , counter.intValue ( ) ) ; verifyCommonExecutionChecks ( ) ; }
Source:
public void testGetAllOfTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfTypes ( new org.ovirt.engine.core.common.businessentities.VDSType [ ] { org.ovirt.engine.core.common.businessentities.VDSType.VDS } ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( VDSType.VDS , vds.getvds_type ( ) ) ; } }

Target:
public void testGetAllOfTypes ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllOfTypes ( new org.ovirt.engine.core.common.businessentities.VDSType [ ] { org.ovirt.engine.core.common.businessentities.VDSType.VDS } ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( VDSType.VDS , vds.getVdsType ( ) ) ; } }
Source:
public void setConsoleAddressPartiallyOverridden ( java.lang.Boolean consoleAddressPartiallyOverridden ) { if ( ( ( this . consoleAddressPartiallyOverridden ) == null ? false : this . consoleAddressPartiallyOverridden.booleanValue ( ) ) != ( consoleAddressPartiallyOverridden == null ? false : consoleAddressPartiallyOverridden.booleanValue ( ) ) ) { this . consoleAddressPartiallyOverridden = consoleAddressPartiallyOverridden ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "consoleAddressPartiallyOverridden" ) ) ; } }

Target:
public void setConsoleAddressPartiallyOverridden ( java.lang.Boolean consoleAddressPartiallyOverridden ) { if ( ( isConsoleAddressPartiallyOverridden ( ) . booleanValue ( ) ) != ( consoleAddressPartiallyOverridden == null ? false : consoleAddressPartiallyOverridden.booleanValue ( ) ) ) { this . consoleAddressPartiallyOverridden = consoleAddressPartiallyOverridden ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "consoleAddressPartiallyOverridden" ) ) ; } }
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 getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity ) ( source ) ) ; } } ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
private void mockSpiceSupportMatrix ( ) { java.util.Map < java.lang.Integer , java.util.Map < org.ovirt.engine.core.compat.Version , java.lang.Boolean > > supportMatrix = new java.util.HashMap < > ( ) ; java.util.HashMap < org.ovirt.engine.core.compat.Version , java.lang.Boolean > chunk = new java.util.HashMap < > ( ) ; chunk.put ( Version.v3_1 , true ) ; supportMatrix.put ( 0 , chunk ) ; org.mockito.Mockito.when ( osRepository.getSpiceSupportMatrix ( ) ) . thenReturn ( supportMatrix ) ; }

Target:
protected void mockInterfaceList ( ) { java.util.ArrayList < java.lang.String > diskInterfaces = new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( new java.lang.String [ ] { "IDE" , "VirtIO" , "VirtIO_SCSI" } ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( diskInterfaces ) ; }
Source:
private java.util.List < java.lang.String > getMountPointsFilter ( ) { return java.util.Arrays.asList ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GlusterStorageDeviceListMountPointsToIgore ) . split ( "," ) ) ; }

Target:
private java.lang.String getMountPointsFilterPattern ( ) { java.lang.String [ ] mountPointsToIgnore = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.GlusterStorageDeviceListMountPointsToIgnore ) . split ( "," ) ; java.lang.StringBuilder pattern = new java.lang.StringBuilder ( ) ; for ( java.lang.String mointPoint : mountPointsToIgnore ) { pattern.append ( "^" ) ; pattern.append ( mointPoint ) ; pattern.append ( "$" ) ; pattern.append ( "|" ) ; } return pattern.toString ( ) ; }
Source:
public void onSuccessReturnValueOk ( ) { mockExecutor ( agent1 , true ) ; mockCheckStatus ( "on" ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; java.lang.Object commandReturnValue = command.getActionReturnValue ( ) ; org.junit.Assert.assertNotNull ( commandReturnValue ) ; org.junit.Assert.assertTrue ( ( commandReturnValue instanceof org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue commandReturnValueCasted = ( ( org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) ( commandReturnValue ) ) ; org.junit.Assert.assertEquals ( commandReturnValueCasted.getFenceAgentUsed ( ) , agent1 ) ; }

Target:
public void onSuccessReturnValueOk ( ) { mockExecutor ( true ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getSucceeded ( ) ) ; java.lang.Object commandReturnValue = command.getActionReturnValue ( ) ; org.junit.Assert.assertNotNull ( commandReturnValue ) ; org.junit.Assert.assertTrue ( ( commandReturnValue instanceof org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult commandReturnValueCasted = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( commandReturnValue ) ) ; org.junit.Assert.assertEquals ( Status.SUCCESS , commandReturnValueCasted.getStatus ( ) ) ; }
Source:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getoption_name ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.error ( "Not refreshing field '{}': does not exist in class {}." , option.getoption_name ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }

Target:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getOptionName ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.error ( "Not refreshing field '{}': does not exist in class {}." , option.getOptionName ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }
Source:
public boolean disconnectStorageFromDomainByVdsId ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.Provider provider = getProviderDao ( ) . get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( storageDomain.getStorage ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getLibvirtSecretDao ( ) . getAllByProviderId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = getVdsDao ( ) . get ( vdsId ) ; return unregisterLibvirtSecrets ( storageDomain , vds , libvirtSecrets ) ; }

Target:
public boolean disconnectStorageFromDomainByVdsId ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.compat.Guid vdsId ) { org.ovirt.engine.core.common.businessentities.Provider provider = providerDao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( storageDomain.getStorage ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByProviderId ( provider.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( vdsId ) ; return unregisterLibvirtSecrets ( storageDomain , vds , libvirtSecrets ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) ) ) { org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_pool > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( dataCenter.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) ) ) { org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_pool > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( dataCenter.getId ( ) ) ) ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addNetworkInterfaceDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , java.util.Collections.< java.lang.String , java.lang.Object > emptyMap ( ) , plugged , false , null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addInterface ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , boolean plugged , boolean hostDev , java.lang.String address ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.INTERFACE , ( hostDev ? org.ovirt.engine.core.common.utils.VmDeviceType.HOST_DEVICE : org.ovirt.engine.core.common.utils.VmDeviceType.BRIDGE ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , plugged , false , address , null , false ) ; }
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.Quota , org.ovirt.engine.ui.uicommonweb.models.quota.QuotaListModel > modelProvider , org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.quotaMainTabPlace ) ; return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getPrimaryPriority ( ) , modelProvider , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.quotaMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.GlusterBrick doPopulate ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { return model ; }

Target:
private org.ovirt.engine.api.model.GlusterBrick populateAdvancedDetails ( org.ovirt.engine.api.model.GlusterBrick model , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity entity ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class , VdcQueryType.GetGlusterVolumeById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entity.getVolumeId ( ) ) , null , true ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails detailsEntity = getEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , VdcQueryType.GetGlusterVolumeAdvancedDetails , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( volumeEntity.getClusterId ( ) , volumeEntity.getName ( ) , entity.getQualifiedName ( ) , true ) , null , true ) ; model = getMapper ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeAdvancedDetails.class , org.ovirt.engine.api.model.GlusterBrick.class ) . map ( detailsEntity , model ) ; return model ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate before = dbFacade.getVmTemplateDAO ( ) . get ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( before ) ; dao.remove ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.ovirt.engine.core.common.businessentities.VmTemplate after = dbFacade.getVmTemplateDAO ( ) . get ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.junit.Assert.assertNull ( after ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate before = dbFacade.getVmTemplateDao ( ) . get ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.junit.Assert.assertNotNull ( before ) ; dao.remove ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.ovirt.engine.core.common.businessentities.VmTemplate after = dbFacade.getVmTemplateDao ( ) . get ( org.ovirt.engine.core.dao.VmTemplateDAOTest.DELETABLE_TEMPLATE_ID ) ; org.junit.Assert.assertNull ( after ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testGetLunsThatBreakDiscardAfterDeleteSupportStorageDomainDiscardAfterDeleteDisabled ( ) { storageDomain.setDiscardAfterDelete ( false ) ; assertGetLunsThatBreakDiscardAfterDeleteSupportContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 1024L ) , createLunWithDiscardSupport ( 0L ) ) , java.util.Collections.emptyList ( ) ) ; }
Source:
private void additemToRootNodePanel ( com.google.gwt.user.client.ui.HorizontalPanel panel , org.ovirt.engine.ui.common.widget.label.TextBoxLabel item , java.lang.String text , java.lang.String width , com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment align ) { item.getElement ( ) . getStyle ( ) . setBackgroundColor ( "transparent" ) ; item.getElement ( ) . getStyle ( ) . setColor ( "black" ) ; item.setAlignment ( align ) ; item.setText ( text ) ; panel.add ( item ) ; panel.setCellWidth ( item , width ) ; }

Target:
private void additemToRootNodePanel ( com.google.gwt.user.client.ui.HorizontalPanel panel , org.ovirt.engine.ui.common.widget.label.StringValueLabel item , java.lang.String text , java.lang.String width , com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment align ) { item.getElement ( ) . getStyle ( ) . setBackgroundColor ( "transparent" ) ; item.getElement ( ) . getStyle ( ) . setColor ( "black" ) ; item.setValue ( text ) ; panel.add ( item ) ; panel.setCellWidth ( item , width ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmPayload getPayloadModel ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; payload.setType ( VmDeviceType.CDROM ) ; payload.setContent ( org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.PAYLOAD_COMTENT ) ; payload.setContent ( new java.lang.String ( org.apache.commons.codec.binary.Base64.decodeBase64 ( payload.getContent ( ) ) ) ) ; return payload ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmPayload getPayloadModel ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; payload.setType ( VmDeviceType.CDROM ) ; payload.getFiles ( ) . put ( "payloadFile" , new java.lang.String ( org.apache.commons.codec.binary.Base64.decodeBase64 ( org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.PAYLOAD_COMTENT ) ) ) ; return payload ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLunsFromDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = setUpLuns ( false ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : luns ) { java.util.HashMap < java.lang.String , java.lang.Boolean > pathsDictionary = new java.util.HashMap < java.lang.String , java.lang.Boolean > ( ) ; pathsDictionary.put ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.PHYSICAL_DEVICE_FIELD , true ) ; lun.setPathsDictionary ( pathsDictionary ) ; } return luns ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLunsFromDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.setUpLuns ( false ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : luns ) { java.util.HashMap < java.lang.String , java.lang.Boolean > pathsDictionary = new java.util.HashMap < java.lang.String , java.lang.Boolean > ( ) ; pathsDictionary.put ( org.ovirt.engine.core.bll.GetLunsByVgIdQueryTest.PHYSICAL_DEVICE_FIELD , true ) ; lun.setPathsDictionary ( pathsDictionary ) ; } return luns ; }
Source:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; if ( callback != null ) { callback.executed ( new org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult ( actionType , parameters , null , state ) ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
private void fireAsyncQuerySucceededEvent ( java.lang.Object target ) { org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , target , false , true ) ; }
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getVmNicList ( 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 ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public int getfreeDiskPercent ( ) { java.lang.Integer usedDiskSizeObj = getused_disk_size ( ) ; java.lang.Integer availableDiskSizeObj = getavailable_disk_size ( ) ; int usedDiskSize = ( usedDiskSizeObj == null ) ? 0 : usedDiskSizeObj ; int availableDiskSize = ( availableDiskSizeObj == null ) ? 0 : availableDiskSizeObj ; int sum = usedDiskSize + availableDiskSize ; int val = ( sum == 0 ) ? 0 : 100 - ( ( usedDiskSize * 100 ) / sum ) ; return val ; }

Target:
public double getfreeDiskPercent ( ) { int usedDiskSize = ( ( getused_disk_size ( ) ) == null ) ? 0 : getused_disk_size ( ) ; int availableDiskSize = ( ( getavailable_disk_size ( ) ) == null ) ? 0 : getavailable_disk_size ( ) ; double totalSize = usedDiskSize + availableDiskSize ; return totalSize != 0 ? ( availableDiskSize / totalSize ) * 100 : 0.0 ; }
Source:
public org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.common.VdcObjectType entityType , org.ovirt.engine.core.compat.Guid ... entityIds ) { return super . createTask ( taskId , asyncTaskCreationInfo , parentCommand , entityType , entityIds ) ; }

Target:
private boolean isMoveDiskInDbSucceded ( org.ovirt.engine.core.compat.Guid targetStorageDomainId ) { org.ovirt.engine.core.compat.Guid destinationImageId = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getDiskImageDao ( ) . get ( destinationImageId ) ; return ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; }
Source:
public void testUpdateVolumeStatus ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertFalse ( volume.equals ( existingDistVol ) ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }

Target:
public void testUpdateVolumeStatus ( ) { org.junit.Assert.assertTrue ( existingDistVol.isOnline ( ) ) ; dao.updateVolumeStatus ( existingDistVol.getId ( ) , GlusterStatus.DOWN ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = dao.getById ( existingDistVol.getId ( ) ) ; org.junit.Assert.assertNotNull ( volume ) ; org.junit.Assert.assertFalse ( volume.isOnline ( ) ) ; org.junit.Assert.assertNotEquals ( volume , existingDistVol ) ; existingDistVol.setStatus ( GlusterStatus.DOWN ) ; org.junit.Assert.assertEquals ( existingDistVol , volume ) ; }
Source:
public void setup ( ) { }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public void setInSlot ( java.lang.Object slot , com.gwtplatform.mvp.client.PresenterWidget < ? > content ) { super . setInSlot ( slot , content ) ; if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) { onRevealOverlayContent ( new org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent ( null ) ) ; } }

Target:
public < T extends com.gwtplatform.mvp.client.PresenterWidget < ? > > void setInSlot ( com.gwtplatform.mvp.client.presenter.slots.IsSlot < T > slot , T content ) { super . setInSlot ( slot , content ) ; if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.MainContentPresenter.TYPE_SetContent ) ) { onRevealOverlayContent ( new org.ovirt.engine.ui.webadmin.section.main.presenter.RevealOverlayContentEvent ( null ) ) ; } }
Source:
private static void updateDisksStorage ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disksList ) { disk.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( storageDomain.getId ( ) ) ) ) ; } org.ovirt.engine.core.bll.VmHandler.updateDiskVolumeType ( storageDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; }

Target:
private static boolean addDeviceUpdateOnNextRun ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.EditableDeviceOnVmStatusField annotation , java.lang.Object key , java.lang.Object value , java.util.List < org.ovirt.engine.core.common.utils.VmDeviceUpdate > updates ) { return org.ovirt.engine.core.bll.VmHandler.addDeviceUpdateOnNextRun ( vmId , annotation.generalType ( ) , annotation.type ( ) , annotation.isReadOnly ( ) , key , value , updates ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , getEntity ( 0 ) ) ; setUpGetStorageServerConnectionExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.StorageDomain model = org.ovirt.engine.api.restapi.resource.BackendStorageDomainsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void testCanDoAction ( ) { expectGetStoragePool ( STORAGE_POOL_ID ) ; expectGetStorageDomain ( STORAGE_DOMAIN_ID , STORAGE_POOL_ID , StorageDomainType.Data , StorageType.NFS ) ; expectGetVds ( VDS_ID ) ; expectGetIsoMap ( STORAGE_DOMAIN_ID ) ; expectBusinessEntitySnapshotDAO ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand < org.ovirt.engine.core.common.action.RemoveStorageDomainParameters > cmd = createCommand ( true ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( cmd , false ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessages ( cmd , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN , VdcBllMessages.VAR__ACTION__REMOVE ) ; }

Target:
public void testCanDoAction ( ) { expectGetStoragePool ( STORAGE_POOL_ID ) ; expectGetStorageDomain ( STORAGE_DOMAIN_ID , STORAGE_POOL_ID , StorageDomainType.Data , StorageType.NFS ) ; expectGetVds ( VDS_ID ) ; expectGetIsoMap ( STORAGE_DOMAIN_ID ) ; expectBusinessEntitySnapshotDAO ( ) ; org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand < org.ovirt.engine.core.common.action.RemoveStorageDomainParameters > cmd = createCommand ( true ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( cmd , false ) ; org.junit.Assert.assertEquals ( "Wrong number of messages" , 0 , cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . size ( ) ) ; }
Source:
public static void EnableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "PerformLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isActive ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }

Target:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) . isPlugged ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }
Source:
public void InitTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; }

Target:
public void initTest ( ) { mockCpuFlagsManagerHandler ( ) ; mockOsRepository ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class , dbFacade ) ; org.mockito.Mockito.doReturn ( deviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.init ( ) ; }
Source:
public void testFaultyMultipathReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.Assert.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.FAULTY_MULTIPATHS_ON_HOST ) ) ; }

Target:
public void testFaultyMultipathReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.FAULTY_MULTIPATHS_ON_HOST ) ) ; }
Source:
public void testIsNotLocalFsWithDefaultClusterWhenClusterIsDefault ( ) { storagePool.setIsLocal ( true ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . containsDefaultCluster ( ) ; org.ovirt.engine.core.bll.ValidationResult result = validator.isNotLocalfsWithDefaultCluster ( ) ; org.junit.Assert.assertFalse ( result.isValid ( ) ) ; org.ovirt.engine.core.bll.storage.StoragePoolValidatorTest.assertMessage ( result , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ; }

Target:
public void testIsNotLocalFsWithDefaultClusterWhenClusterIsDefault ( ) { storagePool.setIsLocal ( true ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . containsDefaultCluster ( ) ; org.junit.Assert.assertThat ( validator.isNotLocalfsWithDefaultCluster ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > getStoragePoolTypeList ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.StorageType [ ] { org.ovirt.engine.core.common.businessentities.StorageType.NFS , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , org.ovirt.engine.core.common.businessentities.StorageType.FCP , org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS , org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS , org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS } ) ) ; }

Target:
public static void initOsArchitecture ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osArchitectures = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetOsArchitectures ) , callback ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }

Target:
public static void GetAllProviders ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public void validateVdsIsNotUp ( ) { org.mockito.Mockito.when ( hostValidator.hostExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( hostValidator.isUp ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ) ; org.junit.Assert.assertFalse ( command.validateVds ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; }

Target:
public void validateVdsIsNotUp ( ) { org.mockito.Mockito.when ( hostValidator.hostExists ( ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( hostValidator.isUp ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validateVds ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; }
Source:
public void testDatabaseEntries ( ) throws java.lang.Exception { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( java.util.Collections.singletonList ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.FilterEntry ( "message0" , false , "smtp" , "dbtest1@redhat.com" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message0" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; org.ovirt.engine.core.notifier.filter.AuditLogEvent event = smtp.getEvents ( ) . get ( 0 ) ; java.lang.String address = smtp.getNames ( ) . get ( 0 ) ; org.junit.Assert.assertTrue ( event.getName ( ) . equals ( "message0" ) ) ; org.junit.Assert.assertTrue ( address.equals ( "dbtest1@redhat.com" ) ) ; }

Target:
public void testIncludeExcludeOrder ( ) { java.lang.String expected = "alonbl@redhat.com" ; filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( ( ( ( ( ( ( ( ( ( ( ( ( "" + "include:message1(smtp:" ) + expected ) + ") " ) + "include:message2(smtp:" ) + expected ) + ") " ) + "exclude:message3(smtp:" ) + expected ) + ") " ) + "exclude:message1(smtp:" ) + expected ) + ") " ) + "include:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message1" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message2" ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "message3" ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message1-->" + expected ) ) ) ; org.junit.Assert.assertTrue ( smtp.getEvents ( ) . contains ( ( "message2-->" + expected ) ) ) ; org.junit.Assert.assertEquals ( 2 , smtp.getEvents ( ) . size ( ) ) ; }
Source:
public void testNicExistsWhenNicNameIsNotNull ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNicExistsWhenNicNameIsNotNull ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNicId ( null ) ; attachment.setNicName ( "whatever" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . nicNameIsSet ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void setUpGetEntityExpectations ( int times ) { for ( int i = 0 ; i < times ; i ++ ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , getEntityList ( ) ) ; } }

Target:
private void setUpGetEntityExpectations ( int times ) { for ( int i = 0 ; i < times ; i ++ ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { PARENT_ID } , getEntityList ( ) ) ; } }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }