auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected boolean canDoAction ( ) { Q validator = getProfileValidator ( ) ; return ( ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.parentEntityExists ( ) ) ) ) && ( validate ( validator.qosExistsOrNull ( ) ) ) ) && ( validate ( validator.profileNameNotUsed ( ) ) ) ; }

Target:
protected boolean validate ( ) { Q validator = getProfileValidator ( ) ; return ( ( ( validate ( validator.profileIsSet ( ) ) ) && ( validate ( validator.parentEntityExists ( ) ) ) ) && ( validate ( validator.qosExistsOrNull ( ) ) ) ) && ( validate ( validator.profileNameNotUsed ( ) ) ) ; }
Source:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic , null ) ) ) ; }

Target:
public void getFreeVfOneFreeVf ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > freeVfs = freeVfCommon ( 1 , 4 , 3 , 2 , 1 ) ; org.junit.Assert.assertEquals ( 1 , freeVfs.size ( ) ) ; org.junit.Assert.assertTrue ( freeVfs.contains ( hostNicVfsConfigHelper.getFreeVf ( nic ) ) ) ; }
Source:
public void testGetAllVMSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vmResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllVMSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public void numOfSocketChanged ( ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( ( numOfSockets == 0 ) || ( numOfSockets == 0 ) ) { return ; } getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; }

Target:
public void numOfSocketChanged ( ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( numOfSockets == 0 ) { return ; } getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; }
Source:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( bckndCmdParams.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }

Target:
public java.lang.Boolean runInTransaction ( ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( bckndCmdParams.getVdsId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : getNetworks ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( getVdsGroupId ( ) , net ) ; } return java.lang.Boolean.TRUE ; }
Source:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isDiskInterfaceSupported ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isDiskInterfaceSupported ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getQuota ( ) . setItems ( quotas ) ; getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas ) { quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getQuota ( ) . setItems ( quotas ) ; getQuota ( ) . setIsEmpty ( quotas.isEmpty ( ) ) ; updateControlsAvailability ( ) ; stopProgress ( ) ; }
Source:
public static java.lang.String generateState ( ) throws java.security.NoSuchAlgorithmException { if ( ( org.ovirt.engine.core.aaa.filters.FiltersHelper.secureRandom ) == null ) { org.ovirt.engine.core.aaa.filters.FiltersHelper.secureRandom = java.security.SecureRandom.getInstance ( "SHA1PRNG" ) ; } byte [ ] s = new byte [ 8 ] ; org.ovirt.engine.core.aaa.filters.FiltersHelper.secureRandom.nextBytes ( s ) ; return new org.apache.commons.codec.binary.Base64 ( 0 , new byte [ 0 ] , true ) . encodeToString ( s ) ; }

Target:
public static java.lang.String generateState ( ) { byte [ ] s = new byte [ 8 ] ; org.ovirt.engine.core.aaa.filters.FiltersHelper.secureRandom.nextBytes ( s ) ; return new org.apache.commons.codec.binary.Base64 ( 0 , new byte [ 0 ] , true ) . encodeToString ( s ) ; }
Source:
private java.lang.String createSpiceInvocationInfo ( ) { org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker rowMaker = new org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.auto ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeAuto ( ) ) ; rowMaker.append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.nativeClient ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.consoleInvokeNative ( ) ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isEnableDeprecatedClientModeSpicePlugin ( ) ) { rowMaker.append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.browserPlugin ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokePlugin ( ) ) ; } rowMaker.append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceHtml5 ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeHtml5 ( ) ) ; return rowMaker.toString ( ) ; }

Target:
private java.lang.String createSpiceInvocationInfo ( ) { org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker rowMaker = new org.ovirt.engine.ui.common.view.popup.ConsolePopupView.KeyValueHtmlRowMaker ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.auto ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeAuto ( ) ) ; rowMaker.append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.nativeClient ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.consoleInvokeNative ( ) ) ; rowMaker.append ( org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceHtml5 ( ) , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.constants.spiceInvokeHtml5 ( ) ) ; return rowMaker.toString ( ) ; }
Source:
protected boolean performImageChecksForRunningVm ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.List < java.lang.String > message , org.ovirt.engine.core.common.action.RunVmParams runParams , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) , message ) ) && ( org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( message , vm.getStoragePoolId ( ) , false , false , ( ( ! ( vm.isAutoStartup ( ) ) ) || ( ! ( runParams.getIsInternal ( ) ) ) ) , vmDisks ) ) ; }

Target:
protected boolean performImageChecksForRunningVm ( java.util.List < java.lang.String > message , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > vmDisks ) { org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( vmDisks ) ; return validate ( diskImagesValidator.diskImagesNotLocked ( ) , message ) ; }
Source:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private void updateDisplayAndGraphics ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > graphicsAndDisplays = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGraphicsAndDisplays ( osType , cluster.getCompatibilityVersion ( ) ) ; initDisplayModels ( graphicsAndDisplays ) ; }

Target:
private void updateDisplayAndGraphics ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > graphicsAndDisplays = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGraphicsAndDisplays ( osType , getCompatibilityVersion ( ) ) ; initDisplayModels ( graphicsAndDisplays ) ; }
Source:
private static void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.lang.String s = new java.lang.Integer ( vmDevice.getBootOrder ( ) ) . toString ( ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.put ( VdsProperties.BootOrder , s ) ; } }

Target:
private static void addBootOrder ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { java.lang.String s = java.lang.String.valueOf ( vmDevice.getBootOrder ( ) ) ; if ( ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( s ) ) ) && ( ! ( s.equals ( "0" ) ) ) ) { struct.put ( VdsProperties.BootOrder , s ) ; } }
Source:
public void nonMixedClusterServiceSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( false ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nonMixedClusterServiceSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , false ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( false ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createConnection ( java.lang.String id , java.lang.String connection , java.lang.String iqn , java.lang.String username , java.lang.String password , java.lang.String portal , java.lang.String port ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newConn = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newConn.setid ( id ) ; newConn.setconnection ( connection ) ; newConn.setiqn ( iqn ) ; newConn.setportal ( portal ) ; newConn.setport ( port ) ; newConn.setuser_name ( username ) ; newConn.setpassword ( password ) ; dao.save ( newConn ) ; return newConn ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createConnection ( java.lang.String id , java.lang.String connection , java.lang.String iqn , java.lang.String username , java.lang.String password , java.lang.String portal , java.lang.String port ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newConn = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; newConn.setId ( id ) ; newConn.setconnection ( connection ) ; newConn.setiqn ( iqn ) ; newConn.setportal ( portal ) ; newConn.setport ( port ) ; newConn.setuser_name ( username ) ; newConn.setpassword ( password ) ; dao.save ( newConn ) ; return newConn ; }
Source:
public void testPrefixChange ( ) { mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsTest.checkReturnValueEmpty ( getQuery ( ) ) ; }

Target:
public void testPrefixChange ( ) { getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . executeCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsTest.checkReturnValueEmpty ( getQuery ( ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( isInstanceType ( ) ) || ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isBlankTemplate ( ) ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( isInstanceType ( ) ) || ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isBlankTemplate ( ) ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters ( vds.getvds_group_id ( ) ) , "Networks" ) ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getvds_group_id ( ) ) , "Networks" ) ; }
Source:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; consoleOptionsPersister.storeToLocalStorage ( model.getModel ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( getEventBus ( ) , model.getModel ( ) ) ; } }

Target:
protected void beforeCommandExecuted ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . beforeCommandExecuted ( command ) ; if ( command == ( model.getDefaultCommand ( ) ) ) { removeListeners ( model ) ; getView ( ) . flushToPrivateModel ( ) ; consoleOptionsPersister.storeToLocalStorage ( model.getModel ( ) ) ; org.ovirt.engine.ui.common.presenter.popup.ConsoleModelChangedEvent.fire ( this , model.getModel ( ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = ( ( org.ovirt.engine.core.common.businessentities.Cluster ) ( returnValue ) ) ; if ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.stopProgress ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( ( cluster != null ) && ( cluster.supportsGlusterService ( ) ) ) { model.getForce ( ) . setIsAvailable ( true ) ; } model.stopProgress ( ) ; }
Source:
protected boolean canDoAction ( ) { M qosValidator = getQosValidator ( org.ovirt.engine.core.bll.qos.UpdateQosCommandBase.getQos ( ) ) ; return ( ( ( super . canDoAction ( ) ) && ( validate ( qosValidator.qosExists ( ) ) ) ) && ( validate ( qosValidator.consistentDataCenter ( ) ) ) ) && ( validate ( qosValidator.nameNotChangedOrNotTaken ( ) ) ) ; }

Target:
protected boolean validate ( ) { M qosValidator = getQosValidator ( org.ovirt.engine.core.bll.qos.UpdateQosCommandBase.getQos ( ) ) ; return ( ( ( super . validate ( ) ) && ( validate ( qosValidator.qosExists ( ) ) ) ) && ( validate ( qosValidator.consistentDataCenter ( ) ) ) ) && ( validate ( qosValidator.nameNotChangedOrNotTaken ( ) ) ) ; }
Source:
public void testValidateWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand ( params ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }

Target:
public void testValidateWithEmptySnapshotGuid ( ) { org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters params = new org.ovirt.engine.core.common.action.TryBackToAllSnapshotsOfVmParameters ( vmId , org.ovirt.engine.core.compat.Guid.Empty ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.snapshots.TryBackToAllSnapshotsOfVmCommand ( params , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( cmd ) . updateVmDisksFromDb ( ) ; org.mockito.Mockito.doReturn ( snapshotDao ) . when ( cmd ) . getSnapshotDao ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_CORRUPTED_VM_SNAPSHOT_ID ) ; }
Source:
public void shouldElectActiveLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareLocalStorageDomainForElection ( StorageDomainStatus.Active , "local domain name" ) ; org.mockito.Mockito.when ( hostedEngineHelper.isHostedEngineStorageDomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }

Target:
public void shouldElectActiveLocalDataDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain domain = prepareLocalStorageDomainForElection ( StorageDomainStatus.Active , "local domain name" ) ; org.junit.Assert.assertEquals ( domain , cmd.electNewMaster ( ) ) ; }
Source:
public void hasSharedDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.NFS ) ; org.mockito.Mockito.when ( spDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.createDefaultStoragePool ( ) ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void hasSharedDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.NFS ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( result ) ) . getReturnValue ( ) ; if ( vm == null ) { return ; } syncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; } }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue result ) { if ( result != null ) { org.ovirt.engine.core.common.businessentities.VM vm = result.getReturnValue ( ) ; if ( vm == null ) { return ; } syncSearch ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; } }
Source:
public void init ( ) { super . init ( ) ; setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . runVirtualMachinesTitle ( ) ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueString ( customPropertiesKeysList ) ; getCustomPropertySheet ( ) . setEntity ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }

Target:
public void init ( ) { super . init ( ) ; getIsAutoAssign ( ) . setEntity ( true ) ; getCustomPropertySheet ( ) . setKeyValueString ( customPropertiesKeysList ) ; getCustomPropertySheet ( ) . setEntity ( vm.getCustomProperties ( ) ) ; loadHosts ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "session_id" ) ) ; entity.setKey ( rs.getString ( "config_key" ) ) ; entity.setValue ( rs.getString ( "config_value" ) ) ; entity.setDescription ( rs.getString ( "config_description" ) ) ; entity.setAllowedValues ( ( ( rs.getString ( "config_possible_values" ) ) != null ? java.util.Arrays.asList ( rs.getString ( "config_possible_values" ) . split ( ";" ) ) : null ) ) ; return entity ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; PostInitTemplate ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; PostInitTemplate ( ) ; }
Source:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setSessionHelper ( sessionHelper ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void initParentResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource parent = resource.getParent ( ) . getParent ( ) . getParent ( ) ; parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel getModel ( ) { return getVmGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } @ java.lang.Override public void onSubTabDeselected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmGeneralSubTabView ( modelProvider , constants ) ; }

Target:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel < java.lang.Void > , org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.vms.VmGeneralModel getModel ( ) { return getVmGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } @ java.lang.Override public void onSubTabDeselected ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmGeneralSubTabView ( modelProvider ) ; }
Source:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_STORAGE_POOL_ID , domain.getstorage_pool_id ( ) ) ; } }

Target:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageDomainDAOTest.EXISTING_STORAGE_POOL_ID , domain.getStoragePoolId ( ) ) ; } }
Source:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false ) ; } }

Target:
protected void synchronizeNics ( org.ovirt.engine.core.compat.Guid vmId , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics , org.ovirt.engine.core.bll.context.CompensationContext compensationContext , org.ovirt.engine.core.compat.Version version ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmInterfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; vmInterfaceManager.removeAll ( vmId ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface vmInterface : nics ) { if ( ( vmInterface.getId ( ) ) == null ) { vmInterface.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; } vmInterface.setVmId ( vmId ) ; vmInterfaceManager.add ( vmInterface , compensationContext , false , version ) ; } }
Source:
protected boolean isVmNameValidLength ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String vmName = vm.getName ( ) ; int maxVmNameLengthWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthWindows ) ; int maxVmNameLengthNonWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxVmNameLengthNonWindows ) ; int maxLength = ( osRepository.isWindows ( vm.getVmOsId ( ) ) ) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows ; boolean nameLengthValid = ( vmName.length ( ) ) <= maxLength ; return nameLengthValid ; }

Target:
protected boolean isVmNameValidLength ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String vmName = vm.getName ( ) ; int maxVmNameLengthWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxVmNameLengthWindows ) ; int maxVmNameLengthNonWindows = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxVmNameLengthNonWindows ) ; int maxLength = ( osRepository.isWindows ( vm.getVmOsId ( ) ) ) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows ; boolean nameLengthValid = ( vmName.length ( ) ) <= maxLength ; return nameLengthValid ; }
Source:
private void readMessage ( java.nio.channels.SocketChannel socketChannel ) throws java.io.IOException { assert ( this . ibuff ) != null ; socketChannel.read ( this . ibuff ) ; if ( this . ibuff.hasRemaining ( ) ) { return ; } this . ibuff.rewind ( ) ; this . worker.processData ( this , socketChannel , this . ibuff.array ( ) ) ; this . ibuff = null ; this . byteBuffer.clear ( ) ; }

Target:
private void readMessage ( java.nio.channels.SocketChannel socketChannel ) throws java.io.IOException { socketChannel.read ( this . ibuff ) ; if ( this . ibuff.hasRemaining ( ) ) { return ; } this . ibuff.rewind ( ) ; this . worker.processData ( this , socketChannel , this . ibuff.array ( ) ) ; this . ibuff = null ; this . byteBuffer.clear ( ) ; }
Source:
public static java.util.Collection < java.lang.Object [ ] > comparisonParameters ( ) { return java.util.Arrays.asList ( new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { "www.redhat.com" } , new java.lang.Object [ ] { "www.redhat.com/" } , new java.lang.Object [ ] { "www.redhat.com/main" } , new java.lang.Object [ ] { "www.redhat.com/main/" } , new java.lang.Object [ ] { "www.redhat.com/main/index.html" } , new java.lang.Object [ ] { "http://www.redhat.com" } , new java.lang.Object [ ] { "http://www.redhat.com/" } , new java.lang.Object [ ] { "http://www.redhat.com/main" } , new java.lang.Object [ ] { "http://www.redhat.com/main/" } , new java.lang.Object [ ] { "http://www.redhat.com/main/index.html" } , new java.lang.Object [ ] { "www.redhat.com:80" } , new java.lang.Object [ ] { "www.redhat.com:80/" } , new java.lang.Object [ ] { "www.redhat.com:80/main" } , new java.lang.Object [ ] { "www.redhat.com:80/main/" } , new java.lang.Object [ ] { "www.redhat.com:80/main/index.html" } , new java.lang.Object [ ] { "http://www.redhat.com:80" } , new java.lang.Object [ ] { "http://www.redhat.com:80/" } , new java.lang.Object [ ] { "http://www.redhat.com:80/main" } , new java.lang.Object [ ] { "http://www.redhat.com:80/main/" } , new java.lang.Object [ ] { "http://www.redhat.com:80/main/index.html" } } ) ; }

Target:
public static java.lang.Object [ ] comparisonParameters ( ) { return new java.lang.Object [ ] { "www.redhat.com" , "www.redhat.com/" , "www.redhat.com/main" , "www.redhat.com/main/" , "www.redhat.com/main/index.html" , "http://www.redhat.com" , "http://www.redhat.com/" , "http://www.redhat.com/main" , "http://www.redhat.com/main/" , "http://www.redhat.com/main/index.html" , "www.redhat.com:80" , "www.redhat.com:80/" , "www.redhat.com:80/main" , "www.redhat.com:80/main/" , "www.redhat.com:80/main/index.html" , "http://www.redhat.com:80" , "http://www.redhat.com:80/" , "http://www.redhat.com:80/main" , "http://www.redhat.com:80/main/" , "http://www.redhat.com:80/main/index.html" } ; }
Source:
private static void assertIsSorted ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > result ) { org.ovirt.engine.core.common.businessentities.Network previous = null ; for ( org.ovirt.engine.core.common.businessentities.Network network : result ) { if ( ( previous != null ) && ( ( network.getName ( ) . compareTo ( previous.getName ( ) ) ) < 0 ) ) { org.junit.Assert.fail ( java.lang.String.format ( "List of networks is not ordered by network name, %s came before %s." , previous.getName ( ) , network.getName ( ) ) ) ; } previous = network ; } }

Target:
private static void assertIsSorted ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > result ) { org.ovirt.engine.core.common.businessentities.network.Network previous = null ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : result ) { if ( ( previous != null ) && ( ( network.getName ( ) . compareTo ( previous.getName ( ) ) ) < 0 ) ) { org.junit.Assert.fail ( java.lang.String.format ( "List of networks is not ordered by network name, %s came before %s." , previous.getName ( ) , network.getName ( ) ) ) ; } previous = network ; } }
Source:
private void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { onDataLoad ( ) ; } } ) ; getCollapseSnapshots ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel.ON_DISK_LOAD ) ) ; } } ) ; }

Target:
protected void postInitDisks ( ) { onDataLoad ( ) ; checkDestFormatCompatibility ( ) ; StopProgress ( ) ; getStorage ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { onDataLoad ( ) ; } } ) ; getCollapseSnapshots ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel.ON_DISK_LOAD ) ) ; } } ) ; }
Source:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.ArgumentMatchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; }

Target:
public void canSetNumaPinning ( ) { paramNumaNodes.clear ( ) ; paramNumaNodes.add ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , vdsNumaNodes ) ) ; mockCommandWithVmFromParams ( ) ; command.executeCommand ( ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massRemoveNumaNodeByNumaNodeId ( org.mockito.ArgumentMatchers.eq ( existingNumaNodeIds ) ) ; org.mockito.Mockito.verify ( vmNumaNodeDao ) . massSaveNumaNode ( org.mockito.ArgumentMatchers.eq ( paramNumaNodes ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void validateFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoConflictServers ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook = getHookEntity ( ) ; hook.setServerHooks ( java.util.Collections.singletonList ( getGlusterServerHook ( 0 , GlusterHookStatus.MISSING ) ) ) ; setUpMocksForUpdate ( true , hook ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS.toString ( ) ) ) ; }
Source:
public void shouldWeightNewestHostsBetterOnVmStarts ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasItems ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BAD_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasSize ( 2 ) ) ; }

Target:
public void shouldWeightNewestHostsBetterOnVmStarts ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , newEnoughHost , tooOldHost ) , org.hamcrest.Matchers.hasItems ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BAD_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasSize ( 2 ) ) ; }