auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void executeCommand ( ) { boolean result = executeSshReboot ( org.ovirt.engine.core.bll.SshHostRebootCommand.getVds ( ) . getClusterCompatibilityVersion ( ) . toString ( ) ) ; if ( result ) { if ( ( org.ovirt.engine.core.bll.SshHostRebootCommand.getParameters ( ) . getPrevVdsStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) { setVdsStatus ( VDSStatus.Initializing ) ; } else { setVdsStatus ( VDSStatus.Maintenance ) ; } } org.ovirt.engine.core.bll.SshHostRebootCommand.setSucceeded ( result ) ; }

Target:
protected void executeCommand ( ) { boolean result = executeSshReboot ( org.ovirt.engine.core.bll.SshHostRebootCommand.getVds ( ) . getClusterCompatibilityVersion ( ) . toString ( ) ) ; if ( result ) { setVdsStatus ( VDSStatus.Reboot ) ; runSleepOnReboot ( getStatusAfterReboot ( ) ) ; } org.ovirt.engine.core.bll.SshHostRebootCommand.setSucceeded ( result ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; java.lang.String problem = null ; if ( ( importVmData.getError ( ) ) != null ) { problem = importVmData.getError ( ) ; } else { problem = ( importVmData.isNameExistsInTheSystem ( ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) : importVmData.getWarning ( ) ; } return problem != null ? com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( problem ) : null ; }

Target:
public java.lang.String getTooltip ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; java.lang.String problem = null ; if ( ( importVmData.getError ( ) ) != null ) { problem = importVmData.getError ( ) ; } else { problem = ( importVmData.isNameExistsInTheSystem ( ) ) ? org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . nameMustBeUniqueInvalidReason ( ) : importVmData.getWarning ( ) ; } return problem != null ? problem : "" ; }
Source:
public void testCdRomLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.CdRom cdrom = new org.ovirt.engine.api.model.CdRom ( ) ; cdrom.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.CDROM_ID ) ; cdrom.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; cdrom.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , cdrom ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.CDROM_HREF , cdrom.getHref ( ) ) ; }

Target:
public void testCdRomLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Cdrom cdrom = new org.ovirt.engine.api.model.Cdrom ( ) ; cdrom.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.CDROM_ID ) ; cdrom.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; cdrom.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , cdrom ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.CDROM_HREF , cdrom.getHref ( ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.VM model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Vm model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }
Source:
public void getValueWithMultipleVersions ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumOfVmSockets" ; org.ovirt.engine.core.config.EngineConfigTest.log.info ( "getValue: Testing fetch multiple version of {}" , key ) ; java.util.List < org.ovirt.engine.core.config.entity.ConfigKey > keys = config.getEngineConfigLogic ( ) . getConfigDAO ( ) . getKeysForName ( key ) ; for ( org.ovirt.engine.core.config.entity.ConfigKey configKey : keys ) { org.ovirt.engine.core.config.EngineConfigTest.log.info ( "{} version: {}" , configKey.getDisplayValue ( ) , configKey.getVersion ( ) ) ; } org.junit.Assert.assertTrue ( ( ( keys.size ( ) ) > 0 ) ) ; }

Target:
public void getValueWithMultipleVersions ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumOfVmSockets" ; org.ovirt.engine.core.config.EngineConfigTest.log.info ( "getValue: Testing fetch multiple version of {}" , key ) ; java.util.List < org.ovirt.engine.core.config.entity.ConfigKey > keys = config.getEngineConfigLogic ( ) . getConfigDao ( ) . getKeysForName ( key ) ; for ( org.ovirt.engine.core.config.entity.ConfigKey configKey : keys ) { org.ovirt.engine.core.config.EngineConfigTest.log.info ( "{} version: {}" , configKey.getDisplayValue ( ) , configKey.getVersion ( ) ) ; } org.junit.Assert.assertTrue ( ( ( keys.size ( ) ) > 0 ) ) ; }
Source:
public void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean doRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.SortListByNameConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllClusters , ( doRefresh ? new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) : new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) . withoutRefresh ( ) ) , aQuery ) ; }
Source:
public void testValidateInvalid ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.INVALID_ADDRESS ) ; org.junit.Assert.assertFalse ( actual.getSuccess ( ) ) ; org.junit.Assert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.contains ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.TEST_MESSAGE ) ) ; }

Target:
public void testValidateInvalid ( ) { final org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidation underTest = new org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.MyIpAddressValidation ( ) ; final org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actual = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.INVALID_ADDRESS ) ; org.junit.jupiter.api.Assertions.assertFalse ( actual.getSuccess ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( actual.getReasons ( ) , org.hamcrest.Matchers.contains ( org.ovirt.engine.ui.uicommonweb.validation.IpAddressValidationTest.TEST_MESSAGE ) ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.core.compat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage_domains > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.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.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.PostGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
public void testStaticTemplatedBarToFooClassMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl.class , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl.class ) ; assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , new org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl ( "overwrite" , "keep" ) ) ; assertEquals ( "bar" , foo.get ( ) ) ; assertEquals ( "keep" , foo.other ( ) ) ; }

Target:
public void testStaticTemplatedBarToFooClassMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl.class , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl.class ) ; org.junit.Assert.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , new org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl ( "overwrite" , "keep" ) ) ; org.junit.Assert.assertEquals ( "bar" , foo.get ( ) ) ; org.junit.Assert.assertEquals ( "keep" , foo.other ( ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
private void updateDestinationImageId ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters ) { org.ovirt.engine.core.common.businessentities.Image oldLeaf = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . get ( parameters.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( oldLeaf.getDiskId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : allImages ) { if ( image.getImage ( ) . isActive ( ) ) { parameters.setDestinationImageId ( image.getImageId ( ) ) ; break ; } } }

Target:
private void updateDestinationImageId ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters ) { org.ovirt.engine.core.common.businessentities.storage.Image oldLeaf = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . get ( parameters.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allImages = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( oldLeaf.getDiskId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : allImages ) { if ( image.getImage ( ) . isActive ( ) ) { parameters.setDestinationImageId ( image.getImageId ( ) ) ; break ; } } }
Source:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = java.util.Collections.singletonList ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; diskImageDao = prepareDAO ( dbFacade.getDiskImageDao ( ) ) ; imageDao = prepareDAO ( dbFacade.getImageDao ( ) ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.storage_domain_static ( ) ; newStaticDomain.setstorage_name ( "NewStorageDomain" ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getStorageDomainStaticDao ( ) ) ; dynamicDao = prepareDAO ( dbFacade.getStorageDomainDynamicDao ( ) ) ; diskImageDao = prepareDAO ( dbFacade.getDiskImageDao ( ) ) ; imageDao = prepareDAO ( dbFacade.getImageDao ( ) ) ; existingDomain = dao.get ( new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; newStaticDomain = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; newStaticDomain.setstorage_name ( "NewStorageDomain" ) ; newStaticDomain.setstorage ( "fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl" ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ) ) return false ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment that = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ) ( o ) ) ; return ( java.util.Objects.equals ( getNetworkId ( ) , that.getNetworkId ( ) ) ) && ( java.util.Objects.equals ( getNicId ( ) , that.getNicId ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) { return true ; } if ( ! ( o instanceof org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ) ) { return false ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment other = ( ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ) ( o ) ) ; return ( java.util.Objects.equals ( networkId , other.networkId ) ) && ( java.util.Objects.equals ( nicId , other.nicId ) ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterVolumeOptionInfoList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void setMessage ( java.lang.String errorMessage ) { super . setMessage ( errorMessage ) ; }

Target:
protected void showErrataListWithDetailsPopup ( java.lang.String filterCommand , java.lang.String title ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.HostErrataCountModel transferObj = new org.ovirt.engine.ui.uicommonweb.models.HostErrataCountModel ( ) ; transferObj.setFilterCommand ( filterCommand ) ; transferObj.setTitle ( title ) ; transferObj.setGuid ( getGuid ( ) ) ; setWindow ( transferObj ) ; initCommands ( transferObj ) ; }
Source:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.core.common.businessentities.Permissions entity , org.ovirt.engine.api.model.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getad_element_id ( ) ) ? users.get ( entity.getad_element_id ( ) ) : null ) ) ; }

Target:
protected org.ovirt.engine.api.model.Permission map ( org.ovirt.engine.core.common.businessentities.Permissions entity , org.ovirt.engine.api.model.Permission template ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = parent.getUsers ( ) ; return parent.map ( entity , ( users.containsKey ( entity.getAdElementId ( ) ) ? users.get ( entity.getAdElementId ( ) ) : null ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { switch ( nwk.getStatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Network nwk ) { switch ( nwk.getCluster ( ) . getstatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
public void poll ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } updateIteration ( ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.VmsMonitoring getVmsMonitoring ( org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher , long fetchTime ) { return new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime , getRefreshStatistics ( ) ) ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { java.lang.Boolean allowDupMacs = org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.AllowDuplicateMacAddresses ) ; return ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getMacPool ( ) . isMacInUse ( getMacAddress ( ) ) ) && ( ! allowDupMacs ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_MAC_ADDRESS_IN_USE ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult macAvailable ( ) { return new org.ovirt.engine.core.bll.validator.MacAddressValidator ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getMacPool ( ) , getMacAddress ( ) ) . isMacAssignableValidator ( ) ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.ImagesHandler.setDiskAlias ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) ) ; if ( resizeDiskImageRequested ( ) ) { extendDiskImageSize ( ) ; } else { try { performDiskUpdate ( false ) ; } finally { org.ovirt.engine.core.bll.UpdateVmDiskCommand.freeLock ( ) ; } } }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.ImagesHandler.setDiskAlias ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskInfo ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) ) ; if ( resizeDiskImageRequested ( ) ) { switch ( getOldDisk ( ) . getDiskStorageType ( ) ) { case IMAGE : extendDiskImageSize ( ) ; break ; case CINDER : extendCinderDiskSize ( ) ; break ; } } else { try { performDiskUpdate ( false ) ; } finally { org.ovirt.engine.core.bll.UpdateVmDiskCommand.freeLock ( ) ; } } }
Source:
public void qosBaloonNotSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.QOS_BALLOON_NOT_SUPPORTED ) ) ; }

Target:
public void qosBaloonNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.isEnableBallooning ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.qosBaloonSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.QOS_BALLOON_NOT_SUPPORTED ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.FAILED ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; dao.save ( service ) ; return service ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService insertTestService ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService ( ) ; service.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; service.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; service.setServiceId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_ID ) ) ; service.setServiceType ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVICE2_TYPE ) ; service.setStatus ( GlusterServiceStatus.UNKNOWN ) ; service.setMessage ( "test message" ) ; service.setPid ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_PID ) ; dao.save ( service ) ; return service ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.core.common.businessentities.Cluster model = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.core.common.businessentities.Cluster model = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cluster" , "add" , "dataCenter.name|id" ) ; } }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setOvfStore ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( null ) ) ) ; setUpMocksForAdd ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.AddGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( null ) ) ) ; setUpMocksForAdd ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void isValidVmNetworkForNonVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( false , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertFalse ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) ) ) ; }

Target:
public void isValidVmNetworkForNonVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNewNetwork ( false , NETWORK_NAME ) ; org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewViewableInterface ( ) ; iface.setNetworkName ( network.getName ( ) ) ; org.junit.Assert.assertFalse ( vmInterfaceManager.isValidVmNetwork ( iface , java.util.Collections.singletonMap ( network.getName ( ) , network ) , version ) ) ; }
Source:
public void canDoActionLunsNotPartOfStorageDomain ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUN_id ( "111" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUN_id ( "222" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_LUNS_NOT_PART_OF_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionLunsNotPartOfStorageDomain ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUN_id ( "111" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUN_id ( "222" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_LUNS_NOT_PART_OF_STORAGE_DOMAIN ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc createVG ( java.lang.String sdUUID , java.lang.String [ ] deviceList ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "LVMVolumeGroup.create" ) . withParameter ( "name" , sdUUID ) . withParameter ( "devlist" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( deviceList ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "uuid" ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.OneUuidReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.extend_image_ticket" ) . withParameter ( "uuid" , ticketId ) . withParameter ( "timeout" , timeout ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
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 ( ) ) ) ; }

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 ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void testGetWithInvalidId ( ) { org.ovirt.engine.core.common.businessentities.Bookmark result = dao.get ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getBookmarkDao ( ) ; newBookmark = new org.ovirt.engine.core.common.businessentities.Bookmark ( ) ; java.util.Random r = new java.util.Random ( java.lang.System.currentTimeMillis ( ) ) ; newBookmark.setbookmark_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newBookmark.setbookmark_name ( ( "newbookmarkname" + ( ( r.nextInt ( ) ) % ( org.ovirt.engine.core.dao.BookmarkDAOTest.BOOKMARK_MAX_RANDOM_NUMBER ) ) ) ) ; newBookmark.setbookmark_value ( "newbookmarkvalue" ) ; existingBookmark = dao.get ( new org.ovirt.engine.core.compat.Guid ( "a4affabf-7b45-4a6c-b0a9-107d0bbe265e" ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } java.lang.String storageDomain = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.STORAGE_DOMAIN ) ; if ( storageDomain != null ) { params.setStorageDomainId ( asGuid ( storageDomain ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } java.lang.String storageDomain = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.STORAGE_DOMAIN ) ; if ( storageDomain != null ) { params.setStorageDomainId ( asGuid ( storageDomain ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getGlusterVolumeDao ( ) ; server = dbFacade.getVdsStaticDao ( ) . get ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.SERVER_ID ) ; existingDistVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getGlusterVolumeDao ( ) ; server = dbFacade.getVdsStaticDao ( ) . get ( FixturesTool.VDS_RHEL6_NFS_SPM ) ; existingDistVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_DIST_ID ) ; existingReplVol = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterVolumeDaoTest.EXISTING_VOL_REPL_ID ) ; }
Source:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }
Source:
public static java.lang.String getSuggestedDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String diskPrefix , int count ) { java.lang.String diskAlias ; if ( disk == null ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , org.ovirt.engine.core.bll.ImagesHandler.DefaultDriveName ) ; org.ovirt.engine.core.bll.ImagesHandler.log.warnFormat ( "Disk object is null, the suggested default disk alias to be used is {0}" , diskAlias ) ; } else { java.lang.String defaultAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , java.lang.String.valueOf ( count ) ) ; diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDiskAliasWithDefault ( disk , defaultAlias ) ; } return diskAlias ; }

Target:
public static java.lang.String getSuggestedDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , java.lang.String diskPrefix , int count ) { java.lang.String diskAlias ; if ( disk == null ) { diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , org.ovirt.engine.core.bll.ImagesHandler.DefaultDriveName ) ; org.ovirt.engine.core.bll.ImagesHandler.log.warn ( "Disk object is null, the suggested default disk alias to be used is '{}'" , diskAlias ) ; } else { java.lang.String defaultAlias = org.ovirt.engine.core.bll.ImagesHandler.getDefaultDiskAlias ( diskPrefix , java.lang.String.valueOf ( count ) ) ; diskAlias = org.ovirt.engine.core.bll.ImagesHandler.getDiskAliasWithDefault ( disk , defaultAlias ) ; } return diskAlias ; }