auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 ) ; org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_3 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_3 ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID , GlusterStatus.UP ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 ) ; org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; org.mockito.Mockito.doReturn ( getBricksFromServer ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_3 , GlusterStatus.UP ) ) . when ( brickDao ) . getGlusterVolumeBricksByServerId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_3 ) ; org.mockito.Mockito.doReturn ( getGlusterVolumes ( GlusterStatus.UP ) ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setVds ( null ) ; if ( ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) ) != null ) && ( shouldVdsBeFenced ( ) ) ) { super . executeCommand ( ) ; } else { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.log.infoFormat ( "Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsId ( ) ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setVds ( null ) ; if ( ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) ) != null ) && ( shouldVdsBeFenced ( ) ) ) { super . executeCommand ( ) ; } else { org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.setCommandShouldBeLogged ( false ) ; log.infoFormat ( "Host {0}({1}) not fenced since it's status is ok, or it doesn't exist anymore." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsId ( ) ) ; } }
Source:
public void calculateNetworkImplementationDetailsManagedNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertManaged ( iface , true , createNetworksMap ( iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) ) ) ; }

Target:
public void calculateNetworkImplementationDetailsManagedNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertManaged ( iface , true , createNetworksMap ( iface.getNetworkName ( ) , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) ) ) ; }
Source:
private com.google.gwt.resources.client.ImageResource getImage ( T value ) { com.google.gwt.resources.client.ResourcePrototype resource = resources.getResource ( imageName ( value ) ) ; if ( ( resource == null ) || ( ! ( resource instanceof com.google.gwt.resources.client.ImageResource ) ) ) { return ( ( com.google.gwt.resources.client.ImageResource ) ( resources.getResource ( defaultImageName ( value ) ) ) ) ; } return ( ( com.google.gwt.resources.client.ImageResource ) ( resource ) ) ; }

Target:
private com.google.gwt.resources.client.ImageResource getImage ( T value ) { com.google.gwt.resources.client.ResourcePrototype resource = resources.getResource ( imageName ( value ) ) ; if ( ! ( resource instanceof com.google.gwt.resources.client.ImageResource ) ) { return ( ( com.google.gwt.resources.client.ImageResource ) ( resources.getResource ( defaultImageName ( value ) ) ) ) ; } return ( ( com.google.gwt.resources.client.ImageResource ) ( resource ) ) ; }
Source:
public void executeCommand ( ) { setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForRemove ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . remove ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_REMOVED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.api.model.Disk > values ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > result = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.api.model.Disk diskImage : values ) { result.put ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskImage ) ) . getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskImage ) ) ) ; } return result ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.api.model.Disk > values ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > result = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.api.model.Disk diskImage : values ) { result.put ( diskImage.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskImage ) ) ) ; } return result ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "NoneBootProtocolAvailable" . equals ( propertyName ) ) { bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; } else if ( "Message" . equals ( propertyName ) ) { message.setText ( model.getMessage ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostBondInterfaceModel ) ( sender ) ) ; java.lang.String propertyName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "NoneBootProtocolAvailable" . equals ( propertyName ) ) { bootProtocol.setEnabled ( NetworkBootProtocol.NONE , model.getNoneBootProtocolAvailable ( ) ) ; } else if ( "Message" . equals ( propertyName ) ) { message.setText ( model.getMessage ( ) ) ; } }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filterDisksByType ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels , org.ovirt.engine.core.common.businessentities.storage.DiskStorageType type ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filteredList = new java.util.ArrayList < > ( ) ; if ( diskModels != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel item : diskModels ) { if ( ( item.getDisk ( ) . getDiskStorageType ( ) ) == type ) { filteredList.add ( item ) ; } } } return filteredList ; }

Target:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filterDisksByType ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels , org.ovirt.engine.core.common.businessentities.storage.DiskStorageType type ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filteredList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel item : diskModels ) { if ( ( item.getDisk ( ) . getDiskStorageType ( ) ) == type ) { filteredList.add ( item ) ; } } return filteredList ; }
Source:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( "filter" ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true ) ; control.replay ( ) ; resource.get ( ) ; }

Target:
public void testQueryWithFilter ( ) throws java.lang.Exception { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( "filter" ) ) . andReturn ( filterValue ) ; resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( true , true ) ; control.replay ( ) ; resource.get ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "IsGrouppedByTarget" ) ) { updateListByGropping ( object ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } else if ( propName.equals ( "IsGrouppedByTarget" ) ) { updateListByGropping ( object ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.VmPoolMap ) ( obj ) ) ; return ( java.util.Objects.equals ( vmId , other.vmId ) ) && ( java.util.Objects.equals ( vmPoolId , other.vmPoolId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VmPoolMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.VmPoolMap ) ( obj ) ) ; return ( java.util.Objects.equals ( vmId , other.vmId ) ) && ( java.util.Objects.equals ( vmPoolId , other.vmPoolId ) ) ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.Matchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.Matchers.eq ( false ) , org.mockito.Matchers.eq ( waitForResult ) ) ; java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > callbacks = callbackCaptor.getAllValues ( ) ; return callbacks ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.Matchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.Matchers.eq ( false ) , org.mockito.Matchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }
Source:
public void executeCommandWithRebalanceCompleteInNode ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.FINISHED , true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.FINISHED ) , org.mockito.ArgumentMatchers.anyMap ( ) , org.mockito.ArgumentMatchers.eq ( true ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWithRebalanceCompleteInNode ( ) { cmd.setGlusterVolumeId ( volumeWithRebalanceTask ) ; mockBackend ( true , JobExecutionStatus.FINISHED , true , null ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( cmd ) . endStepJob ( org.mockito.ArgumentMatchers.eq ( JobExecutionStatus.FINISHED ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.eq ( true ) ) ; org.mockito.Mockito.verify ( cmd ) . releaseVolumeLock ( ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksListForStorageAllocations ( ) ; return disksList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > mockDisksList ( int numberOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( numberOfDisks ) ; for ( int index = 0 ; index < numberOfDisks ; index ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; disksList.add ( image ) ; } org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSourceImages ( ) ; return disksList ; }
Source:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' function is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > pairs = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { pairs.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , 1 ) ) ; } return pairs ; }

Target:
public java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > score ( @ javax.validation.constraints.NotNull org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' function is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , java.lang.Integer > > pairs = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : hosts ) { pairs.add ( new org.ovirt.engine.core.common.utils.Pair ( vds.getId ( ) , 1 ) ) ; } return pairs ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "LastEvent" . equals ( args.propertyName ) ) { if ( ( ( model.getLastEvent ( ) ) == null ) && ( model.isRequestingData ( ) ) ) { clearData ( ) ; } else { updateData ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "LastEvent" . equals ( args.propertyName ) ) { updateData ( ) ; } }
Source:
protected boolean validateImages ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , false , true , true , true , true , true , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ) ; }

Target:
protected boolean validateImages ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVm ( ) . getStoragePoolId ( ) , true , true , true , true , org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) ) ; }
Source:
public void testParseNoAction ( ) { java.lang.System.out.println ( "Testing parse args with no action..." ) ; try { parser.parse ( new java.lang.String [ ] { "-b" , "-t" , "filename" } ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.Exception e ) { java.lang.System.out.println ( e.getMessage ( ) ) ; } java.lang.System.out.println ( "\n" ) ; }

Target:
public void testParseNoAction ( ) { parser.parse ( new java.lang.String [ ] { "-b" , "-t" , "filename" } ) ; }
Source:
public void updateHibernationMemory ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid memoryDumpDiskId , org.ovirt.engine.core.compat.Guid memoryMetadataDiskId , java.lang.String memoryVolume ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "memory_volume" , getNullableRepresentation ( memoryVolume ) ) . addValue ( "memory_dump_disk_id" , memoryDumpDiskId ) . addValue ( "memory_metadata_disk_id" , memoryMetadataDiskId ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_type" , SnapshotType.ACTIVE.name ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateMemory" , parameterSource ) ; }

Target:
public void updateHibernationMemory ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid memoryDumpDiskId , org.ovirt.engine.core.compat.Guid memoryMetadataDiskId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "memory_dump_disk_id" , memoryDumpDiskId ) . addValue ( "memory_metadata_disk_id" , memoryMetadataDiskId ) . addValue ( "vm_id" , vmId ) . addValue ( "snapshot_type" , SnapshotType.ACTIVE.name ( ) ) ; getCallsHandler ( ) . executeModification ( "UpdateMemory" , parameterSource ) ; }
Source:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultClusterID , org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.DEFAULT_CLUSTER_ID ) ; addDefaultClusterToPool ( ) ; storagePoolWithLocalFS ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_CLUSTER_CANNOT_BE_LOCALFS ) ) . when ( poolValidator ) . isNotLocalfsWithDefaultCluster ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_CLUSTER_CANNOT_BE_LOCALFS ) ; }

Target:
public void poolHasDefaultCluster ( ) { org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.mcr.mockConfigValue ( ConfigValues.AutoRegistrationDefaultClusterID , org.ovirt.engine.core.bll.storage.pool.UpdateStoragePoolCommandTest.DEFAULT_CLUSTER_ID ) ; addDefaultClusterToPool ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_CLUSTER_CANNOT_BE_LOCALFS ) ) . when ( poolValidator ) . isNotLocalfsWithDefaultCluster ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_CLUSTER_CANNOT_BE_LOCALFS ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AuditLog saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString , logType.getSeverity ( ) ) ; if ( auditLog == null ) { return null ; } auditLogable.setPropertiesForAuditLog ( auditLog ) ; auditLog.setUserName ( org.apache.commons.lang.StringUtils.abbreviate ( auditLog.getUserName ( ) , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.USERNAME_LENGTH ) ) ; getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; return auditLog ; }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLog saveToDb ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = createAuditLog ( auditLogable , logType , loggerString ) ; if ( auditLog == null ) { return null ; } auditLogable.setPropertiesForAuditLog ( auditLog ) ; auditLog.setUserName ( org.apache.commons.lang.StringUtils.abbreviate ( auditLog.getUserName ( ) , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.USERNAME_LENGTH ) ) ; getDbFacadeInstance ( ) . getAuditLogDao ( ) . save ( auditLog ) ; return auditLog ; }
Source:
public void canDoActionFailedVMNotFound ( ) throws java.lang.Exception { initializeCommand ( ) ; mockNullVm ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND.toString ( ) ) ) ; }

Target:
public void canDoActionFailedVMNotFound ( ) throws java.lang.Exception { mockNullVm ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND.toString ( ) ) ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel interfaceModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceListModel ) ( model ) ) ; java.lang.Iterable iVdcQueryableItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items = new java.util.ArrayList < > ( ) ; java.util.Iterator networkInterfacesIterator = iVdcQueryableItems.iterator ( ) ; while ( networkInterfacesIterator.hasNext ( ) ) { items.add ( ( ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ) ( networkInterfacesIterator.next ( ) ) ) ) ; } interfaceModel.updateItems ( items ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > iVdcQueryableItems = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items = new java.util.ArrayList < > ( ) ; java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkInterfacesIterator = iVdcQueryableItems.iterator ( ) ; while ( networkInterfacesIterator.hasNext ( ) ) { items.add ( ( ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ) ( networkInterfacesIterator.next ( ) ) ) ) ; } updateItems ( items ) ; }
Source:
public java.lang.Object runInTransaction ( ) { handleVdsInformation ( ) ; vm.setRunOnVds ( getVdsId ( ) ) ; if ( getParameters ( ) . isClearHibernationVolumes ( ) ) { vm.setHibernationVolHandle ( StringUtils.EMPTY ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { vm.setRunOnVds ( getVdsId ( ) ) ; if ( getParameters ( ) . isClearHibernationVolumes ( ) ) { vm.setHibernationVolHandle ( StringUtils.EMPTY ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vm.getDynamicData ( ) ) ; return null ; }
Source:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . getVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; int sleepInterval = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }

Target:
private boolean checkIfHostBecomeUp ( ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = getResourceManager ( ) . getVdsManager ( org.ovirt.engine.core.bll.pm.SshSoftFencingCommand.getVdsId ( ) ) ; long sleepInterval = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsRefreshRate ) ) * 1000 ; while ( vdsManager.isHostInGracePeriod ( true ) ) { if ( ( vdsManager.getCopyVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return true ; } org.ovirt.engine.core.utils.ThreadUtils.sleep ( sleepInterval ) ; } return false ; }
Source:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.SetupNetworksHelper helper , org.ovirt.engine.core.dal.VdcBllMessages violation ) { java.util.List < org.ovirt.engine.core.dal.VdcBllMessages > violations = helper.validate ( ) ; junit.framework.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation ) ) ; }

Target:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.SetupNetworksHelper helper , org.ovirt.engine.core.dal.VdcBllMessages violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; junit.framework.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }
Source:
private void markIsSetNonOperationalExecuted ( ) { if ( ! ( _vdsManager.isSetNonOperationalExecuted ( ) ) ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = getDbFacade ( ) . getVdsDynamicDao ( ) . get ( _vds.getId ( ) ) ; if ( ( vdsDynamic.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) { _vdsManager.setIsSetNonOperationalExecuted ( true ) ; } } }

Target:
private void markIsSetNonOperationalExecuted ( ) { if ( ! ( _vdsManager.isSetNonOperationalExecuted ( ) ) ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = getDbFacade ( ) . getVdsDynamicDao ( ) . get ( _vds.getId ( ) ) ; if ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) { _vdsManager.setIsSetNonOperationalExecuted ( true ) ; } } }
Source:
public void testValidateNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( null ) . when ( storageDomainDaoMock ) . get ( storageDomain.getId ( ) ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "validate shouldn't be possible for a non-existent storage domain" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testValidateNonExistingStorageDomain ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( storageDomainDaoMock ) . getAllForStorageDomain ( storageDomain.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "validate shouldn't be possible for a non-existent storage domain" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }

Target:
public void commandFailsSlaveNotOvirtMonitored ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.SetupGlusterGeoRepMountBrokerInternalCommand ( new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , new java.util.HashSet ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) , null , null ) ) ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private void addSuggestItem ( java.lang.String firstPart , org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartType firstPartType , java.lang.String secondPart , org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartType secondPartType ) { org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel tempVar = new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel ( ) ; tempVar.setPartString ( firstPart ) ; tempVar.setPartType ( firstPartType ) ; org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel tempVar2 = new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel ( ) ; tempVar2.setPartString ( secondPart ) ; tempVar2.setPartType ( secondPartType ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel > parts = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel > ( java.util.Arrays.asList ( new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel [ ] { tempVar , tempVar2 } ) ) ; getItems ( ) . add ( parts ) ; }

Target:
private void addSuggestItem ( java.lang.String firstPart , org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartType firstPartType , java.lang.String secondPart , org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartType secondPartType ) { org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel tempVar = new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel ( ) ; tempVar.setPartString ( firstPart ) ; tempVar.setPartType ( firstPartType ) ; org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel tempVar2 = new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel ( ) ; tempVar2.setPartString ( secondPart ) ; tempVar2.setPartType ( secondPartType ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel > parts = new java.util.ArrayList ( java.util.Arrays.asList ( new org.ovirt.engine.ui.uicommonweb.models.autocomplete.SuggestItemPartModel [ ] { tempVar , tempVar2 } ) ) ; getItems ( ) . add ( parts ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) == 0 ) { promptNoQuotaInDCMessage ( ) ; } else { OnSaveInternal ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) . size ( ) ) == 0 ) { promptNoQuotaInDCMessage ( ) ; } else { OnSaveInternal ( ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.QueryParametersBase.class ) ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain mockGetExistingDomain ( boolean answerWithDomain ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = null ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; if ( answerWithDomain ) { sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.getStorageStaticData ( ) . setConnection ( new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ) ; domains = java.util.Collections.singletonList ( sd ) ; } org.mockito.Mockito.doReturn ( createQueryReturnValueWith ( domains ) ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( ) ) ; return sd ; }
Source:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( Guid.Empty ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( VdcBllMessages.GLUSTER_VOLUME_ID_INVALID , returnValue.getExceptionString ( ) ) ; }

Target:
public void testQueryForInvalidVolumeId ( ) { org.mockito.Mockito.doReturn ( Guid.Empty ) . when ( getQueryParameters ( ) ) . getVolumeId ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( volumeDao ) . getById ( Guid.Empty ) ; getQuery ( ) . executeQueryCommand ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( getQuery ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertEquals ( VdcBllMessages.GLUSTER_VOLUME_ID_INVALID.toString ( ) , returnValue.getExceptionString ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.MacsStorage createMacsStorage ( java.lang.String rangesString ) { java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( rangesString ) ; org.ovirt.engine.core.bll.network.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } if ( macsStorage.availableMacExist ( ) ) { return macsStorage ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_INITIALIZATION_FAILED ) ; } }

Target:
private org.ovirt.engine.core.bll.network.MacsStorage createMacsStorage ( java.lang.String rangesString ) { java.util.Collection < org.apache.commons.lang.math.LongRange > rangesBoundaries = org.ovirt.engine.core.utils.MacAddressRangeUtils.parseRangeString ( rangesString ) ; org.ovirt.engine.core.bll.network.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.MacsStorage ( allowDuplicates ) ; for ( org.apache.commons.lang.math.LongRange range : rangesBoundaries ) { macsStorage.addRange ( range.getMinimumLong ( ) , range.getMaximumLong ( ) ) ; } return macsStorage ; }
Source:
public void mapAction ( ) { for ( org.ovirt.engine.api.model.WatchdogAction action : org.ovirt.engine.api.model.WatchdogAction.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogAction backendAction = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( action , null ) ; org.junit.Assert.assertNotNull ( backendAction ) ; org.junit.Assert.assertEquals ( backendAction.name ( ) . toLowerCase ( ) , action.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapAction ( ) { for ( org.ovirt.engine.api.model.WatchdogAction action : org.ovirt.engine.api.model.WatchdogAction.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogAction backendAction = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( action ) ; org.junit.Assert.assertNotNull ( backendAction ) ; org.junit.Assert.assertEquals ( backendAction.name ( ) . toLowerCase ( ) , action.name ( ) . toLowerCase ( ) ) ; } }
Source:
private boolean hostUuidExists ( org.ovirt.engine.core.compat.Guid addedServerUuid ) { org.ovirt.engine.core.dao.gluster.GlusterServerDao glusterServerDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getGlusterServerDao ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid ( addedServerUuid ) ; if ( ( glusterServer == null ) || ( ( glusterServer != null ) && ( glusterServer.getId ( ) . equals ( getVds ( ) . getId ( ) ) ) ) ) { return false ; } return true ; }

Target:
private boolean hostUuidExists ( org.ovirt.engine.core.compat.Guid addedServerUuid ) { org.ovirt.engine.core.dao.gluster.GlusterServerDao glusterServerDao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getGlusterServerDao ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServer glusterServer = glusterServerDao.getByGlusterServerUuid ( addedServerUuid ) ; if ( ( glusterServer == null ) || ( glusterServer.getId ( ) . equals ( getVds ( ) . getId ( ) ) ) ) { return false ; } return true ; }
Source:
private void initDestSDs ( org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > command ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd1 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd1.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ; sd2.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_2 ) ; command.destStorages.put ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 , sd1 ) ; command.destStorages.put ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_2 , sd2 ) ; }

Target:
protected void initDestSDs ( org.ovirt.engine.core.bll.AddVmCommand < ? extends org.ovirt.engine.core.common.action.VmManagementParametersBase > command ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd1 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd1.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ; sd2.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_2 ) ; command.destStorages.put ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 , sd1 ) ; command.destStorages.put ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_2 , sd2 ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStoragePoolAndDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExtension , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , fileTypeExtension , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByStoragePoolAndDomainId ( storagePoolId , storageDomainId ) ; return repoList ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > getUserRequestForStoragePoolAndDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.FileTypeExtension fileTypeExtension , boolean forceRefresh ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > repoList = null ; if ( ! ( isStorageDomainValid ( storageDomainId , fileTypeExtension , forceRefresh ) ) ) { return null ; } repoList = getCachedIsoListByStoragePoolAndDomainId ( storagePoolId , storageDomainId , fileTypeExtension ) ; return repoList ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDynamic createVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVmId ( ) ) ; vmDynamic.setStatus ( VMStatus.ImageLocked ) ; vmDynamic.setVmHost ( "" ) ; vmDynamic.setVmIp ( "" ) ; vmDynamic.setVmFQDN ( "" ) ; vmDynamic.setLastStopTime ( new java.util.Date ( ) ) ; vmDynamic.setAppList ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getAppList ( ) ) ; return vmDynamic ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDynamic createVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setId ( getVmId ( ) ) ; vmDynamic.setStatus ( VMStatus.ImageLocked ) ; vmDynamic.setVmHost ( "" ) ; vmDynamic.setVmIp ( "" ) ; vmDynamic.setVmFQDN ( "" ) ; vmDynamic.setLastStopTime ( new java.util.Date ( ) ) ; vmDynamic.setAppList ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getVm ( ) . getAppList ( ) ) ; return vmDynamic ; }